From c33e13b04cb52f6163ee8b16340d7ed2a6b56715 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 09:41:45 +0530 Subject: [PATCH 01/54] updating to kernel 4.6.1 --- .../pom.xml | 4 +- .../pom.xml | 56 +- ...ApiApplicationRegistrationServiceImpl.java | 8 +- .../api/filter/ApiPermissionFilter.java | 7 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../pom.xml | 70 +- .../APIManagementProviderService.java | 9 +- .../APIManagementProviderServiceImpl.java | 300 +- ...ApplicationManagerExtensionDataHolder.java | 20 +- ...ationManagerExtensionServiceComponent.java | 28 +- .../pom.xml | 166 +- .../client/publisher/PublisherClient.java | 89 +- .../integration/client/store/StoreClient.java | 124 +- .../pom.xml | 268 +- .../src/main/resources/publisher-api.yaml | 14189 ++++++++++++---- .../pom.xml | 228 +- .../publisher/APIPublisherServiceImpl.java | 192 +- .../internal/APIPublisherDataHolder.java | 18 +- .../APIPublisherServiceComponent.java | 28 +- components/apimgt-extensions/pom.xml | 6 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 74 +- .../application/mgt/core/util/OAuthUtils.java | 2 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../pom.xml | 52 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../pom.xml | 40 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 3 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 4 +- .../pom.xml | 17 +- .../DeviceManagementConfigServiceImpl.java | 4 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../pom.xml | 4 +- .../org.wso2.carbon.device.mgt.api/pom.xml | 67 +- .../api/DeviceEventManagementService.java | 466 +- .../service/api/GeoLocationBasedService.java | 366 +- .../service/impl/DeviceAgentServiceImpl.java | 52 +- .../DeviceEventManagementServiceImpl.java | 626 +- .../impl/GeoLocationBasedServiceImpl.java | 402 +- .../CredentialManagementResponseBuilder.java | 10 +- .../mgt/jaxrs/util/DeviceMgtAPIUtils.java | 61 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../org.wso2.carbon.device.mgt.common/pom.xml | 18 +- .../org.wso2.carbon.device.mgt.core/pom.xml | 62 +- .../mgt/core/DeviceManagementConstants.java | 2 + .../impl/DeviceInformationManagerImpl.java | 24 +- .../DeviceManagementProviderServiceImpl.java | 34 +- .../mgt/core/util/DeviceManagerUtil.java | 24 +- .../pom.xml | 6 +- .../pom.xml | 4 +- components/device-mgt/pom.xml | 4 +- .../pom.xml | 28 +- .../pom.xml | 9 +- .../grant/AccessTokenGrantHandler.java | 5 +- .../grant/ExtendedJWTGrantHandler.java | 8 +- .../ExtendedSAML2BearerGrantHandler.java | 5 +- .../pom.xml | 4 +- .../pom.xml | 4 +- components/identity-extensions/pom.xml | 4 +- .../pom.xml | 6 +- .../org.wso2.carbon.policy.mgt.core/pom.xml | 4 +- components/policy-mgt/pom.xml | 2 +- .../org.wso2.carbon.email.sender.core/pom.xml | 4 +- .../pom.xml | 26 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../io.entgra.ui.request.interceptor/pom.xml | 25 +- .../request/interceptor/InvokerHandler.java | 9 +- .../ui/request/interceptor/LoginHandler.java | 73 +- .../interceptor/SsoLoginCallbackHandler.java | 2 +- .../request/interceptor/SsoLoginHandler.java | 6 +- .../ui/request/interceptor/UserHandler.java | 33 +- .../interceptor/util/HandlerConstants.java | 3 +- .../request/interceptor/util/HandlerUtil.java | 19 +- .../webapp/META-INF/webapp-classloading.xml | 2 +- .../pom.xml | 22 +- .../pom.xml | 6 +- .../conf/webapp-publisher-config.xml | 2 +- features/apimgt-extensions/pom.xml | 4 +- .../application-mgt-datasources.xml | 2 +- features/certificate-mgt/pom.xml | 1 - .../pom.xml | 98 +- .../apis/admin--OAuth2TokenManagement.xml | 2 +- .../admin--UserManagementValidateUser.xml | 2 +- .../src/main/resources/conf/mdm-ui-config.xml | 2 +- .../pom.xml | 4 +- features/device-mgt/pom.xml | 2 +- .../pom.xml | 16 +- pom.xml | 143 +- 96 files changed, 13707 insertions(+), 5158 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml index 4c32e6f2ae..a530cbcfa1 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml @@ -73,8 +73,8 @@ org.wso2.carbon.apimgt.annotations.* - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, javax.servlet, javax.xml.*, diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index a77543fc93..9ec68e7315 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -34,42 +34,56 @@ http://wso2.org - - org.apache.cxf - cxf-rt-frontend-jaxws - provided + io.swagger + swagger-annotations - org.apache.cxf - cxf-rt-frontend-jaxrs + org.springframework + spring-web provided org.apache.cxf - cxf-rt-transports-http + cxf-bundle-jaxrs provided + + + + + + + + + + + + + + + + - - org.codehaus.jackson - jackson-core-asl - + + + + org.codehaus.jackson jackson-jaxrs - - javax - javaee-web-api - provided - - - javax.ws.rs - jsr311-api - provided - + + + + + + + + + + commons-httpclient.wso2 commons-httpclient diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java index aec0df4a16..96d3c8e059 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java @@ -27,8 +27,8 @@ import org.wso2.carbon.apimgt.application.extension.api.util.RegistrationProfile import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants; import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; -import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor; -import org.wso2.carbon.apimgt.integration.client.store.StoreClient; +//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor; +//import org.wso2.carbon.apimgt.integration.client.store.StoreClient; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; @@ -110,12 +110,10 @@ public class ApiApplicationRegistrationServiceImpl implements ApiApplicationRegi if (username.equals(registrationProfile.getUsername())) { synchronized (ApiApplicationRegistrationServiceImpl.class) { - StoreClient storeClient = new StoreClient(new OAuthRequestInterceptor(registrationProfile.getUsername(), - registrationProfile.getPassword())); ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys( applicationName, registrationProfile.getTags(), ApiApplicationConstants.DEFAULT_TOKEN_TYPE, username, - registrationProfile.isAllowedToAllDomains(), validityPeriod, storeClient); + registrationProfile.isAllowedToAllDomains(), validityPeriod); return Response.status(Response.Status.CREATED).entity(apiApplicationKey.toString()).build(); } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java index 0c78488a2d..fc3efadb42 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java @@ -25,7 +25,12 @@ import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import javax.servlet.*; +import javax.servlet.Filter; +import javax.servlet.FilterChain; +import javax.servlet.FilterConfig; +import javax.servlet.ServletException; +import javax.servlet.ServletRequest; +import javax.servlet.ServletResponse; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.xml.bind.JAXBContext; diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/webapp-classloading.xml index b410b42670..5cb6aa6282 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - CXF,Carbon + CXF3,Carbon diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index a04bf65bb9..9e70ed3009 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -51,14 +51,25 @@ org.wso2.carbon org.wso2.carbon.logging - - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.integration.client - - - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.integration.generated.client - + + + + + + + + + + org.wso2.carbon.apimgt + org.wso2.carbon.apimgt.api + 9.0.5 + + + org.wso2.carbon.apimgt + org.wso2.carbon.apimgt.impl + 9.0.5 + provided + com.googlecode.json-simple.wso2 json-simple @@ -72,6 +83,11 @@ org.wso2.carbon.identity.jwt.client.extension provided + + org.wso2.carbon.devicemgt + org.wso2.carbon.device.mgt.core + provided + @@ -100,24 +116,26 @@ ${carbon.device.mgt.version} API Management Application Bundle org.wso2.carbon.apimgt.application.extension.internal - - org.osgi.framework, - org.osgi.service.component, - org.apache.commons.logging.*, - org.wso2.carbon.user.core.*, - org.wso2.carbon.user.api, - org.wso2.carbon.utils.multitenancy, - org.json.simple, - org.wso2.carbon.context, - org.wso2.carbon.base, - org.wso2.carbon.registry.core.*;resolution:=optional, - org.wso2.carbon.registry.indexing.*; version="${carbon.registry.imp.pkg.version.range}", - org.wso2.carbon.apimgt.integration.client.*, - org.wso2.carbon.apimgt.integration.generated.client.store.api, - org.wso2.carbon.apimgt.integration.generated.client.store.model, - org.wso2.carbon.identity.jwt.client.extension.*, - feign - + + org.apache.commons.lang;version="[2.6,3)",org.apache.c + ommons.logging;version="[1.2,2)",org.json.simple,org.osgi.framework;v + ersion="${imp.package.version.osgi.framework}",org.osgi.service.component;version="${imp.package.version.osgi.service}",org.wso + 2.carbon.apimgt.api;version="[9.0,10)",org.wso2.carbon.apimgt.api.dto + ;version="[9.0,10)",org.wso2.carbon.apimgt.api.model;version="[9.0,10 + )",org.wso2.carbon.apimgt.application.extension.bean,org.wso2.carbon. + apimgt.application.extension.dto,org.wso2.carbon.apimgt.application.e + xtension.exception,org.wso2.carbon.apimgt.impl;version="[9.0,10)",org + .wso2.carbon.apimgt.impl.utils;version="[9.0,10)",org.wso2.carbon.con + text;version="[4.6,5)",org.wso2.carbon.device.mgt.core.config.ui;vers + ion="[4.1,5)",org.wso2.carbon.identity.jwt.client.extension,org.wso2. + carbon.identity.jwt.client.extension.dto,org.wso2.carbon.identity.jwt + .client.extension.exception,org.wso2.carbon.identity.jwt.client.exten + sion.service,org.wso2.carbon.registry.core.exceptions;version="[1.0,2 + )",org.wso2.carbon.registry.core.service;version="[1.0,2)",org.wso2.c + arbon.registry.indexing.service;version="[4.7,5)",org.wso2.carbon.use + r.api;version="[1.0,2)",org.wso2.carbon.user.core.service;version="[4 + .6,5)",org.wso2.carbon.user.core.tenant;version="[4.6,5)" + !org.wso2.carbon.apimgt.application.extension.internal, org.wso2.carbon.apimgt.application.extension.* diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java index 62d353d0fd..67fe9e2583 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java @@ -20,8 +20,9 @@ package org.wso2.carbon.apimgt.application.extension; import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; -import org.wso2.carbon.apimgt.integration.client.store.StoreClient; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; +//import org.wso2.carbon.apimgt.integration.client.store.StoreClient; +//import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; /** * This comprise on operation that is been done with api manager from CDMF. This service needs to be implemented in APIM. @@ -61,17 +62,17 @@ public interface APIManagementProviderService { * @param username to whom the application is created * @param isAllowedAllDomains application is allowed to all the tenants * @param validityTime validity period of the application - * @param storeClient Specified store client +// * @param storeClient Specified store client * @return consumerkey and secrete of the created application. * @throws APIManagerException */ + ApiApplicationKey generateAndRetrieveApplicationKeys(String apiApplicationName, String tags[], String keyType, String username, boolean isAllowedAllDomains, - String validityTime, - StoreClient storeClient) throws APIManagerException; + String validityTime, String scopes) throws APIManagerException; /** * Remove APIM Application. diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java index 0c957fd4e7..cc385dff44 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java @@ -18,19 +18,46 @@ package org.wso2.carbon.apimgt.application.extension; -import feign.FeignException; +//import feign.FeignException; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.apimgt.api.APIAdmin; +import org.wso2.carbon.apimgt.api.APIConsumer; +import org.wso2.carbon.apimgt.api.APIManagementException; +import org.wso2.carbon.apimgt.api.APIProvider; +import org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO; +import org.wso2.carbon.apimgt.api.model.API; +import org.wso2.carbon.apimgt.api.model.APIKey; +import org.wso2.carbon.apimgt.api.model.ApiTypeWrapper; +import org.wso2.carbon.apimgt.api.model.Application; +import org.wso2.carbon.apimgt.api.model.KeyManagerConfiguration; +import org.wso2.carbon.apimgt.api.model.SubscribedAPI; +import org.wso2.carbon.apimgt.api.model.Subscriber; import org.wso2.carbon.apimgt.application.extension.bean.APIRegistrationProfile; import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants; import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; import org.wso2.carbon.apimgt.application.extension.internal.APIApplicationManagerExtensionDataHolder; import org.wso2.carbon.apimgt.application.extension.util.APIManagerUtil; -import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor; -import org.wso2.carbon.apimgt.integration.client.store.StoreClient; -import org.wso2.carbon.apimgt.integration.generated.client.store.model.*; +import org.wso2.carbon.apimgt.impl.APIAdminImpl; +import org.wso2.carbon.apimgt.impl.APIConstants; +import org.wso2.carbon.apimgt.impl.APIManagerFactory; +//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor; +//import org.wso2.carbon.apimgt.integration.client.store.StoreClient; +//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIInfo; +//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIList; +//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Application; +//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationInfo; +//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKey; +//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKeyGenerateRequest; +//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationList; +//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Subscription; +//import org.wso2.carbon.apimgt.integration.generated.client.store.model.SubscriptionList; +import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.device.mgt.core.config.ui.UIConfiguration; +import org.wso2.carbon.device.mgt.core.config.ui.UIConfigurationManager; import org.wso2.carbon.identity.jwt.client.extension.JWTClient; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; @@ -39,7 +66,11 @@ import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import java.util.ArrayList; +import java.util.HashMap; +import java.util.HashSet; import java.util.List; +import java.util.Map; +import java.util.Set; /** * This class represents an implementation of APIManagementProviderService. @@ -50,48 +81,66 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe private static final String CONTENT_TYPE = "application/json"; private static final int MAX_API_PER_TAG = 200; private static final String APP_TIER_TYPE = "application"; + public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance(); + @Override public boolean isTierLoaded() { - StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() - .getStoreClient(); +// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() +// .getStoreClient(); String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext() .getTenantDomain(); +// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); +// try { try { - storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, - APP_TIER_TYPE, - tenantDomain, CONTENT_TYPE, null, null); - return true; - } catch (FeignException e) { - log.error("Feign Exception", e); - if (e.status() == 401) { - OAuthRequestInterceptor oAuthRequestInterceptor = new OAuthRequestInterceptor(); - String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); - oAuthRequestInterceptor.removeToken(username, tenantDomain); - try { - storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, - APP_TIER_TYPE, tenantDomain, CONTENT_TYPE, null, null); - } catch (FeignException ex) { - log.error("Invalid Attempt : " + ex); - } - } - } catch (Exception e) { + APIUtil.getTiers(APIConstants.TIER_APPLICATION_TYPE, tenantDomain); + } catch (APIManagementException e) { log.error("APIs not ready", e); } - return false; + // storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, +// APP_TIER_TYPE, +// tenantDomain, CONTENT_TYPE, null, null); + return true; +// } catch (FeignException e) { +// log.error("Feign Exception", e); +// if (e.status() == 401) { +// OAuthRequestInterceptor oAuthRequestInterceptor = new OAuthRequestInterceptor(); +// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); +// oAuthRequestInterceptor.removeToken(username, tenantDomain); +// try { +// storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, +// APP_TIER_TYPE, tenantDomain, CONTENT_TYPE, null, null); +// } catch (FeignException ex) { +// log.error("Invalid Attempt : " + ex); +// } +// } +// } catch (Exception e) { +// log.error("APIs not ready", e); +// } +// return false; } @Override public void removeAPIApplication(String applicationName, String username) throws APIManagerException { - StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() - .getStoreClient(); - ApplicationList applicationList = storeClient.getApplications() - .applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null); - if (applicationList.getList() != null && applicationList.getList().size() > 0) { - ApplicationInfo applicationInfo = applicationList.getList().get(0); - storeClient.getIndividualApplication().applicationsApplicationIdDelete(applicationInfo.getApplicationId(), - null, null); +// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() +// .getStoreClient(); +// ApplicationList applicationList = storeClient.getApplications() +// .applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null); + try { + APIConsumer apiConsumer = API_MANAGER_FACTORY.getAPIConsumer(username); + Application application = apiConsumer.getApplicationsByName(username, applicationName, ""); + if (application != null) { +// ApplicationInfo applicationInfo = applicationList.getList().get(0); +// storeClient.getIndividualApplication().applicationsApplicationIdDelete(applicationInfo.getApplicationId(), +// null, null); + apiConsumer.removeApplication(application, username); + } + } catch (APIManagementException e) { + //todo:amalka + e.printStackTrace(); } + + } /** @@ -100,94 +149,80 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe @Override public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[], String keyType, String username, - boolean isAllowedAllDomains, String validityTime, - StoreClient sClient) throws APIManagerException { - - StoreClient storeClient; + boolean isAllowedAllDomains, + String validityTime, String scopes) throws APIManagerException { - if (sClient == null) { - storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() - .getStoreClient(); - } else { - storeClient = sClient; + String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); + if (StringUtils.isEmpty(username)) { + username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); } - - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext() - .getTenantDomain(); try { - ApplicationList applicationList = storeClient.getApplications() - .applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null); - Application application; - if (applicationList == null || applicationList.getList() == null || applicationList.getList().size() == 0) { - //create application; - application = new Application(); - application.setName(applicationName); - application.setSubscriber(username); - application.setDescription(""); - application.setThrottlingTier(ApiApplicationConstants.DEFAULT_TIER); + APIConsumer apiConsumer = API_MANAGER_FACTORY.getAPIConsumer(username); + Application application = apiConsumer.getApplicationsByName(username, applicationName, ""); + + int applicationId = 0; + Subscriber subscriber = null; + if (application == null) { + subscriber = apiConsumer.getSubscriber(username); + if (subscriber == null) { + // create subscriber + apiConsumer.addSubscriber(username, ""); + subscriber = apiConsumer.getSubscriber(username); + } + //create application + application = new Application(applicationName, subscriber); + application.setTier(ApiApplicationConstants.DEFAULT_TIER); application.setGroupId(""); - application = storeClient.getIndividualApplication().applicationsPost(application, CONTENT_TYPE); + applicationId = apiConsumer.addApplication(application, username); } else { - ApplicationInfo applicationInfo = applicationList.getList().get(0); - application = storeClient.getIndividualApplication() - .applicationsApplicationIdGet(applicationInfo.getApplicationId(), CONTENT_TYPE, null, null); - } - if (application == null) { - throw new APIManagerException( - "Api application creation failed for " + applicationName + " to the user " + username); + applicationId = application.getId(); + subscriber = apiConsumer.getSubscriber(username); } - SubscriptionList subscriptionList = storeClient.getSubscriptions().subscriptionsGet - (null, application.getApplicationId(), "", 0, 100, CONTENT_TYPE, null); - List needToSubscribe = new ArrayList<>(); + Set subscribedAPIs = + apiConsumer.getSubscribedAPIsByApplicationId(subscriber, applicationId, ""); + + log.info("Already subscribed API count: " + subscribedAPIs.size()); + // subscribe to apis. + Set tempApiIds = new HashSet<>(); if (tags != null && tags.length > 0) { for (String tag : tags) { - APIList apiList = storeClient.getApis().apisGet(MAX_API_PER_TAG, 0, tenantDomain, "tag:" + tag - , CONTENT_TYPE, null); - if (apiList.getList() == null || apiList.getList().size() == 0) { - apiList = storeClient.getApis().apisGet(MAX_API_PER_TAG, 0 - , MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, "tag:" + tag, CONTENT_TYPE, null); + Set apisWithTag = apiConsumer.getAPIsWithTag(tag, tenantDomain); + if (apisWithTag == null || apisWithTag.size() == 0) { + apisWithTag = apiConsumer.getAPIsWithTag(tag, MultitenantConstants.SUPER_TENANT_DOMAIN_NAME); } - if (apiList.getList() != null && apiList.getList().size() > 0) { - for (APIInfo apiInfo : apiList.getList()) { - String id = apiInfo.getProvider().replace("@", "-AT-") - + "-" + apiInfo.getName() + "-" + apiInfo.getVersion(); - id = id.replace(" ", "+"); + if (apisWithTag != null && apisWithTag.size() > 0) { + for (API apiInfo : apisWithTag) { + String id = apiInfo.getId().getProviderName().replace("@", "-AT-") + + "-" + apiInfo.getId().getName() + "-" + apiInfo.getId().getVersion(); + // todo: amalka will this break old apis? boolean subscriptionExist = false; - if (subscriptionList.getList() != null && subscriptionList.getList().size() > 0) { - for (Subscription subs : subscriptionList.getList()) { - if (subs.getApiIdentifier().equals(id)) { + if (subscribedAPIs.size() > 0) { + for (SubscribedAPI subscribedAPI : subscribedAPIs) { + if (String.valueOf(subscribedAPI.getApiId().toString()).equals(id)) { subscriptionExist = true; break; } } } - if (!subscriptionExist) { - Subscription subscription = new Subscription(); - //fix for APIMANAGER-5566 admin-AT-tenant1.com-Tenant1API1-1.0.0 - - subscription.setApiIdentifier(id); - subscription.setApplicationId(application.getApplicationId()); - subscription.tier(ApiApplicationConstants.DEFAULT_TIER); - if (!needToSubscribe.contains(subscription)) { - needToSubscribe.add(subscription); - } + if (!subscriptionExist && !tempApiIds.contains(id)) { + ApiTypeWrapper apiTypeWrapper = new ApiTypeWrapper(apiInfo); + apiTypeWrapper.setTier(ApiApplicationConstants.DEFAULT_TIER); + apiConsumer.addSubscription(apiTypeWrapper, username, applicationId, ""); + tempApiIds.add(id); } } } } } - if (!needToSubscribe.isEmpty()) { - storeClient.getSubscriptionMultitpleApi().subscriptionsMultiplePost(needToSubscribe, CONTENT_TYPE); - } //end of subscription - List applicationKeys = application.getKeys(); + List applicationKeys = application.getKeys(); if (applicationKeys != null) { - for (ApplicationKey applicationKey : applicationKeys) { - if (keyType.equals(applicationKey.getKeyType().toString())) { + for (APIKey applicationKey : applicationKeys) { + if (keyType.equals(applicationKey.getType())) { if (applicationKey.getConsumerKey() != null && !applicationKey.getConsumerKey().isEmpty()) { ApiApplicationKey apiApplicationKey = new ApiApplicationKey(); apiApplicationKey.setConsumerKey(applicationKey.getConsumerKey()); @@ -198,33 +233,74 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe } } - ApplicationKeyGenerateRequest applicationKeyGenerateRequest = new ApplicationKeyGenerateRequest(); List allowedDomains = new ArrayList<>(); if (isAllowedAllDomains) { allowedDomains.add(ApiApplicationConstants.ALLOWED_DOMAINS); } else { allowedDomains.add(APIManagerUtil.getTenantDomain()); } - applicationKeyGenerateRequest.setAccessAllowDomains(allowedDomains); - applicationKeyGenerateRequest.setCallbackUrl(""); - applicationKeyGenerateRequest.setKeyType(ApplicationKeyGenerateRequest.KeyTypeEnum.PRODUCTION); - applicationKeyGenerateRequest.setValidityTime(validityTime); - - ApplicationKey applicationKey = storeClient.getIndividualApplication().applicationsGenerateKeysPost( - application.getApplicationId(), applicationKeyGenerateRequest, CONTENT_TYPE, null, null); - if (applicationKey.getConsumerKey() != null && !applicationKey.getConsumerKey().isEmpty()) { - ApiApplicationKey apiApplicationKey = new ApiApplicationKey(); - apiApplicationKey.setConsumerKey(applicationKey.getConsumerKey()); - apiApplicationKey.setConsumerSecret(applicationKey.getConsumerSecret()); - return apiApplicationKey; + + APIAdmin apiAdmin = new APIAdminImpl(); + String keyManagerId = null; + try { + List keyManagerConfigurations = apiAdmin + .getKeyManagerConfigurationsByTenant(tenantDomain); + if (keyManagerConfigurations != null) { + for (KeyManagerConfigurationDTO keyManagerConfigurationDTO : keyManagerConfigurations) { + keyManagerId = keyManagerConfigurationDTO.getUuid(); + } + } + String jsonString = "{\"grant_types\":\"refresh_token,urn:ietf:params:oauth:grant-type:saml2-bearer," + + "password,client_credentials,iwa:ntlm,urn:ietf:params:oauth:grant-type:jwt-bearer\"," + + "\"additionalProperties\":\"{\\\"application_access_token_expiry_time\\\":\\\"N\\/A\\\"," + + "\\\"user_access_token_expiry_time\\\":\\\"N\\/A\\\"," + + "\\\"refresh_token_expiry_time\\\":\\\"N\\/A\\\"," + + "\\\"id_token_expiry_time\\\":\\\"N\\/A\\\"}\"," + + "\"username\":\"" + username + "\"}"; + + // if scopes not defined + if (StringUtils.isEmpty(scopes)) { + UIConfigurationManager uiConfigurationManager = UIConfigurationManager.getInstance(); + UIConfiguration uiConfiguration = uiConfigurationManager.getUIConfig(); + List scopeList = uiConfiguration.getScopes(); + + if (scopeList != null && scopeList.size() > 0) { + StringBuilder builder = new StringBuilder(); + for (String scope : scopeList) { + String tmpScope = scope + " "; + builder.append(tmpScope); + } + scopes = builder.toString(); + } + + if (StringUtils.isEmpty(scopes)) { + scopes = scopes.trim(); + } else { + scopes = "default"; + } + } + + Map keyDetails = apiConsumer + .requestApprovalForApplicationRegistration(username, applicationName, keyType, "", + allowedDomains.toArray(new String[allowedDomains.size()]), validityTime, scopes, "", + jsonString, keyManagerId, tenantDomain); + + if (keyDetails != null) { + ApiApplicationKey apiApplicationKey = new ApiApplicationKey(); + apiApplicationKey.setConsumerKey((String) keyDetails.get("consumerKey")); + apiApplicationKey.setConsumerSecret((String) keyDetails.get("consumerSecret")); + return apiApplicationKey; + } + throw new APIManagerException("Failed to generate keys for tenant: " + tenantDomain); + } catch (APIManagementException e) { + throw new APIManagerException("Failed to create api application for tenant: " + tenantDomain, e); } - throw new APIManagerException("Failed to generate keys for tenant: " + tenantDomain); - } catch (FeignException e) { + } catch (APIManagementException e) { throw new APIManagerException("Failed to create api application for tenant: " + tenantDomain, e); } } - /** + /** * {@inheritDoc} */ @Override @@ -311,7 +387,7 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe if (registrationProfile.getUsername() == null || registrationProfile.getUsername().isEmpty()) { info = generateAndRetrieveApplicationKeys(registrationProfile.getApplicationName(), - registrationProfile.getTags(), tokenType, registrationProfile.getApplicationName(), + registrationProfile.getTags(), tokenType, null, registrationProfile.isAllowedToAllDomains(), validityPeriod); } } finally { diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java index 90f297e6d3..368fda3a3b 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java @@ -18,7 +18,7 @@ package org.wso2.carbon.apimgt.application.extension.internal; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; -import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; +//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; @@ -35,7 +35,7 @@ public class APIApplicationManagerExtensionDataHolder { private TenantManager tenantManager; private TenantRegistryLoader tenantRegistryLoader; private TenantIndexingLoader indexLoader; - private IntegrationClientService integrationClientService; +// private IntegrationClientService integrationClientService; private JWTClientManagerService jwtClientManagerService; private APIApplicationManagerExtensionDataHolder() { @@ -94,14 +94,14 @@ public class APIApplicationManagerExtensionDataHolder { return indexLoader; } - public IntegrationClientService getIntegrationClientService() { - return integrationClientService; - } - - public void setIntegrationClientService( - IntegrationClientService integrationClientService) { - this.integrationClientService = integrationClientService; - } +// public IntegrationClientService getIntegrationClientService() { +// return integrationClientService; +// } +// +// public void setIntegrationClientService( +// IntegrationClientService integrationClientService) { +// this.integrationClientService = integrationClientService; +// } public JWTClientManagerService getJwtClientManagerService() { if (jwtClientManagerService == null) { diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java index 9d28c89f16..4d98527956 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java @@ -23,7 +23,7 @@ import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext;; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl; -import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; +//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader; import org.wso2.carbon.user.core.service.RealmService; @@ -49,12 +49,6 @@ import org.wso2.carbon.user.core.service.RealmService; * policy="dynamic" * bind="setRealmService" * unbind="unsetRealmService" - * @scr.reference name="integration.client.service" - * interface="org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService" - * cardinality="1..1" - * policy="dynamic" - * bind="setIntegrationClientService" - * unbind="unsetIntegrationClientService" */ public class APIApplicationManagerExtensionServiceComponent { @@ -97,16 +91,16 @@ public class APIApplicationManagerExtensionServiceComponent { APIApplicationManagerExtensionDataHolder.getInstance().setIndexLoaderService(null); } - protected void setIntegrationClientService(IntegrationClientService integrationClientService) { - if (integrationClientService != null && log.isDebugEnabled()) { - log.debug("integrationClientService initialized"); - } - APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(integrationClientService); - } - - protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) { - APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(null); - } +// protected void setIntegrationClientService(IntegrationClientService integrationClientService) { +// if (integrationClientService != null && log.isDebugEnabled()) { +// log.debug("integrationClientService initialized"); +// } +// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(integrationClientService); +// } +// +// protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) { +// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(null); +// } /** * Sets Realm Service. diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index eeddf628a5..0784f282aa 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -47,46 +47,39 @@ org.wso2.carbon.apimgt.integration.client.*, !org.wso2.carbon.apimgt.integration.client.internal - - org.osgi.framework, - org.osgi.service.component, - feign, - feign.codec, - feign.auth, - feign.gson, - feign.slf4j, - org.wso2.carbon.apimgt.integration.generated.client.publisher.api, - org.wso2.carbon.apimgt.integration.generated.client.store.api, - javax.xml.bind, - javax.xml.bind.annotation, - javax.xml.parsers;resolution:=optional, - org.apache.commons.logging, - org.w3c.dom, - org.wso2.carbon.context, - org.wso2.carbon.identity.jwt.client.*, - org.wso2.carbon.user.api, - org.wso2.carbon.utils, - com.fasterxml.jackson.annotation, - io.swagger.annotations, - org.wso2.carbon.core.util, - javax.xml, - org.wso2.carbon.base, - javax.net.ssl, - org.apache.commons.lang, - android.util;resolution:=optional, - javax.annotation;resolution:=optional, - javax.net;resolution:=optional, - javax.security.auth.x500;resolution:=optional, - javax.crypto;resolution:=optional, - javax.crypto.spec;resolution:=optional - - - jsr311-api, - feign-jaxrs, - feign-okhttp, - okhttp, - okio - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -120,55 +113,60 @@ - - com.squareup.okhttp3 - okhttp - - - com.squareup.okio - okio - + + + + + + + + io.github.openfeign feign-okhttp - - org.wso2.carbon - org.wso2.carbon.logging - - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.osgi - org.eclipse.osgi.services - - - com.google.code.gson - gson - - - javax.ws.rs - jsr311-api - + + io.github.openfeign + feign-slf4j + 10.7.2 + + + + + + + + + + + + + + + + + + + + + - - io.swagger - swagger-annotations - - - junit - junit - + + + + + + + + io.github.openfeign feign-core - - io.github.openfeign - feign-jackson - + + + + io.github.openfeign feign-jaxrs @@ -178,10 +176,10 @@ feign-gson - - org.testng - testng - + + + + org.wso2.carbon.devicemgt org.wso2.carbon.identity.jwt.client.extension diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java index 3887d59c66..73a4234a91 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java @@ -27,7 +27,8 @@ import feign.slf4j.Slf4jLogger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader; -import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.*; +import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApIsApi; +import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApiLifecycleApi; import org.wso2.carbon.core.util.Utils; /** @@ -36,13 +37,15 @@ import org.wso2.carbon.core.util.Utils; public class PublisherClient { private static final Log log = LogFactory.getLog(PublisherClient.class); - private APIIndividualApi api = null; - private APICollectionApi apis = null; - private DocumentIndividualApi document = null; - private ApplicationIndividualApi application = null; - private EnvironmentCollectionApi environments = null; - private SubscriptionCollectionApi subscriptions = null; - private ThrottlingTierCollectionApi tiers = null; + private ApIsApi apIsApi = null; + private ApiLifecycleApi apiLifecycleApi = null; +// private APIIndividualApi api = null; +// private APICollectionApi apis = null; +// private DocumentIndividualApi document = null; +// private ApplicationIndividualApi application = null; +// private EnvironmentCollectionApi environments = null; +// private SubscriptionApi subscriptions = null; +// private ThrottlingTierCollectionApi tiers = null; /** @@ -57,40 +60,50 @@ public class PublisherClient { .requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder()); String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getPublisherEndpoint()); - api = builder.target(APIIndividualApi.class, basePath); - apis = builder.target(APICollectionApi.class, basePath); - document = builder.target(DocumentIndividualApi.class, basePath); - application = builder.target(ApplicationIndividualApi.class, basePath); - environments = builder.target(EnvironmentCollectionApi.class, basePath); - subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); - tiers = builder.target(ThrottlingTierCollectionApi.class, basePath); + apIsApi = builder.target(ApIsApi.class, basePath); + apiLifecycleApi = builder.target(ApiLifecycleApi.class, basePath); +// api = builder.target(APIIndividualApi.class, basePath); +// apis = builder.target(APICollectionApi.class, basePath); +// document = builder.target(DocumentIndividualApi.class, basePath); +// application = builder.target(ApplicationIndividualApi.class, basePath); +// environments = builder.target(EnvironmentCollectionApi.class, basePath); +// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); +// tiers = builder.target(ThrottlingTierCollectionApi.class, basePath); } - public APIIndividualApi getApi() { - return api; + public ApIsApi getApIsApi() { + return apIsApi; } - public APICollectionApi getApis() { - return apis; + public ApiLifecycleApi getApiLifecycleApi() { + return apiLifecycleApi; } - public DocumentIndividualApi getDocument() { - return document; - } - - public ApplicationIndividualApi getApplication() { - return application; - } - - public EnvironmentCollectionApi getEnvironments() { - return environments; - } - - public SubscriptionCollectionApi getSubscriptions() { - return subscriptions; - } - - public ThrottlingTierCollectionApi getTiers() { - return tiers; - } + // public APIIndividualApi getApi() { +// return api; +// } +// +// public APICollectionApi getApis() { +// return apis; +// } +// +// public DocumentIndividualApi getDocument() { +// return document; +// } +// +// public ApplicationIndividualApi getApplication() { +// return application; +// } +// +// public EnvironmentCollectionApi getEnvironments() { +// return environments; +// } +// +// public SubscriptionCollectionApi getSubscriptions() { +// return subscriptions; +// } +// +// public ThrottlingTierCollectionApi getTiers() { +// return tiers; +// } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java index db751f204e..5d8a46d586 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java @@ -39,16 +39,17 @@ import java.util.concurrent.TimeUnit; public class StoreClient { private static final org.apache.commons.logging.Log log = LogFactory.getLog(StoreClient.class); - private APICollectionApi apis = null; - private APIIndividualApi individualApi = null; - private ApplicationCollectionApi applications = null; - private ApplicationIndividualApi individualApplication = null; - private SubscriptionCollectionApi subscriptions = null; - private SubscriptionIndividualApi individualSubscription = null; - private SubscriptionMultitpleApi subscriptionMultitpleApi = null; - private ThrottlingTierIndividualApi individualTier = null; - private TagCollectionApi tags = null; - private ThrottlingTierCollectionApi tiers = null; + private ApplicationsApi applicationsApi = null; +// private APICollectionApi apis = null; +// private ApIsApi individualApi = null; +// private ApplicationsApi applications = null; +// private ApplicationIndividualApi individualApplication = null; +// private SubscriptionCollectionApi subscriptions = null; +// private SubscriptionIndividualApi individualSubscription = null; +// private SubscriptionMultitpleApi subscriptionMultitpleApi = null; +// private ThrottlingTierIndividualApi individualTier = null; +// private TagsApi tags = null; +// private ThrottlingTierCollectionApi tiers = null; public StoreClient(RequestInterceptor requestInterceptor) { @@ -60,58 +61,59 @@ public class StoreClient { .requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder()); String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getStoreEndpoint()); - apis = builder.target(APICollectionApi.class, basePath); - individualApi = builder.target(APIIndividualApi.class, basePath); - applications = builder.target(ApplicationCollectionApi.class, basePath); - individualApplication = builder.target(ApplicationIndividualApi.class, basePath); - subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); - individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath); - subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath); - tags = builder.target(TagCollectionApi.class, basePath); - individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath); - tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1)) - .options(new Request.Options(10000, 5000)) - .target(ThrottlingTierCollectionApi.class, basePath); + applicationsApi = builder.target(ApplicationsApi.class, basePath); +// apis = builder.target(APICollectionApi.class, basePath); +// individualApi = builder.target(ApIsApi.class, basePath); +// applications = builder.target(ApplicationCollectionApi.class, basePath); +// individualApplication = builder.target(ApplicationIndividualApi.class, basePath); +// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); +// individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath); +// subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath); +// tags = builder.target(TagCollectionApi.class, basePath); +// individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath); +// tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1)) +// .options(new Request.Options(10000, 5000)) +// .target(ThrottlingTierCollectionApi.class, basePath); } - public APICollectionApi getApis() { - return apis; - } - - public APIIndividualApi getIndividualApi() { - return individualApi; - } - - public ApplicationCollectionApi getApplications() { - return applications; - } - - public ApplicationIndividualApi getIndividualApplication() { - return individualApplication; - } - - public SubscriptionCollectionApi getSubscriptions() { - return subscriptions; - } - - public SubscriptionIndividualApi getIndividualSubscription() { - return individualSubscription; - } - - public ThrottlingTierIndividualApi getIndividualTier() { - return individualTier; - } - - public TagCollectionApi getTags() { - return tags; - } - - public ThrottlingTierCollectionApi getTiers() { - return tiers; - } - - public SubscriptionMultitpleApi getSubscriptionMultitpleApi() { - return subscriptionMultitpleApi; - } +// public APICollectionApi getApis() { +// return apis; +// } +// +// public APIIndividualApi getIndividualApi() { +// return individualApi; +// } +// +// public ApplicationCollectionApi getApplications() { +// return applications; +// } +// +// public ApplicationIndividualApi getIndividualApplication() { +// return individualApplication; +// } +// +// public SubscriptionCollectionApi getSubscriptions() { +// return subscriptions; +// } +// +// public SubscriptionIndividualApi getIndividualSubscription() { +// return individualSubscription; +// } +// +// public ThrottlingTierIndividualApi getIndividualTier() { +// return individualTier; +// } +// +// public TagCollectionApi getTags() { +// return tags; +// } +// +// public ThrottlingTierCollectionApi getTiers() { +// return tiers; +// } +// +// public SubscriptionMultitpleApi getSubscriptionMultitpleApi() { +// return subscriptionMultitpleApi; +// } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index 22c399e5b7..cc300b8014 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -26,61 +26,59 @@ http://wso2.org + - - - io.swagger - swagger-codegen-maven-plugin - 2.2.1 - - - process-resources - publisher - - generate - - - ${project.basedir}/src/main/resources/publisher-api.yaml - java - - ${project.artifactId}.publisher.api - ${project.artifactId}.publisher.model - - feign - - - - process-resources - store - - generate - - - ${project.basedir}/src/main/resources/store-api.yaml - java - - ${project.artifactId}.store.api - ${project.artifactId}.store.model - - feign - - - - + + org.openapitools + openapi-generator-maven-plugin + 5.0.0 + + + process-resources + publisher + + generate + + + ${project.basedir}/src/main/resources/publisher-api.yaml + java + + ${project.artifactId}.publisher.api + ${project.artifactId}.publisher.model + + + + + process-resources + store + + generate + + + ${project.basedir}/src/main/resources/devportal-api.yaml + java + + ${project.artifactId}.store.api + ${project.artifactId}.store.model + + + + + com.google.code.maven-replacer-plugin replacer 1.5.2 - + process-resources - replace-for-swagger-genenerated-code-publisher + replace-for-openapi-genenerated-code-publisher replace - ${project.basedir}/target/generated-sources/swagger/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java + ${project.basedir}/target/generated-sources/openapi/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java CURRENT_TENANT @@ -115,28 +113,33 @@ org.wso2.carbon.apimgt.integration.generated.client.store.api.*, org.wso2.carbon.apimgt.integration.generated.client.store.model.* - - feign;version="${io.github.openfeign.version.range}", - feign.jackson;version="${io.github.openfeign.version.range}", - feign.codec;version="${io.github.openfeign.version.range}", - feign.auth;version="${io.github.openfeign.version.range}", - feign.gson;version="${io.github.openfeign.version.range}", - feign.slf4j;version="${io.github.openfeign.version.range}", - com.google.gson, - com.fasterxml.jackson.core;resolution:=optional, - com.fasterxml.jackson.annotation, - com.fasterxml.jackson.databind;resolution:=optional, - io.swagger.annotations, - javax.net.ssl, - com.fasterxml.jackson.datatype.joda;resolution:=optional, - org.apache.oltu.oauth2.client.*;resolution:=optional, - org.apache.oltu.oauth2.common.*;resolution:=optional, - org.junit;resolution:=optional, - - - jsr311-api, - feign-jaxrs - + + com.google.gson;version="[2.8,3)", + com.google.gson.annotations;version="[2.8,3)", + com.google.gson.internal.bind.util, + com.google.gson.reflect;version="[2.8,3)", + com.google.gson.stream;version="[2.8,3)", + io.gsonfire;version="[1.8,2)", + io.swagger.annotations;version="[1.5,2)", + javax.annotation;version="[3.0,4)", + javax.net.ssl, + okhttp3, + okhttp3.internal.http, + okhttp3.internal.tls, + okhttp3.logging, + okio, + org.apache.oltu.oauth2.client;version="[1.0,2)", + org.apache.oltu.oauth2.client.request;version="[1.0,2)", + org.apache.oltu.oauth2.client.response;version="[1.0,2)", + org.apache.oltu.oauth2.common.exception;version="[1.0,2)", + org.apache.oltu.oauth2.common.message.types;version="[1.0,2)", + org.threeten.bp;version="[1.5,2)", + org.threeten.bp.format;version="[1.5,2)", + org.threeten.bp.temporal;version="[1.5,2)", + org.wso2.carbon.apimgt.integration.generated.client.publisher.model, + org.wso2.carbon.apimgt.integration.generated.client.store.model + + @@ -145,60 +148,105 @@ + + + io.swagger.core.v3 + swagger-annotations + 2.1.7 + + + com.google.code.gson gson + 2.8.5 - - javax.ws.rs - jsr311-api - + + + + io.swagger swagger-annotations - - junit - junit - - - io.github.openfeign - feign-core - - - io.github.openfeign - feign-jackson - - - io.github.openfeign - feign-jaxrs - - - io.github.openfeign - feign-gson - - - org.testng - testng - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - - - io.github.openfeign - feign-slf4j - - - org.wso2.orbit.com.fasterxml.jackson.core - jackson-databind - ${jackson-databind.version} - - - com.fasterxml.jackson.datatype - jackson-datatype-joda - + + com.squareup.okhttp3 + okhttp + 4.9.1 + + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + 1.0.1 + + + + com.squareup.okhttp3 + logging-interceptor + 4.9.1 + + + + org.threeten + threetenbp + 1.5.0 + + + + io.gsonfire + gson-fire + 1.8.5 + + + io.swagger.parser.v3 + swagger-parser + 2.0.25 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + true diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml index b2068857a7..76fdb6f92d 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml @@ -1,115 +1,122 @@ - -swagger: '2.0' -###################################################### -# Prolog -###################################################### +# Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +################################################################################ +openapi: 3.0.1 info: - version: "0.12.0" - title: "WSO2 API Manager - Publisher API" + title: WSO2 API Manager - Publisher API description: | - This specifies a **RESTful API** for WSO2 **API Manager** - Publisher. - - Please see [full swagger definition](https://raw.githubusercontent.com/wso2/carbon-apimgt/v6.1.66/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher/src/main/resources/publisher-api.yaml) of the API which is written using [swagger 2.0](http://swagger.io/) specification. + This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. + + # Authentication + Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking + the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps + that you will need to follow to obtain an access token. + First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types + in the payload. A Sample payload is shown below. + ``` + { + "callbackUrl":"www.google.lk", + "clientName":"rest_api_publisher", + "owner":"admin", + "grantType":"client_credentials password refresh_token", + "saasApp":true + } + ``` + Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the + base64 encoded admin username and password. + **Format of the request** + ``` + curl -X POST -H "Authorization: Basic Base64(admin_username:admin_password)" -H "Content-Type: application/json" + \ -d @payload.json https://:/client-registration/v0.17/register + ``` + **Sample request** + ``` + curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" + \ -d @payload.json https://localhost:9443/client-registration/v0.17/register + ``` + Following is a sample response after invoking the above curl. + ``` + { + "clientId": "fOCi4vNJ59PpHucC2CAYfYuADdMa", + "clientName": "rest_api_publisher", + "callBackURL": "www.google.lk", + "clientSecret": "a4FwHlq0iCIKVs2MPIIDnepZnYMa", + "isSaasApplication": true, + "appOwner": "admin", + "jsonString": "{\"grant_types\":\"client_credentials password refresh_token\",\"redirect_uris\":\"www.google.lk\",\"client_name\":\"rest_api123\"}", + "jsonAppAttribute": "{}", + "tokenType": null + } + ``` + Next you must use the above client id and secret to obtain the access token. + We will be using the password grant type for this, you can use any grant type you desire. + You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section + of this document and scope for each resource is given in **authorization** section of resource documentation. + Following is the format of the request if you are using the password grant type. + ``` + curl -k -d "grant_type=password&username=&password=" + \ -H "Authorization: Basic base64(cliet_id:client_secret)" + \ https://:/token + ``` + **Sample request** + ``` + curl https://localhost:8243/token -k \ + -H "Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h" \ + -d "grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create" + ``` + Shown below is a sample response to the above request. + ``` + { + "access_token": "e79bda48-3406-3178-acce-f6e4dbdcbb12", + "refresh_token": "a757795d-e69f-38b8-bd85-9aded677a97c", + "scope": "apim:api_create apim:api_view", + "token_type": "Bearer", + "expires_in": 3600 + } + ``` + Now you have a valid access token, which you can use to invoke an API. + Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. + If you use a different authentication mechanism, this process may change. + + # Try out in Postman + If you want to try-out the embedded postman collection with "Run in Postman" option, please follow the guidelines listed below. + * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. + * Make sure you have an API Manager instance up and running. + * Update the `basepath` parameter to match the hostname and port of the APIM instance. + + [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) contact: - name: "WSO2" - url: "http://wso2.com/products/api-manager/" - email: "architecture@wso2.com" + name: WSO2 + url: http://wso2.com/products/api-manager/ + email: architecture@wso2.com license: - name: "Apache 2.0" - url: "http://www.apache.org/licenses/LICENSE-2.0.html" - -###################################################### -# The fixed parts of the URLs of the API -###################################################### - -# The schemes supported by the API -schemes: - - https - -# The domain of the API. -# This is configured by the customer during deployment. -# The given host is just an example. -host: apis.wso2.com - -# The base path of the API. -# Will be prefixed to all paths. -basePath: /api/am/publisher/v0.12 - -# The following media types can be passed as input in message bodies of the API. -# The actual media type must be specified in the Content-Type header field of the request. -# The default is json, i.e. the Content-Type header is not needed to -# be set, but supporting it serves extensibility. -consumes: - - application/json - -# The following media types may be passed as output in message bodies of the API. -# The media type(s) consumable by the requestor is specified in the Accept header field -# of the corresponding request. -# The actual media type returned will be specfied in the Content-Type header field -# of the of the response. -# The default of the Accept header is json, i.e. there is not needed to -# set the value, but supporting it serves extensibility. -produces: - - application/json - - -x-wso2-security: - apim: - x-wso2-scopes: - - description: "" - roles: admin - name: apim:api_view - key: apim:api_view - - description: "" - roles: admin - name: apim:api_create - key: apim:api_create - - description: "" - roles: admin - name: apim:api_publish - key: apim:api_publish - - description: "" - roles: admin - name: apim:tier_view - key: apim:tier_view - - description: "" - roles: admin - name: apim:tier_manage - key: apim:tier_manage - - description: "" - roles: admin - name: apim:subscription_view - key: apim:subscription_view - - description: "" - roles: admin - name: apim:subscription_block - key: apim:subscription_block - - description: "" - roles: admin - name: apim:mediation_policy_view - key: apim:mediation_policy_view - - description: "" - roles: admin - name: apim:api_workflow - key: apim:api_workflow - - -###################################################### -# The "API Collection" resource APIs -###################################################### + name: Apache 2.0 + url: http://www.apache.org/licenses/LICENSE-2.0.html + version: v2 +servers: + - url: https://apis.wso2.com/api/am/publisher/v2 +security: + - OAuth2Security: + - apim:api_view paths: + ###################################################### + # The "API Collection" resource APIs + ###################################################### /apis: - -#----------------------------------------------------- -# Retrieving the list of all APIs qualifying under a given search condition -#----------------------------------------------------- get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/apis - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"provider\": \"admin\",\n \"version\": \"1.0.0\",\n \"description\": \"This sample API provides Account Status Validation\",\n \"name\": \"AccountVal\",\n \"context\": \"/account\",\n \"id\": \"2e81f147-c8a8-4f68-b4f0-69e0e7510b01\",\n \"status\": \"PUBLISHED\"\n },\n {\n \"provider\": \"admin\",\n \"version\": \"1.0.0\",\n \"description\": null,\n \"name\": \"api1\",\n \"context\": \"/api1\",\n \"id\": \"3e22d2fb-277a-4e9e-8c7e-1c0f7f73960e\",\n \"status\": \"PUBLISHED\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}" + tags: + - APIs summary: | Retrieve/Search APIs description: | @@ -117,9 +124,10 @@ paths: Each retrieved API is represented with a minimal amount of attributes. If you want to get complete details of an API, you need to use **Get details of an API** operation. parameters: - - $ref : '#/parameters/limit' - - $ref : '#/parameters/offset' - - name : query + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/requestedTenant' + - name: query in: query description: | **Search condition**. @@ -127,3565 +135,11542 @@ paths: You can search in attributes by using an **":"** modifier. Eg. - "provider:wso2" will match an API if the provider of the API is exactly "wso2". - - Additionally you can use wildcards. + "provider:wso2" will match an API if the provider of the API contains "wso2". + "provider:"wso2"" will match an API if the provider of the API is exactly "wso2". + "status:PUBLISHED" will match an API if the API is in PUBLISHED state. + "label:external" will match an API if it contains a Microgateway label called "external". + Also you can use combined modifiers Eg. - "provider:wso2*" will match an API if the provider of the API starts with "wso2". + name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. - Supported attribute modifiers are [**version, context, status, - description, subcontext, doc, provider**] + Supported attribute modifiers are [**version, context, name, status, + description, subcontext, doc, provider, label**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. - type: string - - $ref : "#/parameters/Accept" - - $ref : "#/parameters/If-None-Match" - tags: - - API (Collection) + Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) + schema: + type: string + - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/components/parameters/expand' + - $ref: '#/components/parameters/Accept' responses: 200: description: | OK. List of qualifying APIs is returned. - schema: - $ref: '#/definitions/APIList' headers: - Content-Type: - description: The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Content-Type: + description: The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIList' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis"' + x-examples: + $ref: docs/examples/apis/apis_get.yaml + operationId: getAllAPIs -#----------------------------------------------------- -# Create a new API -API (Individual) -#----------------------------------------------------- post: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis" - x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"PUBLISHED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": false,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\": \"in\"},{\"name\":\"log_out_message\",\"type\": \"out\"}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" - x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"integer\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\":\"in\",\"id\":\"142ece76-b208-4aab-b29a-f382045ed066\",\"shared\":false},{\"name\":\"log_out_message\",\"type\":\"out\",\"id\":\"b3527be8-95e6-41e0-8097-3276987b7d4b\",\"shared\":false}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" - summary: Create a new API + tags: + - APIs + summary: Create a New API description: | This operation can be used to create a new API specifying the details of the API in the payload. The new API will be in `CREATED` state. There is a special capability for a user who has `APIM Admin` permission such that he can create APIs on behalf of other users. For that he can to specify `"provider" : "some_other_user"` in the payload so that the API's creator will be shown as `some_other_user` in the UI. parameters: - - in: body - name: body - description: | - API object that needs to be added - required: true + - name: openAPIVersion + in: query + description: Open api version schema: - $ref: '#/definitions/API' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/Authorization' - tags: - - API (Individual) + type: string + default: v3 + enum: + - v2 + - v3 + requestBody: + description: API object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/API' + required: true responses: 201: description: | Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity. - schema: - $ref: '#/definitions/API' headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string Location: description: | The URL of the newly created resource. - type: string + schema: + type: string Content-Type: description: | The content type of the body. - type: string - Authorization: - description: | - The brearer token. - type: string - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' 400: - description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/BadRequest' 415: - description: | - Unsupported Media Type. - The entity of the request was in a not supported format. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Individual API" resource APIs -###################################################### + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis"' + x-examples: + $ref: docs/examples/apis/apis_post.yaml + operationId: createAPI + + ###################################################### + # The "Individual API" resource APIs + ###################################################### /apis/{apiId}: - -#----------------------------------------------------- -# Retrieve the details of an API definition -#----------------------------------------------------- get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" - summary: Get details of an API + tags: + - APIs + summary: Get Details of an API description: | Using this operation, you can retrieve complete details of a single API. You need to provide the Id of the API to retrive it. parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - API (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/requestedTenant' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. Requested API is returned headers: - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string - schema: - $ref: '#/definitions/API' + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + - apim:api_import_export + - apim:api_product_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"' + x-examples: + $ref: docs/examples/apis/apis_id_get.yaml + operationId: getAPI -#----------------------------------------------------- -# Update the definition of an API -#----------------------------------------------------- put: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X PUT -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f" - x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"integer\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\",\"chicken\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\": \"in\"},{\"name\":\"log_out_message\",\"type\": \"out\"}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\"https\"],\r\n \"tags\": [\r\n \"chicken\",\r\n \"pizza\"\r\n ],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\":\"in\",\"id\":\"142ece76-b208-4aab-b29a-f382045ed066\",\"shared\":false},{\"name\":\"log_out_message\",\"type\":\"out\",\"id\":\"b3527be8-95e6-41e0-8097-3276987b7d4b\",\"shared\":false}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + tags: + - APIs summary: Update an API description: | This operation can be used to update an existing API. But the properties `name`, `version`, `context`, `provider`, `state` will not be changed by this operation. parameters: - - $ref: '#/parameters/apiId' - - in: body - name: body - description: | - API object that needs to be added - required: true - schema: - $ref: '#/definitions/API' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - API (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' + requestBody: + description: API object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/API' + required: true responses: 200: description: | OK. Successful response with updated API object - schema: - $ref: '#/definitions/API' headers: - Location: - description: | - The URL of the newly created resource. - type: string - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' 400: - description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/BadRequest' 403: - description: | - Forbidden. - The request must be conditional but no condition has been specified. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/Forbidden' 404: - description: | - Not Found. - The resource to be updated does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"' + operationId: updateAPI -#----------------------------------------------------- -# Delete the definition of an API -#----------------------------------------------------- delete: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/6fb74674-4ab8-4b52-9886-f9a376985060" - x-wso2-request: | - DELETE https://localhost:9443/api/am/publisher/v0.12/apis/6fb74674-4ab8-4b52-9886-f9a376985060 - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK" + tags: + - APIs summary: Delete an API description: | This operation can be used to delete an existing API proving the Id of the API. parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - API (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' responses: 200: description: | OK. Resource successfully deleted. + content: {} 403: - description: | - Forbidden. - The request must be conditional but no condition has been specified. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/Forbidden' 404: - description: | - Not Found. - Resource to be deleted does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_delete + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"' + operationId: deleteAPI + + /apis/{apiId}/topics: + put: + tags: + - APIs + summary: Update Topics + description: This operation can be used to update topics of an existing API. + operationId: updateTopics + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' + requestBody: + description: API object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/TopicList' + required: true + responses: + 200: description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' + OK. + Successful response with updated API object + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' -################################################################ -# The swagger resource of "Individual API" resource APIs -################################################################ + /apis/{apiId}/reimport-service: + put: + tags: + - APIs + summary: Update the Service that is used to create the API + description: This operation can be used to re-import the Service used to create the API + operationId: reimportServiceFromCatalog + parameters: + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + Successful response with updated API object + headers: + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' /apis/{apiId}/swagger: -#----------------------------------------------------- -# Retrieve the API swagger definition -#----------------------------------------------------- - get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 329\n\n{\n \"paths\": {\"/*\": {\"get\": {\n \"x-auth-type\": \"Application\",\n \"x-throttling-tier\": \"Unlimited\",\n \"responses\": {\"200\": {\"description\": \"OK\"}}\n }}},\n \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n \"swagger\": \"2.0\",\n \"info\": {\n \"title\": \"PhoneVerification\",\n \"description\": \"Verify a phone number\",\n \"contact\": {\n \"email\": \"xx@ee.com\",\n \"name\": \"xx\"\n },\n \"version\": \"1.0.0\"\n }\n}" - summary: Get swagger definition + get: + tags: + - APIs + summary: Get Swagger Definition description: | This operation can be used to retrieve the swagger definition of an API. parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - API (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. Requested swagger document of the API is returned headers: - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + type: string + example: "" 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/swagger"' + operationId: getAPISwagger -#----------------------------------------------------- -# Update the API swagger definition -#----------------------------------------------------- put: - consumes: - - multipart/form-data - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -F apiDefinition=\"{\\\"paths\\\":{\\\"\\/*\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"OK\\\"}}}}},\\\"x-wso2-security\\\":{\\\"apim\\\":{\\\"x-wso2-scopes\\\":[]}},\\\"swagger\\\":\\\"2.0\\\",\\\"info\\\":{\\\"title\\\":\\\"PhoneVerification\\\",\\\"description\\\":\\\"Verify a phone number\\\",\\\"contact\\\":{\\\"email\\\":\\\"xx@ee.com\\\",\\\"name\\\":\\\"xx\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\" -X PUT \"https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger\"" - x-wso2-request: | - PUT https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger - Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013 - Content-Length: 477 - Content-Type: multipart/form-data; boundary=------------------------4f51e636c0003d99 - - --------------------------4f51e636c0003d99 - Content-Disposition: form-data; name="apiDefinition" - - {"paths":{"\/*":{"get":{"x-auth-type":"Application","x-throttling-tier":"Unlimited","responses":{"200":{"description":"OK"}}}}},"x-wso2-security":{"apim":{"x-wso2-scopes":[]}},"swagger":"2.0","info":{"title":"PhoneVerification","description":"Verify a phone number","contact":{"email":"xx@ee.com","name":"xx"},"version":"1.0.0"}} - --------------------------4f51e636c0003d99-- - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"paths\": {\"/*\": {\"get\": {\n \"x-auth-type\": \"Application\",\n \"x-throttling-tier\": \"Unlimited\",\n \"responses\": {\"200\": {\"description\": \"OK\"}}\n }}},\n \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n \"swagger\": \"2.0\",\n \"info\": {\n \"title\": \"PhoneVerification\",\n \"description\": \"Verify a phone number\",\n \"contact\": {\n \"email\": \"xx@ee.com\",\n \"name\": \"xx\"\n },\n \"version\": \"1.0.0\"\n }\n}" - summary: Update swagger definition + tags: + - APIs + summary: Update Swagger Definition description: | This operation can be used to update the swagger definition of an existing API. Swagger definition to be updated is passed as a form data parameter `apiDefinition`. parameters: - - $ref: '#/parameters/apiId' - - in: formData - name: apiDefinition - description: Swagger definition of the API - type: string - required: true - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - API (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + properties: + apiDefinition: + type: string + description: Swagger definition of the API + url: + type: string + description: Swagger definition URL of the API + file: + type: string + description: Swagger definitio as a file + format: binary responses: 200: description: | OK. Successful response with updated Swagger definition headers: - Location: - description: | - The URL of the newly created resource. - type: string - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + type: string + example: "" 400: - description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/BadRequest' 403: - description: | - Forbidden. - The request must be conditional but no condition has been specified. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/Forbidden' 404: - description: | - Not Found. - The resource to be updated does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -################################################################ -# The thumbnail resource of "Individual API" resource APIs -################################################################ - - /apis/{apiId}/thumbnail: -#------------------------------------------------------------------------------------------------- -# Downloads a thumbnail image of an API -#------------------------------------------------------------------------------------------------- - get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail > image.jpg" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail - Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9 - x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: image/jpeg\r\n\r\n[image content]" - summary: Get thumbnail image + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F apiDefinition=@swagger.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/swagger"' + operationId: updateAPISwagger + + /apis/{apiId}/generate-mock-scripts: + post: + tags: + - APIs + summary: Generate Mock Response Payloads description: | - This operation can be used to download a thumbnail image of an API. + This operation can be used to generate mock responses from examples of swagger definition of an API. + operationId: generateMockScripts parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - API (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - Thumbnail image returned + Requested swagger document of the API is returned with example responses headers: - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + type: string + example: "" 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} 404: - description: | - Not Found. - Requested Document does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -#---------------------------------------------------------------------------- -# Upload a thumbnail image to a certain API -#---------------------------------------------------------------------------- - post: - consumes: - - multipart/form-data - x-scope: apim:api_create - x-wso2-curl: "curl -X POST -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail -F file=@image.jpg" - x-wso2-request: | - POST https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail - Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9 - Content-Type: multipart/form-data; boundary=------------------------5e542e0e5b50e1e4 - Content-Length: 18333 - - --------------------------5e542e0e5b50e1e4 - Content-Disposition: form-data; name="file"; filename="image.jpg" - Content-Type: image/jpeg - - [image content] - - --------------------------5e542e0e5b50e1e4-- - x-wso2-response: "HTTP/1.1 201 Created\r\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\r\nContent-Type: application/json\r\n\r\n{\r\n \"relativePath\": \"/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\",\r\n \"mediaType\": \"image/jpeg\"\r\n}" - summary: Upload a thumbnail image + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/generate-mock-scripts"' + + /apis/{apiId}/generated-mock-scripts: + get: + tags: + - APIs + summary: Get Generated Mock Response Payloads description: | - This operation can be used to upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`. + This operation can be used to get generated mock responses from examples of swagger definition of an API. + operationId: getGeneratedMockScriptsOfAPI parameters: - - $ref: '#/parameters/apiId' - - in: formData - name: file - description: Image to upload - type: file - required: true - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - API (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - Image updated - schema: - $ref : '#/definitions/FileInfo' + Requested swagger document of the API is returned with example responses headers: - Location: + ETag: description: | - The URL of the uploaded thumbnail image of the API. - type: string - Content-Type: - description: | - The content type of the body. - type: string - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string - 400: + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/MockResponsePayloadList' + 304: description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} 404: - description: | - Not Found. - The resource to be updated does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Copy API" Processing Function resource API -###################################################### - /apis/copy-api: - -#----------------------------------------------------- -# Create a new API based on an already existing one -#----------------------------------------------------- - post: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0\"" - x-wso2-request: | - POST https://localhost:9443/api/am/publisher/v0.12/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0 - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/25a84fc9-38c0-4578-95e8-29fb6b1c4771\nContent-Type: application/json\n\n{\r\n \"id\": \"25a84fc9-38c0-4578-95e8-29fb6b1c4771\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"2.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"\\\\/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/Order\\\"},\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"description\\\":\\\"Created.\\\"}}}},\\\"\\\\/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"headers\\\":{},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application\\\\/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application\\\\/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http:\\\\/\\\\/www.apache.org\\\\/licenses\\\\/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http:\\\\/\\\\/www.pizzashack.com\\\"},\\\"version\\\":\\\"2.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\"https\"],\r\n \"tags\": [\r\n \"chicken\",\r\n \"pizza\"\r\n ],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" - summary: Create a new API version + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/generated-mock-scripts"' + + /apis/{apiId}/resource-policies: + get: + tags: + - API Resource Policies + summary: Get the Resource Policy(inflow/outflow) Definitions description: | - This operation can be used to create a new version of an existing API. The new version is specified as `newVersion` query parameter. New API will be in `CREATED` state. + This operation can be used to retrieve conversion policy resource definitions of an API. parameters: - - name: newVersion - description: Version of the new API. - type: string + - $ref: '#/components/parameters/apiId' + - name: resourcePath in: query - required: true - - $ref: '#/parameters/apiId-Q' - tags: - - API (Individual) - responses: - 201: - description: | - Created. - Successful response with the newly created API as entity in the body. Location header contains URL of newly created API. - headers: - Location: - description: | - The URL of the newly created API. - type: string - 400: - description: | - Bad Request. - Invalid request or validation error + description: Resource path of the resource policy definition schema: - $ref: '#/definitions/Error' - 404: - description: | - Not Found. - API to copy does not exist. - 401: - description: | - Unauthenticated request. + type: string + - name: verb + in: query + description: HTTP verb of the resource path of the resource policy definition schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Change Lifecycle" Processing Function resource API -###################################################### - /apis/change-lifecycle: - -#----------------------------------------------------- -# Change the lifecycle of an API -#----------------------------------------------------- - post: - x-scope: apim:api_publish - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish\"" - x-wso2-request: | - POST https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK" - summary: Change API Status - description: | - This operation is used to change the lifecycle of an API. Eg: Publish an API which is in `CREATED` state. In order to change the lifecycle, we need to provide the lifecycle `action` as a query parameter. - - For example, to Publish an API, `action` should be `Publish`. Note that the `Re-publish` action is available only after calling `Block`. - - Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information. - parameters: - - name: action - description: | - The action to demote or promote the state of the API. - - Supported actions are [ **Publish, Deploy as a Prototype, Demote to Created, Demote to Prototyped, Block, Deprecate, Re-Publish, Retire **] - + type: string + - name: sequenceType in: query - type: string + description: sequence type of the resource policy resource definition required: true - enum: - - Publish - - Deploy as a Prototype - - Demote to Created - - Demote to Prototyped - - Block - - Deprecate - - Re-Publish - - Retire - - name: lifecycleChecklist - description: | - - Supported checklist items are as follows. - 1. **Deprecate Old Versions**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. - 2. **Require Re-Subscription**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. - - You can specify additional checklist items by using an **"attribute:"** modifier. - - Eg: "Deprecate Old Versions:true" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in "attribute1:true, attribute2:false" format. - - **Sample CURL :** curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate Old Versions:true,Require Re-Subscription:true" - - type: string - in: query - - $ref: '#/parameters/apiId-Q' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - API (Individual) + schema: + type: string + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - Lifecycle changed successfully. + List of resource policy definitions of the API is returned headers: ETag: description: | - Entity Tag of the changed API. Used by caches, or in conditional requests (Will be supported in future). - type: string + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string Last-Modified: description: | - Date and time the API lifecycle has been modified the last time. + Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string - 400: + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ResourcePolicyList' + 304: description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Document Collection" resource APIs -###################################################### - /apis/{apiId}/documents: - -#----------------------------------------------------- -# Retrieve the documents associated with an API that qualify under a search condition -#----------------------------------------------------- + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies?resourcePath=checkPhoneNumber&verb=post&sequenceType=in"' + operationId: getAPIResourcePolicies + + /apis/{apiId}/resource-policies/{resourcePolicyId}: get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents\"" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n },\n {\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"URL\",\n \"sourceUrl\": \"http://wiki.cdyne.com/index.php/Phone_Verification\",\n \"otherTypeName\": null,\n \"documentId\": \"4145df31-04f1-440c-8d08-68952874622c\",\n \"summary\": \"This is the URL for online documentation\",\n \"name\": \"Online Documentation\",\n \"type\": \"SAMPLES\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}" - summary: Get a list of documents of an API + tags: + - API Resource Policies + summary: Get the Resource Policy(inflow/outflow) Definition for a Given Resource + Identifier. description: | - This operation can be used to retrive a list of documents belonging to an API by providing the id of the API. + This operation can be used to retrieve conversion policy resource definitions of an API given the resource identifier. parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Document (Collection) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/resourcePolicyId' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - Document list is returned. - schema: - $ref: '#/definitions/DocumentList' + Requested resource policy definition of the API is returned for the given resource identifier. headers: - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ResourcePolicyInfo' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 400: + $ref: '#/components/responses/BadRequest' 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies/8efc32a4-c7f1-4bee-b860-b7566e2bc0d5"' + operationId: getAPIResourcePoliciesByPolicyId -#----------------------------------------------------- -# Add a document to a certain API -#----------------------------------------------------- - post: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\"" - x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"summary\": \"This is a sample documentation\",\n \"name\": \"Introduction to PhoneVerification API\",\n \"type\": \"HOWTO\"\n}" - x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\",\n \"summary\": \"This is a sample documentation\",\n \"name\": \"Introduction to PhoneVerification API\",\n \"type\": \"HOWTO\"\n}" - summary: Add a new document to an API + put: + tags: + - API Resource Policies + summary: Update the Resource Policy(inflow/outflow) Definition for the Given + Resource Identifier description: | - This operation can be used to add a new documentation to an API. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API document ** API once we obtain a document Id by this operation. + This operation can be used to update the resource policy(inflow/outflow) definition for the given resource identifier of an existing API. resource policy definition to be updated is passed as a body parameter `content`. parameters: - - $ref: '#/parameters/apiId' - - in: body - name: body - description: | - Document object that needs to be added - required: true - schema: - $ref: '#/definitions/Document' - - $ref: '#/parameters/Content-Type' - tags: - - Document (Collection) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/resourcePolicyId' + - $ref: '#/components/parameters/If-Match' + requestBody: + description: Content of the resource policy definition that needs to be updated + content: + application/json: + schema: + $ref: '#/components/schemas/ResourcePolicyInfo' + required: true responses: - 201: + 200: description: | - Created. - Successful response with the newly created Document object as entity in the body. - Location header contains URL of newly added document. - schema: - $ref: '#/definitions/Document' + OK. + Successful response with updated the resource policy definition headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string Location: description: | - Location to the newly created Document. - type: string + The URL of the newly created resource. + schema: + type: string Content-Type: description: | The content type of the body. - type: string - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ResourcePolicyInfo' 400: - description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' - 415: - description: | - Unsupported media type. - The entity of the request was in a not supported format. - -###################################################### -# The "Individual Document" resource APIs -###################################################### - '/apis/{apiId}/documents/{documentId}': + $ref: '#/components/responses/BadRequest' + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies/8efc32a4-c7f1-4bee-b860-b7566e2bc0d5"' + operationId: updateAPIResourcePoliciesByPolicyId -#----------------------------------------------------- -# Retrieve a particular document of a certain API -#----------------------------------------------------- + /apis/{apiId}/thumbnail: get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\"" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5 - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" - summary: Get a document of an API + tags: + - APIs + summary: Get Thumbnail Image description: | - This operation can be used to retrieve a particular document's metadata associated with an API. + This operation can be used to download a thumbnail image of an API. parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/documentId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Document (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - Document returned. - schema: - $ref: '#/definitions/Document' + Thumbnail image returned headers: - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} 404: - description: | - Not Found. - Requested Document does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/thumbnail"' + operationId: getAPIThumbnail -#----------------------------------------------------- -# Update a particular document of a certain API -#----------------------------------------------------- put: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" -H \"Content-Type: application/json\" -X PUT -d data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\"" - x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\nAuthorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" - summary: Update a document of an API + tags: + - APIs + summary: Upload a Thumbnail Image description: | - This operation can be used to update metadata of an API's document. + This operation can be used to upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`. + operationId: updateAPIThumbnail parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/documentId' - - in: body - name: body - description: | - Document object that needs to be added - required: true - schema: - $ref: '#/definitions/Document' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Document (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + required: + - file + properties: + file: + type: string + description: Image to upload + format: binary + required: true responses: 200: description: | OK. - Document updated - schema: - $ref: '#/definitions/Document' + Image updated headers: - Location: - description: | - The URL of the updated document. - type: string - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Location: + description: | + The URL of the uploaded thumbnail image of the API. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/FileInfo' 400: - description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/BadRequest' 404: - description: | - Not Found. - The resource to be updated does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# Delete a particular document of a certain API -#----------------------------------------------------- - delete: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058" - x-wso2-request: | - DELETE https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058 - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK" - summary: Delete a document of an API + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=image.jpeg "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/thumbnail"' + + /apis/{apiId}/subscription-policies: + get: + tags: + - APIs + summary: | + Get Details of the Subscription Throttling Policies of an API description: | - This operation can be used to delete a document associated with an API. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/documentId' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Document (Individual) - responses: - 200: - description: | - OK. - Resource successfully deleted. - 404: - description: | - Not Found. - Resource to be deleted does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -################################################################ -# The content resource of "Individual Document" resource APIs -################################################################ - - '/apis/{apiId}/documents/{documentId}/content': - - #------------------------------------------------------------------------------------------------- - # Downloads a FILE type document/get the inline content or source url of a certain document - #------------------------------------------------------------------------------------------------- - get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\" > sample.pdf" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content - Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a - x-wso2-response: "HTTP/1.1 200 OK\nContent-Disposition: attachment; filename=\"sample.pdf\"\nContent-Type: application/octet-stream\nContent-Length: 7802\n\n%PDF-1.4\n%äüöß\n2 0 obj\n<>\nstream\n..\n>>\nstartxref\n7279\n%%EOF" - summary: Get the content of an API document - description: | - This operation can be used to retrive the content of an API's document. - - The document can be of 3 types. In each cases responses are different. - - 1. **Inline type**: - The content of the document will be retrieved in `text/plain` content type - - _Sample cURL_ : `curl -k -H "Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51" -F inlineContent=@"docs.txt" -X POST "https://localhost:9443/api/am/publisher/v0.12/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` - 2. **FILE type**: - The file will be downloaded with the related content type (eg. `application/pdf`) - 3. **URL type**: - The client will recieve the URL of the document as the Location header with the response with - `303 See Other` - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/documentId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Document (Individual) - responses: - 200: - description: | - OK. - File or inline content returned. - headers: - Content-Type: - description: | - The content type of the body. - type: string - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 303: - description: | - See Other. - Source can be retrived from the URL specified at the Location header. - headers: - Location: - description: | - The Source URL of the document. - type: string - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - 404: - description: | - Not Found. - Requested Document does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - - #---------------------------------------------------------------------------- - # Upload a file or add inline content to a document of a certain API - #---------------------------------------------------------------------------- - post: - consumes: - - multipart/form-data - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -F file=@\"sample.pdf\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\"" - x-wso2-request: | - POST https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content - Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - Content-Length: 8004 - Content-Type: multipart/form-data; boundary=------------------------7b9a53f1ffa452b9 - - --------------------------7b9a53f1ffa452b9 - Content-Disposition: form-data; name="file"; filename="sample.pdf" - Content-Type: application/octet-stream - - [file content] - - --------------------------7b9a53f1ffa452b9-- - x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content\nContent-Type: application/json\n\n{\n \"visibility\":\"API_LEVEL\",\n \"sourceType\":\"FILE\",\n \"sourceUrl\":null,\n \"otherTypeName\":null,\n \"documentId\":\"daf732d3-bda2-46da-b381-2c39d901ea61\",\n \"summary\":\"This is a sample documentation pdf\",\n \"name\":\"Introduction to PhoneVerification API PDF\",\n \"type\":\"HOWTO\"\n}" - summary: Upload the content of an API document - description: | - Thid operation can be used to upload a file or add inline content to an API document. - - **IMPORTANT:** - * Either **file** or **inlineContent** form data parameters should be specified at one time. - * Document's source type should be **FILE** in order to upload a file to the document using **file** parameter. - * Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/documentId' - - in: formData - name: file - description: Document to upload - type: file - required: false - - in: formData - name: inlineContent - description: Inline content of the document - type: string - required: false - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Document (Individual) - responses: - 200: - description: | - OK. - Document updated - schema: - $ref: '#/definitions/Document' - headers: - Location: - description: | - The URL of the updated content of the document. - type: string - Content-Type: - description: | - The content type of the body. - type: string - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 400: - description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' - 404: - description: | - Not Found. - The resource to be updated does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - - ##pp -###################################################### -# The "specific mediation policy" resource APIs -###################################################### - '/apis/{apiId}/policies/mediation': - - #----------------------------------------------------------------------------------------- - # Retrieving the list of all API specific mediation sequences under a given search condition - #----------------------------------------------------------------------------------------- - get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc\" https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation" - x-wso2-request: "GET https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\r\nAuthorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc" - x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"count\": 1,\r\n \"next\": null,\r\n \"previous\": null,\r\n \"list\": [ {\r\n \"name\": \"add_custom_header_fault\",\r\n \"id\": \"6460d7e6-4272-4e3a-9879-437228d83123\",\r\n \"type\": \"fault\"\r\n }]\r\n}" - summary: | - Get all mediation policies of an API - description: | - This operation provides you a list of available mediation policies of an API. - parameters: - - $ref: '#/parameters/apiId' - - $ref : '#/parameters/limit' - - $ref : '#/parameters/offset' - - name : query - in: query - description: "-Not supported yet-" - type: string - - $ref : "#/parameters/Accept" - - $ref : "#/parameters/If-None-Match" - tags: - - Mediation Policy (Collection) - responses: - 200: - description: | - OK. - List of qualifying APIs is returned. - schema: - $ref: '#/definitions/mediationList' - headers: - Content-Type: - description: The content type of the body. - type: string - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -#---------------------------------------------------------------------------- -# Upload an API specific mediation policy -#---------------------------------------------------------------------------- - post: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer 6cea3696-0151-3282-bf79-a0c4db6f308a\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\"" - x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\r\nContent-Type: application/json\r\nAuthorization: Bearer 6cea3696-0151-3282-bf79-a0c4db6f308a\r\n\r\n{\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" - x-wso2-response: "HTTP/1.1 201 Created\r\nLocation: https://localhost:9443/api/am/publisher/v0.12/registry/resource/_system/governance/apimgt/applicationdata/provider/admin/hello/1.0.0/fault/add_custom_header_fault.xml\r\nContent-Type: application/json\r\n\r\n{ \r\n \"id\":\"624b9f7d-bfaf-484b-94cc-e84491f5d725\",\r\n \"name\":\"add_custom_header_fault\",\r\n \"type\":\"fault\",\r\n \"config\":\"\\n \\n\\n\"\r\n}" - summary: Add an API specific mediation policy - description: | - This operation can be used to add an API specifc mediation policy. - parameters: - - in: body - name: body - description: mediation policy to upload - required: true - schema: - $ref: '#/definitions/Mediation' - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Mediation Policy (Collection) - responses: - 200: - description: | - OK. - mediation policy uploaded - schema: - $ref : '#/definitions/Mediation' - headers: - Location: - description: | - The URL of the uploaded thumbnail image of the API. - type: string - Content-Type: - description: | - The content type of the body. - type: string - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 400: - description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' - 404: - description: | - Not Found. - The resource to be updated does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Individual API specific mediation sequence" resource -###################################################### - /apis/{apiId}/policies/mediation/{mediationPolicyId}: - -#----------------------------------------------------- -# Retrieve a particular API specific mediation squence -#----------------------------------------------------- - get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer 5aa0acc0-0ce3-3a0b-8cc8-db5ef696ee23\" https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/624b9f7d-bfaf-484b-94cc-e84491f5d725" - x-wso2-request: "GET https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/624b9f7d-bfaf-484b-94cc-e84491f5d725\r\nAuthorization: Bearer 5aa0acc0-0ce3-3a0b-8cc8-db5ef696ee23" - x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"id\": \"624b9f7d-bfaf-484b-94cc-e84491f5d725\",\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" - summary: Get an API specific mediation policy - description: | - This operation can be used to retrieve a particular API specific mediation policy. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/mediationPolicyId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Mediation Policy (Individual) - responses: - 200: - description: | - OK. - Mediation policy returned. - schema: - $ref: '#/definitions/Mediation' - headers: - Content-Type: - description: | - The content type of the body. - type: string - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - 404: - description: | - Not Found. - Requested Document does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# Delete the mediation policy -#----------------------------------------------------- - delete: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/60f5146d-1774-405d-86b3-9b040ac266d5" - x-wso2-request: "DELETE https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/60f5146d-1774-405d-86b3-9b040ac266d5\r\nAuthorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc" - x-wso2-response: "HTTP/1.1 200 OK" - summary: Delete an API specific mediation policy - description: | - This operation can be used to delete an existing API specific mediation policy providing the Id of the API and the Id of the mediation policy. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/mediationPolicyId' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Mediation Policy (Individual) - responses: - 200: - description: | - OK. - Resource successfully deleted. - 403: - description: | - Forbidden. - The request must be conditional but no condition has been specified. - schema: - $ref: '#/definitions/Error' - 404: - description: | - Not Found. - Resource to be deleted does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# Update the a mediation policy -#----------------------------------------------------- - put: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer 9e41fae2-3ada-3dd1-8f12-2077202f4285\" -H \"Content-Type: application/json\" -X PUT -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/820fdcf7-7258-42b5-809e-674b893644d1" - x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/820fdcf7-7258-42b5-809e-674b893644d1\r\nContent-Type: application/json\r\nAuthorization: Bearer 9e41fae2-3ada-3dd1-8f12-2077202f4285\r\n\r\n{\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" - x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"id\": \"a7365481-5b3f-463c-a646-a498895ac210\",\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" - summary: Update an API specific mediation policy - description: | - This operation can be used to update an existing mediation policy of an API. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/mediationPolicyId' - - in: body - name: body - description: | - Mediation policy object that needs to be updated - required: true - schema: - $ref: '#/definitions/Mediation' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Mediation Policy (Individual) - responses: - 200: - description: | - OK. - Successful response with updated API object - schema: - $ref: '#/definitions/Mediation' - headers: - Location: - description: | - The URL of the newly created resource. - type: string - Content-Type: - description: | - The content type of the body. - type: string - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 400: - description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' - 403: - description: | - Forbidden. - The request must be conditional but no condition has been specified. - schema: - $ref: '#/definitions/Error' - 404: - description: | - Not Found. - The resource to be updated does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The wsdl Resource -###################################################### - /apis/{apiId}/wsdl: + This operation can be used to retrieve details of the subscription throttling policy of an API by specifying the API Id. -#----------------------------------------------------- -# Retrieve the details about a certain wsdl -#----------------------------------------------------- - get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/7f82f6b0-2667-441e-af23-c0fc44cf3a17/wsdl\"" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/apis/7f82f6b0-2667-441e-af23-c0fc44cf3a17/wsdl - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"name\": \"admin--hello1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n \\n <\\/output>\\n <\\/operation>\\n <\\/portType>\\n \\n \\n \\n \\n \\n \\n <\\/input>\\n \\n \\n <\\/output>\\n <\\/operation>\\n <\\/binding>\\n \\nWSDL File for HelloService<\\/documentation>\\n \\n \\n <\\/port>\\n <\\/service>\\n<\\/definitions>\"\r\n}" - summary: Get the WSDL of an API - description: | - This operation can be used to retrieve the WSDL definition of an API. + `X-WSO2-Tenant` header can be used to retrive API subscription throttling policies that belongs to a different tenant domain. If not specified super tenant will be used. If Authorization header is present in the request, the user's tenant associated with the access token will be used. parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Wsdl (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/requestedTenant' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - Requested WSDL DTO object belongs to the API - schema: - $ref: '#/definitions/Wsdl' + Throttling Policy returned headers: - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + Entity Tag of the response resource. + Used by caches, or in conditional requests. + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - type: string - + Used by caches, or in conditional requests. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ThrottlingPolicy' 304: description: | Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). + Empty body because the client has already the latest version of the requested resource. + content: {} 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/subscription-policies"' + operationId: getAPISubscriptionPolicies + + /apis/copy-api: + post: + tags: + - APIs + summary: Create a New API Version + description: | + This operation can be used to create a new version of an existing API. The new version is specified as `newVersion` query parameter. New API will be in `CREATED` state. + parameters: + - name: newVersion + in: query + description: Version of the new API. + required: true + schema: + maxLength: 30 + type: string + - name: defaultVersion + in: query + description: Specifies whether new API should be added as default version. + schema: + type: boolean + default: false + - name: serviceVersion + in: query + description: Version of the Service that will used in creating new version + schema: + type: string + required: false + - $ref: '#/components/parameters/apiId-Q' + responses: + 201: description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' -#----------------------------------------------------- -# Add a wsdl to the registry -#----------------------------------------------------- + Created. + Successful response with the newly created API as entity in the body. Location header contains URL of newly created API. + headers: + Location: + description: | + The URL of the newly created API. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/copy-api?newVersion=2.0&defaultVersion=false&apiId=2fd14eb8-b828-4013-b448-0739d2e76bf7"' + x-examples: + $ref: docs/examples/apis/apis_copyapi.yaml#/post + operationId: createNewAPIVersion + + /apis/change-lifecycle: post: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/af3f96da-9ccf-463f-8cee-13ec8530a9cd/wsdl\"" - x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/af3f96da-9ccf-463f-8cee-13ec8530a9cd/wsdl\r\nContent-Type: application/json\r\nAuthorization: Bearer 7d237cab-7011-3f81-b384-24d03e750873\r\n\r\n{\r\n \"name\": \"admin--PizzaShackAPI1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n \\n <\\/output>\\n <\\/operation>\\n <\\/portType>\\n \\n \\n \\n \\n \\n \\n <\\/input>\\n \\n \\n <\\/output>\\n <\\/operation>\\n <\\/binding>\\n \\nWSDL File for HelloService<\\/documentation>\\n \\n \\n <\\/port>\\n <\\/service>\\n<\\/definitions>\"\r\n}" - x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"name\": \"admin--PizzaShackAPI1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n \\n <\\/output>\\n <\\/operation>\\n <\\/portType>\\n \\n \\n \\n \\n \\n \\n <\\/input>\\n \\n \\n <\\/output>\\n <\\/operation>\\n <\\/binding>\\n \\nWSDL File for HelloService<\\/documentation>\\n \\n \\n <\\/port>\\n <\\/service>\\n<\\/definitions>\"\r\n}" - summary: Add a WSDL to an API + tags: + - API Lifecycle + summary: Change API Status description: | - This operation can be used to add a WSDL definition to an existing API. + This operation is used to change the lifecycle of an API. Eg: Publish an API which is in `CREATED` state. In order to change the lifecycle, we need to provide the lifecycle `action` as a query parameter. + + For example, to Publish an API, `action` should be `Publish`. Note that the `Re-publish` action is available only after calling `Block`. + + Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information. parameters: - - $ref: '#/parameters/apiId' - - in: body - name: body + - name: action + in: query description: | - JSON payload including WSDL definition that needs to be added + The action to demote or promote the state of the API. + + Supported actions are [ **Publish**, **Deploy as a Prototype**, **Demote to Created**, **Block**, **Deprecate**, **Re-Publish**, **Retire** ] required: true schema: - $ref: '#/definitions/Wsdl' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Wsdl (Individual) + type: string + enum: + - Publish + - Deploy as a Prototype + - Demote to Created + - Block + - Deprecate + - Re-Publish + - Retire + - name: lifecycleChecklist + in: query + description: |2 + + Supported checklist items are as follows. + 1. **Deprecate old versions after publishing the API**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. + 2. **Requires re-subscription when publishing the API**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. + You can specify additional checklist items by using an **"attribute:"** modifier. + Eg: "Deprecate old versions after publishing the API:true" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in "attribute1:true, attribute2:false" format. + **Sample CURL :** curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/v2/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate%20old%20versions%20after%20publishing%20the%20API%3Atrue,Requires%20re-subscription%20when%20publishing%20the%20API%3Afalse" + schema: + type: string + - $ref: '#/components/parameters/apiId-Q' + - $ref: '#/components/parameters/If-Match' responses: 200: description: | OK. - Successful response with updated wsdl definition + Lifecycle changed successfully. headers: - Location: - description: | - The URL of the newly created resource. - type: string - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + Entity Tag of the changed API. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string Last-Modified: description: | - Date and time the resource has been modifed the last time. + Date and time the API lifecycle has been modified the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowResponse' + 202: + description: | + Accepted. + The request has been accepted. + content: + application/json: + schema: + $ref: '#/components/schemas/WorkflowResponse' 400: - description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' - 403: - description: | - Forbidden. - The request must be conditional but no condition has been specified. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/BadRequest' 404: - description: | - Not Found. - The resource to be updated does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - - -###################################################### -# The "Individual Application" resource APIs -###################################################### - '/applications/{applicationId}': - -#----------------------------------------------------- -# Retrieve the details about a certain application -#----------------------------------------------------- + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish"' + operationId: changeAPILifecycle + + /apis/{apiId}/lifecycle-history: get: - x-scope: apim:api_create - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015 - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"groupId\": \"\",\n \"subscriber\": \"admin\",\n \"throttlingTier\": \"Unlimited\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"description\": null,\n \"name\": \"DefaultApplication\"\n}" - summary: Get details of an application + tags: + - API Lifecycle + summary: Get Lifecycle State Change History of the API. description: | - This operation can be used to retrieve details of an individual application specifying the application id in the URI. + This operation can be used to retrieve Lifecycle state change history of the API. parameters: - - $ref: '#/parameters/applicationId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Application (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - Application returned. - schema: - $ref: '#/definitions/Application' + Lifecycle state change history returned successfully. headers: - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/LifecycleHistory' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} 404: - description: | - Not Found. - Requested application does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Subscription Collection" resource APIs -###################################################### - /subscriptions: - -#----------------------------------------------------- -# Retrieve all subscriptions of a certain API -#----------------------------------------------------- + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-history"' + operationId: getAPILifecycleHistory + + /apis/{apiId}/lifecycle-state: get: - x-scope: apim:subscription_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/subscriptions?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b\"" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/subscriptions?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n \n{\n \"previous\": \"\",\n \"list\": [\n {\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n },\n {\n \"subscriptionId\": \"7ac22c34-8745-4cfe-91e0-262c50b2f2e3\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"367a2361-8db5-4140-8133-c6c8dc7fa0c4\",\n \"status\": \"UNBLOCKED\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}" - summary: Get all Subscriptions + tags: + - API Lifecycle + summary: Get Lifecycle State Data of the API. description: | - This operation can be used to retrieve a list of subscriptions of the user associated with the provided access token. This operation is capable of - - 1. Retrieving all subscriptions for the user's APIs. - `GET https://localhost:9443/api/am/publisher/v0.12/subscriptions` - - 2. Retrieving subscriptions for a specific API. - `GET https://localhost:9443/api/am/publisher/v0.12/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed` + This operation can be used to retrieve Lifecycle state data of the API. parameters: - - $ref: '#/parameters/apiId-Q' - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Subscription (Collection) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - Subscription list returned. - schema: - $ref: '#/definitions/SubscriptionList' + Lifecycle state data returned successfully. headers: - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | - Entity Tag of the response resource. + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/LifecycleState' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - 406: - description: | - Not Acceptable. The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Individual Subscription" resource APIs -###################################################### - '/subscriptions/{subscriptionId}': - -#----------------------------------------------------- -# Retrieve a certain subscription -#----------------------------------------------------- - get: - x-scope: apim:subscription_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809 - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n}" - summary: Get details of a subscription + content: {} + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-state"' + operationId: getAPILifecycleState + + /apis/{apiId}/lifecycle-state/pending-tasks: + delete: + tags: + - API Lifecycle + summary: Delete Pending Lifecycle State Change Tasks description: | - This operation can be used to get details of a single subscription. + This operation can be used to remove pending lifecycle state change requests that are in pending state parameters: - - $ref: '#/parameters/subscriptionId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Subscription (Individual) + - $ref: '#/components/parameters/apiId' responses: 200: description: | OK. - Subscription returned - schema: - $ref: '#/definitions/ExtendedSubscription' - headers: - Content-Type: - description: The content type of the body. - type: string - ETag: - description: 'Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).' - type: string - Last-Modified: - description: 'Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future).' - type: string - '304': - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - '404': - description: | - Not Found. - Requested Subscription does not exist. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Block Subscription" Processing Function resource API -###################################################### - /subscriptions/block-subscription: - -#----------------------------------------------------- -# Block a certain subscription -#----------------------------------------------------- - post: - x-scope: apim:subscription_block - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED\"" - x-wso2-request: | - POST https://localhost:9443/api/am/publisher/v0.12/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n \n{\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"PROD_ONLY_BLOCKED\"\n}" - summary: Block a subscription + Lifecycle state change pending task removed successfully. + content: {} + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-state/pending-tasks"' + operationId: deleteAPILifecycleStatePendingTasks + + ###################################################### + # The "API Revisions" resource API + ###################################################### + /apis/{apiId}/revisions: + + #-------------------------------------------- + # List available revisions of an API + #-------------------------------------------- + get: + tags: + - API Revisions + summary: List available revisions of an API description: | - This operation can be used to block a subscription. Along with the request, `blockState` must be specified as a query parameter. - - 1. `BLOCKED` : Subscription is completely blocked for both Production and Sandbox environments. - 2. `PROD_ONLY_BLOCKED` : Subscription is blocked for Production environment only. + List available revisions of an API + operationId: getAPIRevisions parameters: - - $ref: '#/parameters/subscriptionId-Q' - - name: blockState + - $ref: '#/components/parameters/apiId' + - name: query in: query - description: | - Subscription block state. - type: string - required: true - enum: - - BLOCKED - - PROD_ONLY_BLOCKED - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Subscription (Individual) + schema: + type: string responses: 200: description: | OK. - Subscription was blocked successfully. - headers: - ETag: - description: | - Entity Tag of the blocked subscription. - Used by caches, or in conditional requests (Will be supported in future). - type: string - Last-Modified: - description: | - Date and time the subscription has been blocked. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 400: - description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' + List of API revisions are returned. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionList' 404: - description: | - Not Found. - Requested subscription does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Unblock Subscription" Processing Function resource API -###################################################### - /subscriptions/unblock-subscription: - -#----------------------------------------------------- -# Unblock a certain subscription -#----------------------------------------------------- + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"' + + #-------------------------------------------- + # Create a new API revision + #-------------------------------------------- post: - x-scope: apim:subscription_block - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809\"" - x-wso2-request: | - POST https://localhost:9443/api/am/publisher/v0.12/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809 - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8` - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n} " - summary: Unblock a Subscription - parameters: - - $ref: '#/parameters/subscriptionId-Q' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API Revisions + summary: Create a new API revision description: | - This operation can be used to unblock a subscription specifying the subscription Id. The subscription will be fully unblocked after performing this operation. + Create a new API revision + operationId: createAPIRevision + parameters: + - $ref: '#/components/parameters/apiId' + requestBody: + description: API object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevision' + responses: + 201: + description: | + Created. + Successful response with the newly created APIRevision object as the entity in the body. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevision' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json + "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"' + + ###################################################### + # The "API Revisions" individual resource API + ###################################################### + /apis/{apiId}/revisions/{revisionId}: + + #-------------------------------------------- + # Get a revision + #-------------------------------------------- + get: tags: - - Subscription (Individual) + - API Revisions + summary: Retrieve a revision of an API + description: | + Retrieve a revision of an API + operationId: getAPIRevision + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/revisionId' responses: 200: description: | OK. - Subscription was unblocked successfully. - headers: - ETag: - description: | - Entity Tag of the unblocked subscription. - Used by caches, or in conditional requests (Will be supported in future). - type: string - Last-Modified: - description: | - Date and time the subscription has been unblocked. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 400: - description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' + An API revision is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevision' 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' + + #-------------------------------------------- + # Delete a revision + #-------------------------------------------- + delete: + tags: + - API Revisions + summary: Delete a revision of an API + description: | + Delete a revision of an API + operationId: deleteAPIRevision + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/revisionId' + responses: + 200: description: | - Not Found. - Requested subscription does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Tier Collection" resource APIs -###################################################### - '/tiers/{tierLevel}': - -#----------------------------------------------------- -# Retrieve the list of all available tiers -#----------------------------------------------------- + OK. + List of remaining API revisions are returned. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionList' + 204: + description: | + No Content. + Successfully deleted the revision + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' + + /apis/{apiId}/deploy-revision: + + #-------------------------------------------- + # List available deployed revision deployment details of an API + #-------------------------------------------- get: - x-scope: apim:tier_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/tiers/api" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/tiers/api - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 1,\n \"description\": \"Allows 1 request(s) per minute.\",\n \"name\": \"Bronze\",\n \"attributes\": {}\n },\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 20,\n \"description\": \"Allows 20 request(s) per minute.\",\n \"name\": \"Gold\",\n \"attributes\": {}\n },\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 5,\n \"description\": \"Allows 5 request(s) per minute.\",\n \"name\": \"Silver\",\n \"attributes\": {}\n },\n {\n \"unitTime\": 0,\n \"tierPlan\": null,\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 0,\n \"description\": \"Allows unlimited requests\",\n \"name\": \"Unlimited\",\n \"attributes\": {}\n }\n ],\n \"next\": \"\",\n \"count\": 4\n}" - summary: Get all tiers + tags: + - API Revisions + summary: List available deployed revision deployment details of an API description: | - This operation can be used to list the available tiers for a given tier level. Tier level should be specified as a path parameter and should be one of `api`, `application` and `resource`. + List available deployed revision deployment details of an API + operationId: getAPIRevisionDeployments parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/tierLevel' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + List of deployed revision deployment details are returned. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeploymentList' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"' + + #-------------------------------------------- + # Deploy a revision + #-------------------------------------------- + post: tags: - - Throttling Tier (Collection) + - API Revisions + summary: Deploy a revision + description: | + Deploy a revision + operationId: deployAPIRevision + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/revisionId-Q' + requestBody: + description: Deployment object that needs to be added + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' responses: 200: description: | OK. - List of tiers returned. + 201: + description: | + Created. + Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + + /apis/{apiId}/undeploy-revision: + #-------------------------------------------- + # Un-Deploy a revision from deployed gateway + #-------------------------------------------- + post: + tags: + - API Revisions + summary: Un-Deploy a revision + description: | + Un-Deploy a revision + operationId: undeployAPIRevision + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/revisionId-Q' + - $ref: '#/components/parameters/revisionNum-Q' + - name: allEnvironments + in: query schema: - $ref: '#/definitions/TierList' - headers: - Content-Type: - description: The content type of the body. - type: string - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 304: + type: boolean + default: false + requestBody: + description: Deployment object that needs to be added + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' + responses: + 200: description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - 406: + OK. + 201: description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# Create a new tier -#----------------------------------------------------- + Created. + Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + + /apis/{apiId}/restore-revision: + + #-------------------------------------------------------- + # Restore a revision to the working copy of the API + #-------------------------------------------------------- post: - x-scope: apim:tier_manage - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/tiers/api\"" - x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/tiers/api\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 5,\n \"description\": \"Allows 5 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"a\":10,\n \"b\":30\n }\n}" - x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/tiers/Low\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 5,\n \"description\": \"Allows 5 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"b\": \"30\",\n \"a\": \"10\"\n }\n}" - summary: Create a Tier + tags: + - API Revisions + summary: Restore a revision description: | - This operation can be used to create a new throttling tier. The only supported tier level is `api` tiers. - `POST https://localhost:9443/api/am/publisher/v0.12/tiers/api` - - **IMPORTANT:** - * This is only effective when Advanced Throttling is disabled in the Server. If enabled, we need to use Admin REST API for throttling tiers modification related operations. + Restore a revision to the working copy of the API + operationId: restoreAPIRevision parameters: - - in: body - name: body + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/revisionId-Q' + responses: + 201: description: | - Tier object that should to be added + Restored. + Successful response with the newly restored API object as the entity in the body. + content: + application/json: + schema: + $ref: '#/components/schemas/API' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + + /apis/import-service: + post: + tags: + - APIs + summary: Import a Service from Service Catalog + description: This operation can be used to create an API from a Service from Service Catalog + operationId: importServiceFromCatalog + parameters: + - name: serviceKey + in: query required: true schema: - $ref: '#/definitions/Tier' - - $ref: '#/parameters/tierLevel-A' - - $ref: '#/parameters/Content-Type' - tags: - - Throttling Tier (Collection) + type: string + description: ID of service that should be imported from Service Catalog + requestBody: + content: + application/json: + schema: + '$ref': '#/components/schemas/API' responses: 201: description: | Created. Successful response with the newly created object as entity in the body. - Location header contains URL of newly created entity. - schema: - $ref: '#/definitions/Tier' + Location header contains the URL of the newly created entity. headers: Location: description: | - Location of the newly created tier. - type: string + The URL of the newly created resource. + schema: + type: string Content-Type: description: | The content type of the body. - type: string + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + + /apis/{apiId}/comments: + get: + tags: + - Comments + summary: Retrieve API Comments + description: | + Get a list of Comments that are already added to APIs + operationId: getAllCommentsOfAPI + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/requestedTenant' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/includeCommenterInfo' + responses: + 200: + description: | + OK. + Comments list is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/CommentList' + 401: + $ref: '#/components/responses/Unauthorized' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: [] + x-code-samples: + - lang: Curl + source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments" + + post: + tags: + - Comments + summary: Add an API Comment + operationId: addCommentToAPI + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/parentCommentID' + requestBody: + description: | + Comment object that should to be added + content: + application/json: + schema: + title: Post request body + type: object + properties: + content: + type: string + description: | + Content of the comment + example: This is a comment + category: + type: string + description: | + Category of the comment + example: general + required: + - content + required: true + responses: + 201: + description: | + Created. + Successful response with the newly created object as entity in the body. + Location header contains URL of newly created entity. + headers: ETag: description: | - Entity Tag of the response resource. - Used by caches, or in conditional request' - type: string + Entity Tag of the response resource. Used by caches, or in conditional request. + schema: + type: string + Location: + description: | + Location to the newly created Comment. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' 400: - description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/BadRequest' + 401: + $ref: '#/components/responses/Unauthorized' 415: - description: | - Unsupported media type. - The entity of the request was in a not supported format. - -###################################################### -# The "Individual Tier" resource APIs -###################################################### - '/tiers/{tierLevel}/{tierName}': - -#----------------------------------------------------- -# Retrieve a certain tier -#----------------------------------------------------- + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments"' + + /apis/{apiId}/comments/{commentId}: get: - x-scope: apim:tier_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/tiers/api/Bronze" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/tiers/api/Bronze - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 1,\n \"description\": \"Allows 1 request(s) per minute.\",\n \"name\": \"Bronze\",\n \"attributes\": {}\n}" - summary: Get details of a tier + tags: + - Comments + summary: Get Details of an API Comment description: | - This operation can be used to retrieve details of a single tier by specifying the tier level and tier name. - Note that the scope of the API is mandatory while retreiving the access token with the following cURL command : `curl -k -d \"grant_type=password&username=username&password=password&scope=apim:tier_view\" -H \"Authorization: Basic \" https://localhost:8243/token`. - You will receive the access token as the response, for example `"access_token":"8644c013-7ff1-3217-b150-d7b92cae6be7"`. + Get the individual comment given by a username for a certain API. + operationId: getCommentOfAPI parameters: - - $ref: '#/parameters/tierName' - - $ref: '#/parameters/tierLevel' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Throttling Tier (Individual) + - $ref: '#/components/parameters/commentId' + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/requestedTenant' + - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/components/parameters/includeCommenterInfo' + - $ref: '#/components/parameters/replyLimit' + - $ref: '#/components/parameters/replyOffset' responses: 200: description: | OK. - Tier returned - schema: - $ref: '#/definitions/Tier' + Comment returned. headers: - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string + Used by caches, or in conditional requests. + schema: + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - type: string + Used by caches, or in conditional requests. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' 304: description: | Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). + Empty body because the client has already the latest version of the requested resource. + content: {} + 401: + $ref: '#/components/responses/Unauthorized' 404: - description: | - Not Found. - Requested Tier does not exist. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' 406: - description: | - Not Acceptable. - The requested media type is not supported. - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# Update a certain tier -#----------------------------------------------------- - put: - x-scope: apim:tier_manage - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X PUT -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low\"" - x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 10,\n \"description\": \"Allows 10 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"a\": \"30\",\n \"b\": \"10\",\n \"c\": \"20\"\n }\n}\n" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 10,\n \"description\": \"Allows 10 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"b\": \"10\",\n \"c\": \"20\",\n \"a\": \"30\"\n }\n}" - summary: Update a Tier + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: [] + x-code-samples: + - lang: Curl + source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4" + + patch: + tags: + - Comments + summary: Edit a comment description: | - This operation can be used to update an existing tier. The only supported tier level is `api` tiers. - `PUT https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low` - - **IMPORTANT:** - * This is only effective when Advanced Throttling is disabled in the Server. If enabled, we need to use Admin REST API for throttling tiers modification related operations. + Edit the individual comment + operationId: editCommentOfAPI parameters: - - $ref: '#/parameters/tierName' - - in: body - name: body - description: | - Tier object that needs to be modified - required: true - schema: - $ref: '#/definitions/Tier' - - $ref: '#/parameters/tierLevel-A' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Throttling Tier (Individual) + - $ref: '#/components/parameters/commentId' + - $ref: '#/components/parameters/apiId' + requestBody: + description: | + Comment object that should to be updated + content: + application/json: + schema: + title: Patch request body + type: object + properties: + content: + type: string + description: | + Content of the comment + example: This is a comment + category: + type: string + description: | + Category of the comment + example: general + required: true responses: 200: description: | OK. - Subscription updated. - schema: - $ref: '#/definitions/Tier' + Comment updated. headers: - Location: - description: | - The URL of the newly created resource. - type: string - Content-Type: - description: | - The content type of the body. - type: string ETag: description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string - Last-Modified: + Entity Tag of the response resource. Used by caches, or in conditional request. + schema: + type: string + Location: #??? description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - type: string + Location to the newly created Comment. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Comment' 400: - description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/BadRequest' + 401: + $ref: '#/components/responses/Unauthorized' 404: - description: | - Not Found. - The resource to be updated does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotFound' + 415: + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4"' -#----------------------------------------------------- -# Delete a certain tier -#----------------------------------------------------- delete: - x-scope: apim:tier_manage - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE \"https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low\"" - x-wso2-request: | - DELETE https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK" - summary: Delete a Tier + tags: + - Comments + summary: Delete an API Comment description: | - This operation can be used to delete an existing tier. The only supported tier level is `api` tiers. - `DELETE https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low` - - **IMPORTANT:** - * This is only effective when Advanced Throttling is disabled in the Server. If enabled, we need to use Admin REST API for throttling tiers modification related operations. + Remove a Comment + operationId: deleteComment parameters: - - $ref: '#/parameters/tierName' - - $ref: '#/parameters/tierLevel-A' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Throttling Tier (Individual) + - $ref: '#/components/parameters/commentId' + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' responses: 200: description: | OK. Resource successfully deleted. + content: {} + 401: + $ref: '#/components/responses/Unauthorized' 404: - description: | - Not Found. - Resource to be deleted does not exist. - schema: - $ref: '#/definitions/Error' - 412: - description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Update Permission" Processing Function resource API -###################################################### - '/tiers/update-permission': - -#----------------------------------------------------- -# Update the permission of a certain tier -#----------------------------------------------------- - post: - x-scope: apim:tier_manage - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/tiers/update-permission?tierName=Bronze&tierLevel=api\"" - x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/tiers/update-permission?tierName=Bronze&tierLevel=api\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"permissionType\":\"deny\",\n \"roles\": [\"Internal/everyone\",\"admin\"]\n}" - x-wso2-response: "HTTP/1.1 200 OK" - summary: Update tier permission + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: curl -k -X DELETE -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4" + + /apis/{apiId}/comments/{commentId}/replies: + get: + tags: + - Comments + summary: Get replies of a comment description: | - This operation can be used to update tier permissions which controls access for the particular tier based on the subscribers' roles. + Get replies of a comment + operationId: getRepliesOfComment parameters: - - $ref: '#/parameters/tierName-Q' - - $ref: '#/parameters/tierLevel-Q' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - - in: body - name: permissions - schema: - $ref: '#/definitions/TierPermission' - tags: - - Throttling Tier (Individual) + - $ref: '#/components/parameters/commentId' + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/requestedTenant' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/components/parameters/includeCommenterInfo' responses: 200: description: | OK. - Successfully updated tier permissions - schema: - type: array - items: - $ref: '#/definitions/Tier' + Comment returned. headers: ETag: description: | - Entity Tag of the modified tier. - Used by caches, or in conditional requests (Will be supported in future). - type: string + Entity Tag of the response resource. + Used by caches, or in conditional requests. + schema: + type: string Last-Modified: description: | - Date and time the tier has been modified. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 400: - description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' - 403: + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/CommentList' + 304: description: | - Forbidden. - The request must be conditional but no condition has been specified. - schema: - $ref: '#/definitions/Error' + Not Modified. + Empty body because the client has already the latest version of the requested resource. + content: {} + 401: + $ref: '#/components/responses/Unauthorized' 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: [] + x-code-samples: + - lang: Curl + source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4" + + /apis/import-openapi: + post: + tags: + - APIs + summary: Import an OpenAPI Definition + description: | + This operation can be used to create an API from an OpenAPI definition. Provide either `url` or `file` + to specify the definition. + + Specify additionalProperties with **at least** API's name, version, context and endpointConfig. + operationId: importOpenAPIDefinition + requestBody: + content: + multipart/form-data: + schema: + properties: + file: + type: string + description: Definition to upload as a file + format: binary + url: + type: string + description: Definition url + additionalProperties: + type: string + description: Additional attributes specified as a stringified JSON with API's schema + responses: + 201: description: | - Not Found. - Requested tier does not exist. - schema: - $ref: '#/definitions/Error' - 412: + Created. + Successful response with the newly created object as entity in the body. + Location header contains URL of newly created entity. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' + 400: + $ref: '#/components/responses/BadRequest' + 415: + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@openapi.json -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-openapi"' + x-examples: + $ref: docs/examples/apis/import_openapi_post.yaml + + /apis/import-wsdl: + post: + tags: + - APIs + summary: Import a WSDL Definition + description: | + This operation can be used to create an API using a WSDL definition. Provide either `url` or `file` + to specify the definition. + + WSDL can be speficied as a single file or a ZIP archive with WSDLs and reference XSDs etc. + Specify additionalProperties with **at least** API's name, version, context and endpointConfig. + operationId: importWSDLDefinition + requestBody: + content: + multipart/form-data: + schema: + properties: + file: + type: string + description: | + WSDL definition as a file or archive + + **Sample cURL to Upload WSDL File** + + curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -F file=@api.wsdl -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-wsdl" + + **Sample cURL to Upload WSDL Archive** + + curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -F file="@wsdl.zip;type=application/zip" -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-wsdl" + format: binary + url: + type: string + description: WSDL Definition url + additionalProperties: + type: string + description: Additional attributes specified as a stringified JSON + with API's schema + implementationType: + type: string + description: | + If 'SOAP' is specified, the API will be created with only one resource 'POST /*' which is to be used for SOAP + operations. + + If 'HTTP_BINDING' is specified, the API will be created with resources using HTTP binding operations + which are extracted from the WSDL. + default: SOAP + enum: + - SOAPTOREST + - SOAP + responses: + 201: description: | - Precondition Failed. - The request has not been performed because one of the preconditions is not met. - schema: - $ref: '#/definitions/Error' - - -###################################################### -# The "Environment Collection" resource API -###################################################### - /environments: - -#----------------------------------------------------- -# Retrieve the list of environments configured for a certain API -#----------------------------------------------------- - get: - x-scope: apim:api_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/environments\"" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/environments - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"list\": [ {\n \"showInApiConsole\": true,\n \"serverUrl\": \"https://localhost:9443/services/\",\n \"endpoints\": {\n \"http\": \"http://localhost:8280\",\n \"https\": \"https://localhost:8243\"\n },\n \"name\": \"Production and Sandbox\",\n \"type\": \"hybrid\"\n }],\n \"count\": 1\n}" - summary: Get all gateway environments + Created. + Successful response with the newly created object as entity in the body. + Location header contains URL of newly created entity. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' + 400: + $ref: '#/components/responses/BadRequest' + 415: + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@api.wsdl -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-wsdl"' + x-examples: + $ref: docs/examples/apis/wsdl/import_wsdl_post.yaml + + /apis/import-graphql-schema: + post: + tags: + - APIs + summary: Import API Definition description: | - This operation can be used to retrieve the list of gateway environments available. + This operation can be used to create api from api definition.APIMgtDAOTest + + API definition is GraphQL Schema parameters: - - $ref: '#/parameters/apiId-Q' + - name: If-Match + in: header + description: | + Validator for conditional requests; based on ETag. + schema: + type: string + requestBody: + content: + multipart/form-data: + schema: + properties: + type: + type: string + description: Definition type to upload + file: + type: string + description: Definition to uploads a file + format: binary + additionalProperties: + type: string + description: Additional attributes specified as a stringified JSON + with API's schema + responses: + 201: + description: | + Created. + Successful response with the newly created object as entity in the body. + Location header contains URL of newly created entity. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' + 400: + $ref: '#/components/responses/BadRequest' + 415: + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@schema.graphql -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-graphql-schema"' + operationId: importGraphQLSchema + + /apis/validate-openapi: + post: tags: - - Environment (Collection) + - Validation + summary: Validate an OpenAPI Definition + description: | + This operation can be used to validate an OpenAPI definition and retrieve a summary. Provide either `url` + or `file` to specify the definition. + operationId: validateOpenAPIDefinition + parameters: + - name: returnContent + in: query + description: | + Specify whether to return the full content of the OpenAPI definition in the response. This is only + applicable when using url based validation + schema: + type: boolean + default: false + requestBody: + content: + multipart/form-data: + schema: + properties: + url: + type: string + description: OpenAPI definition url + file: + type: string + description: OpenAPI definition as a file + format: binary responses: 200: description: | OK. - Environment list is returned. + API definition validation information is returned + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/OpenAPIDefinitionValidationResponse' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@openapi.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-openapi"' + x-examples: + $ref: docs/examples/apis/validate_openapi_post.yaml + + /apis/validate-endpoint: + post: + tags: + - Validation + summary: Check Whether Given Endpoint URL is Valid + description: | + Using this operation, it is possible check whether the given API endpoint url is a valid url + operationId: validateEndpoint + parameters: + - name: endpointUrl + in: query + description: API endpoint url + required: true + schema: + type: string + - name: apiId + in: query schema: - $ref: '#/definitions/EnvironmentList' + type: string + responses: + 200: + description: | + OK. + API definition validation information is returned headers: Content-Type: description: | The content type of the body. - type: string - ETag: + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ApiEndpointValidationResponse' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-endpoint?apiId=e0824883-3e86-403a-aec1-22bbc454eb7c&endpointUrl=https%3A%2F%2Flocalhost%3A9443%2Fam%2Fsample%2Fpizzashack%2Fv1%2Fapi%2F"' + + /apis/validate: + post: + tags: + - Validation + summary: Check Given API Context Name already Exists + description: | + Using this operation, you can check a given API context is already used. You need to provide the context name you want to check. + operationId: validateAPI + parameters: + - name: query + in: query + description: | + **Search condition**. + + You can search in attributes by using an **":"** modifier. + + Eg. + "name:wso2" will match an API if the provider of the API is exactly "wso2". + + Supported attribute modifiers are [** version, context, name **] + + If no advanced attribute modifier has been specified, search will match the + given query string against API Name. + required: true + schema: + type: string + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + API definition validation information is returned + headers: + Content-Type: description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - type: string - 304: + The content type of the body. + schema: + type: string + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate?query=name%3Awso2"' + x-examples: + $ref: docs/examples/apis/apis_validate.yaml + + /apis/validate-wsdl: + post: + tags: + - Validation + summary: Validate a WSDL Definition + description: | + This operation can be used to validate a WSDL definition and retrieve a summary. Provide either `url` + or `file` to specify the definition. + operationId: validateWSDLDefinition + requestBody: + content: + multipart/form-data: + schema: + properties: + url: + type: string + description: Definition url + file: + type: string + description: Definition to upload as a file + format: binary + responses: + 200: description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). + OK. + API definition validation information is returned + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/WSDLValidationResponse' + 400: + $ref: '#/components/responses/BadRequest' 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@api.wsdl "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-wsdl"' + x-examples: + $ref: docs/examples/apis/wsdl/validate_wsdl_post.yaml + + /apis/validate-graphql-schema: + post: + tags: + - Validation + summary: Validate GraphQL API Definition and Retrieve a Summary + description: | + This operation can be used to validate a graphQL definition and retrieve a summary. + requestBody: + content: + multipart/form-data: + schema: + required: + - file + properties: + file: + type: string + description: Definition to upload as a file + format: binary + required: true + responses: + 200: description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' - /policies/mediation: - -#----------------------------------------------------------------------------------------- -# Retrieving the list of all global mediation sequences under a given search condition -#----------------------------------------------------------------------------------------- + OK. + API definition validation information is returned + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/GraphQLValidationResponse' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@schema.graphql "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-graphql-schema"' + operationId: validateGraphQLSchema + + /apis/{apiId}/graphql-schema: get: - x-scope: apim:mediation_policy_view - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/policies/mediation" - x-wso2-request: | - GET https://localhost:9443/api/am/publisher/v0.12/policies/mediation - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"count\": 10,\r\n \"next\": null,\r\n \"previous\": null,\r\n \"list\": [\r\n {\r\n \"name\": \"debug_json_fault\",\r\n \"id\": \"563de8f3-dd1d-4ec7-afc2-d158c663ed34\",\r\n \"type\": \"fault\"\r\n },\r\n {\r\n \"name\": \"json_fault\",\r\n \"id\": \"f9c36f4d-a2b6-41e7-b311-d358a47916be\",\r\n \"type\": \"fault\"\r\n },\r\n {\r\n \"name\": \"json_to_xml_in_message\",\r\n \"id\": \"3921225b-7918-4b95-a851-22c4e4e3e911\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"debug_in_flow\",\r\n \"id\": \"2bc15f93-4455-4763-89b8-83600fb9d731\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"log_in_message\",\r\n \"id\": \"4d287cca-76ab-44ca-b22e-919fc27c50e3\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"preserve_accept_header\",\r\n \"id\": \"3776b215-b3bc-40b6-bdcb-06efa7de64be\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"xml_to_json_in_message\",\r\n \"id\": \"50ac2002-769e-4f90-8549-6d0248dff7d2\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"xml_to_json_out_message\",\r\n \"id\": \"2af75853-ed75-4d25-81aa-0ebbeca691ea\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"json_to_xml_out_message\",\r\n \"id\": \"d9fa3ffc-f6b6-4171-ab97-eb44196cb66e\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"debug_out_flow\",\r\n \"id\": \"260b7701-4071-46bd-9b66-900ac6fffed6\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"apply_accept_header\",\r\n \"id\": \"15c17c2f-33e3-4c37-a262-04dfa49983a4\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"log_out_message\",\r\n \"id\": \"d37dca41-c048-492a-82cf-9a2292c6fff0\",\r\n \"type\": \"out\"\r\n }\r\n ]\r\n}" - summary: | - Get all global level mediation policies + tags: + - GraphQL Schema (Individual) + summary: Get the Schema of a GraphQL API description: | - This operation provides you a list of available all global level mediation policies. + This operation can be used to retrieve the Schema definition of a GraphQL API. parameters: - - $ref : '#/parameters/limit' - - $ref : '#/parameters/offset' - - name : query - in: query - description: "-Not supported yet-" - type: string - - $ref : "#/parameters/Accept" - - $ref : "#/parameters/If-None-Match" - tags: - - Mediation Policy (Collection) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/If-None-Match' responses: 200: description: | OK. - List of mediation policies is returned. - schema: - $ref: '#/definitions/mediationList' + Requested GraphQL Schema DTO object belongs to the API headers: - Content-Type: - description: The content type of the body. - type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - type: string + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/GraphQLSchema' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/e0824883-3e86-403a-aec1-22bbc454eb7c/graphql-schema"' + operationId: getAPIGraphQLSchema - - -###################################################### -# The "Workflow approval" resource API -###################################################### - /workflows/update-workflow-status: - -#------------------------------------------------------------------- -# Resume the workflow by approving or rejecting the workflow request -#------------------------------------------------------------------- - post: - x-scope: apim:api_workflow - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/workflows/update-workflow-status?workflowReferenceId=56e3a170-a7a7-45f8-b051-7e43a58a67e1\"" - x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/workflows/update-workflow-status?workflowReferenceId=56e3a170-a7a7-45f8-b051-7e43a58a67e1\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"status\" : \"APPROVED\",\n \"attributes\" : {\n \"apiCurrentState\": \"Created\",\n \"apiLCAction\": \"Publish\",\n \"apiName\":\"APIname\",\n \"apiVersion\" : \"1.0.0\",\n \"apiProvider\" : \"admin\",\n \"invoker\": \"admin\"\n }\n}" - x-wso2-response: "HTTP/1.1 200 OK" - summary: Update workflow status + put: + tags: + - GraphQL Schema + summary: Add a Schema to a GraphQL API description: | - This operation can be used to approve or reject a workflow task. + This operation can be used to add a GraphQL Schema definition to an existing GraphQL API. parameters: - - $ref: '#/parameters/workflowReferenceId-Q' - - in: body - name: body - description: | - Workflow event that need to be updated - required: true - schema: - $ref: '#/definitions/Workflow' - tags: - - Workflows (Individual) + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + required: + - schemaDefinition + properties: + schemaDefinition: + type: string + description: schema definition of the GraphQL API + required: true responses: 200: description: | OK. - Workflow request information is returned. - schema: - $ref: '#/definitions/Workflow' + Successful response with updated schema definition headers: + ETag: + description: | + Entity Tag of the response resource. Used by cache, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string Content-Type: description: | The content type of the body. - type: string + schema: + type: string + content: {} 400: + $ref: '#/components/responses/BadRequest' + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F schemaDefinition=@schema.graphql "https://127.0.0.1:9443/api/am/publisher/v2/apis/e0824883-3e86-403a-aec1-22bbc454eb7c/graphql-schema"' + operationId: updateAPIGraphQLSchema + + /apis/{apiId}/amznResourceNames: + get: + tags: + - AWS Lambda (Individual) + summary: Retrieve the ARNs of AWS Lambda Functions + description: | + This operation can be use to retrieve ARNs of AWS Lambda function for a given AWS credentials. + parameters: + - $ref: '#/components/parameters/apiId' + responses: + 200: description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' + OK. + Requested ARN List of the API is returned + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + type: string + example: |- + { + "count": "2", + "list": [ + "arn:aws:lambda:us-west-2:123456789012:function:my-function1", + "arn:aws:lambda:us-west-2:123456789012:function:my-function2" + ] + } 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/e0824883-3e86-403a-aec1-22bbc454eb7c/amznResourceNames"' + x-examples: + $ref: docs/examples/apis/apis_id_amznresourcenames_get.yaml + operationId: getAmazonResourceNamesOfAPI + + /apis/{apiId}/monetize: + post: + tags: + - API Monetization + summary: Configure Monetization for a Given API + description: | + This operation can be used to configure monetization for a given API. + parameters: + - $ref: '#/components/parameters/apiId' + requestBody: + description: Monetization data object + content: + application/json: + schema: + $ref: '#/components/schemas/APIMonetizationInfo' + required: true + responses: + 201: description: | - Not Found. - Workflow for the given reference in not found. - schema: - $ref: '#/definitions/Error' -###################################################### -# Parameters - required by some of the APIs above -###################################################### -parameters: - -# API Identifier -# Specified as part of the path expression - apiId: - name: apiId - in: path - description: | - **API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. - The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. - Should be formatted as **provider-name-version**. - required: true - type: string - x-encoded: true - -# API Identifier -# Specified as part of the query string - apiId-Q: - name: apiId - in: query - description: | - **API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. - The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. - Should be formatted as **provider-name-version**. - required: true - type: string - x-encoded: true - - -# Document Identifier -# Specified as part of the path expression - documentId: - name: documentId - in: path - description: | - Document Identifier - required: true - type: string - -# Application Identifier -# Specified as part of the path expression - applicationId: - name: applicationId - in: path - description: | - **Application Identifier** consisting of the UUID of the Application. - required: true - type: string - -# Subscription Identifier -# Specified as part of the path expression - subscriptionId: - name: subscriptionId - in: path - description: | - Subscription Id - required: true - type: string - -# Mediation policy identifier -# Specified as part of the path expression - mediationPolicyId: - name: mediationPolicyId - in: path - description: | - Mediation policy Id - required: true - type: string - - - -# Subscription Identifier -# Specified as part of the query string - subscriptionId-Q: - name: subscriptionId - in: query - description: | - Subscription Id - required: true - type: string - -# Tier Name -# Specified as part of the path expression - tierName: - name: tierName - in: path - description: | - Tier name - required: true - type: string - -# Tier Name -# Specified as part of the query string - tierName-Q: - name: tierName - in: query - description: | - Name of the tier - required: true - type: string - -# Tier Type -# Specified as part of the path expression - tierLevel: - name: tierLevel - in: path - description: | - List API or Application or Resource type tiers. - type: string - enum: - - api - - application - - resource - required: true - -# Tier Type -# Specified as part of the path expression - tierLevel-A: - name: tierLevel - in: path - description: | - List API or Application or Resource type tiers. - type: string - enum: - - api - required: true - -# Tier Type -# Specified as part of the query string - tierLevel-Q: - name: tierLevel - in: query - description: | - List API or Application or Resource type tiers. - type: string - enum: - - api - - application - - resource - required: true - -# Used for pagination: -# The maximum number of resoures to be returned by a GET - limit: - name: limit - in: query - description: | - Maximum length of resource array to return. - default: 25 - type: integer - -# Used for pagination: -# The order number of an instance in a qualified set of resoures -# at which to start to return the next batch of qualified resources - offset: - name: offset - in: query - description: | - Starting point within the complete list of items qualified. - default: 0 - type: integer - -# The HTTP Accept header - Accept: - name: Accept - in: header - description: | - Media types acceptable for the response. Default is application/json. - default: application/json - type: string - -# The HTTP Content-Type header - Content-Type: - name: Content-Type - in: header - description: | - Media type of the entity in the body. Default is application/json. - default: application/json - required: true - type : string - -# The HTTP Authorization header - Authorization: - name: Authorization - in: header - description: | - Holds the bearer token for apis that require authentication. - required: true - type : string - -# The HTTP If-None-Match header -# Used to avoid retrieving data that are already cached - If-None-Match: - name: If-None-Match - in: header - description: | - Validator for conditional requests; based on the ETag of the formerly retrieved - variant of the resource (Will be supported in future). - type : string - -# The HTTP If-Modified-Since header -# Used to avoid retrieving data that are already cached - If-Modified-Since: - name: If-Modified-Since - in: header - description: | - Validator for conditional requests; based on Last Modified header of the - formerly retrieved variant of the resource (Will be supported in future). - type: string - -# The HTTP If-Match header -# Used to avoid concurrent updates - If-Match: - name: If-Match - in: header - description: | - Validator for conditional requests; based on ETag (Will be supported in future). - type: string - -# The HTTP If-Unmodified-Since header -# Used to avoid concurrent updates - If-Unmodified-Since: - name: If-Unmodified-Since - in: header - description: | - Validator for conditional requests; based on Last Modified header (Will be supported in future). - type: string - - -# Workflow reference ID -# Specified as part of the path expression - workflowReferenceId-Q: - name: workflowReferenceId - in: query - description: | - Workflow reference id - required: true - type: string - -###################################################### -# The resources used by some of the APIs above within the message body -###################################################### -definitions: - -#----------------------------------------------------- -# The API List resource -#----------------------------------------------------- - APIList: - title: API List - properties: - count: - type: integer - description: | - Number of APIs returned. - example: 1 - next: - type: string - description: | - Link to the next subset of resources qualified. - Empty if no more resources are to be returned. - example: "/apis?limit=1&offset=2&query=" - previous: - type: string - description: | - Link to the previous subset of resources qualified. - Empty if current subset is the first subset returned. - example: "/apis?limit=1&offset=0&query=" - list: - type: array - items: - $ref: '#/definitions/APIInfo' - pagination: + OK. + Monetization status changed successfully. + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/monetize' + operationId: addAPIMonetization + + /apis/{apiId}/monetization: + get: + tags: + - API Monetization + summary: Get Monetization Status for each Tier in a Given API + description: | + This operation can be used to get monetization status for each tier in a given API + parameters: + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + Monetization status for each tier returned successfully. + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/monetize"' + operationId: getAPIMonetization + + /apis/{apiId}/revenue: + get: + tags: + - API Monetization + summary: Get Total Revenue Details of a Given Monetized API with Meterd Billing + description: | + This operation can be used to get details of total revenue details of a given monetized API with meterd billing. + parameters: + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + Details of a total revenue returned. + headers: + ETag: + description: Entity Tag of the response resource. Used by caches, or + in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: Date and time the resource has been modified the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevenue' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/revenue"' + operationId: getAPIRevenue + + /apis/{apiId}/documents: + get: + tags: + - API Documents + summary: Get a List of Documents of an API + description: | + This operation can be used to retrieve a list of documents belonging to an API by providing the id of the API. + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Document list is returned. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/e0824883-3e86-403a-aec1-22bbc454eb7c/documents"' + operationId: getAPIDocuments + + post: + tags: + - API Documents + summary: Add a New Document to an API + description: | + This operation can be used to add a new documentation to an API. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API document ** API once we obtain a document Id by this operation. + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' + requestBody: + description: Document object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + required: true + responses: + 201: + description: | + Created. + Successful response with the newly created Document object as entity in the body. + Location header contains URL of newly added document. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + Location to the newly created Document. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + 400: + $ref: '#/components/responses/BadRequest' + 415: + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_create + - apim:document_create + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents"' + operationId: addAPIDocument + + /apis/{apiId}/documents/{documentId}: + get: + tags: + - API Documents + summary: Get a Document of an API + description: | + This operation can be used to retrieve a particular document's metadata associated with an API. + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Document returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"' + operationId: getAPIDocumentByDocumentId + + put: + tags: + - API Documents + summary: Update a Document of an API + description: | + This operation can be used to update metadata of an API's document. + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/If-Match' + requestBody: + description: Document object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + required: true + responses: + 200: + description: | + OK. + Document updated + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the updated document. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + - apim:document_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @doc.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"' + operationId: updateAPIDocument + + delete: + tags: + - API Documents + summary: Delete a Document of an API + description: | + This operation can be used to delete a document associated with an API. + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/If-Match' + responses: + 200: + description: | + OK. + Resource successfully deleted. + content: {} + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + - apim:document_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"' + operationId: deleteAPIDocument + + /apis/{apiId}/documents/{documentId}/content: + get: + tags: + - API Documents + summary: Get the Content of an API Document + description: | + This operation can be used to retrive the content of an API's document. + + The document can be of 3 types. In each cases responses are different. + + 1. **Inline type**: + The content of the document will be retrieved in `text/plain` content type + + _Sample cURL_ : `curl -k -H "Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51" -F inlineContent=@"docs.txt" -X POST "https://localhost:9443/api/am/publisher/v2/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` + 2. **FILE type**: + The file will be downloaded with the related content type (eg. `application/pdf`) + 3. **URL type**: + The client will recieve the URL of the document as the Location header with the response with - `303 See Other` + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + File or inline content returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/octet-stream: + schema: + type: string + 303: + description: | + See Other. + Source can be retrived from the URL specified at the Location header. + headers: + Location: + description: | + The Source URL of the document. + schema: + type: string + content: {} + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5/content"' + operationId: getAPIDocumentContentByDocumentId + + post: + tags: + - API Documents + summary: Upload the Content of an API Document + description: | + Thid operation can be used to upload a file or add inline content to an API document. + + **IMPORTANT:** + * Either **file** or **inlineContent** form data parameters should be specified at one time. + * Document's source type should be **FILE** in order to upload a file to the document using **file** parameter. + * Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter. + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + properties: + file: + type: string + description: Document to upload + format: binary + inlineContent: + type: string + description: Inline content of the document + responses: + 200: + description: | + OK. + Document updated + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the updated content of the document. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + - apim:document_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@sample.pdf "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5/content"' + operationId: addAPIDocumentContent + + /apis/{apiId}/documents/validate: + post: + tags: + - API Documents + summary: Check Whether a Document with the Provided Name Exist + description: | + This operation can be used to verify the document name exists or not. + operationId: validateDocument + parameters: + - $ref: '#/components/parameters/apiId' + - name: name + in: query + description: | + The name of the document which needs to be checked for the existance. + required: true + schema: + type: string + - $ref: '#/components/parameters/If-Match' + responses: + 200: + description: | + OK. + Successful response if the document name exists. + 400: + $ref: '#/components/responses/BadRequest' + 404: + description: | + Not Found. + The specified resource does not exist. + security: + - OAuth2Security: + - apim:api_create + - apim:document_create + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/validate?name=CalculatorDoc"' + x-examples: + $ref: docs/examples/apis/apis_id_document_validate.yaml + + /apis/{apiId}/mediation-policies: + get: + tags: + - API Mediation Policies + summary: | + Get All Mediation Policies of an API + description: | + This operation provides you a list of available mediation policies of an API. + operationId: getAllAPIMediationPolicies + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: query + in: query + description: -Not supported yet- + schema: + type: string + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + List of qualifying APIs is returned. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/MediationList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + - apim:mediation_policy_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies"' + x-examples: + $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_get.yaml + + post: + tags: + - API Mediation Policies + summary: Add an API Specific Mediation Policy + description: | + This operation can be used to add an API specifc mediation policy. + operationId: addAPIMediationPolicy + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + required: + - type + properties: + mediationPolicyFile: + type: string + description: Mediation Policy to upload + format: binary + inlineContent: + type: string + description: Inline content of the Mediation Policy + type: + type: string + description: Type of the mediation sequence + required: true + responses: + 201: + description: | + OK. + mediation policy uploaded + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the uploaded mediation policy of the API. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Mediation' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + - apim:mediation_policy_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F mediationPolicyFile=@TokenExchange.xml + -F type=in "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies"' + x-examples: + $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_post.yaml + + /apis/{apiId}/mediation-policies/{mediationPolicyId}: + get: + tags: + - API Mediation Policy + summary: Get an API Specific Mediation Policy + description: | + This operation can be used to retrieve a particular API specific mediation policy. + operationId: getAPIMediationPolicyByPolicyId + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/mediationPolicyId' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Mediation policy returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Mediation' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + - apim:mediation_policy_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a"' + x-examples: + $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_get.yaml + + delete: + tags: + - API Mediation Policy + summary: Delete an API Specific Mediation Policy + description: | + This operation can be used to delete an existing API specific mediation policy providing the Id of the API and the Id of the mediation policy. + operationId: deleteAPIMediationPolicyByPolicyId + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/mediationPolicyId' + - $ref: '#/components/parameters/If-Match' + responses: + 200: + description: | + OK. + Resource successfully deleted. + content: {} + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + - apim:mediation_policy_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a"' + x-examples: + $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_delete.yaml + + /apis/{apiId}/mediation-policies/{mediationPolicyId}/content: + get: + tags: + - API Mediation Policy + summary: Download an API Specific Mediation Policy + description: | + This operation can be used to download a particular API specific mediation policy. + operationId: getAPIMediationPolicyContentByPolicyId + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/mediationPolicyId' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Mediation policy returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_view + - apim:mediation_policy_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a/content"' + x-examples: + $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_content_get.yaml + + put: + tags: + - API Mediation Policy + summary: Update an API Specific Mediation Policy + description: | + This operation can be used to update an existing mediation policy of an API. + operationId: updateAPIMediationPolicyContentByPolicyId + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/mediationPolicyId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + required: + - type + properties: + file: + type: string + description: Mediation Policy to upload + format: binary + inlineContent: + type: string + description: Inline content of the Mediation Policy + type: + type: string + description: Type of the mediation sequence(in/out/fault) + required: true + responses: + 200: + description: | + OK. + Successful response with updated API object + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Mediation' + 400: + $ref: '#/components/responses/BadRequest' + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + - apim:mediation_policy_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@TokenExchange.xml -F type=@type.txt "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a/content"' + x-examples: + $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_content_put.yaml + + /apis/{apiId}/wsdl-info: + get: + tags: + - APIs + summary: Get WSDL Meta Information + description: | + This operation can be used to retrieve the WSDL meta information of an API. It states whether the API is a SOAP + API. If the API is a SOAP API, it states whether it has a single WSDL or a WSDL archive. + operationId: getWSDLInfoOfAPI + parameters: + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + Requested WSDL meta information of the API is returned + content: + application/json: + schema: + $ref: '#/components/schemas/WSDLInfo' + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/wsdl-info"' + x-examples: + $ref: docs/examples/apis/wsdl/apiId_wsdl_info_get.yaml + + /apis/{apiId}/wsdl: + get: + tags: + - APIs + summary: Get WSDL definition + description: | + This operation can be used to retrieve the WSDL definition of an API. It can be either a single WSDL file or a WSDL archive. + + The type of the WSDL of the API is indicated at the "wsdlInfo" element of the API payload definition. + operationId: getWSDLOfAPI + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Requested WSDL document of the API is returned + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + content: {} + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/wsdl"' + x-examples: + $ref: docs/examples/apis/wsdl/apiId_wsdl_get.yaml + + put: + tags: + - APIs + summary: Update WSDL Definition + description: | + This operation can be used to update the WSDL definition of an existing API. WSDL to be updated can be passed as either "url" or "file". + Only one of "url" or "file" can be used at the same time. "file" can be specified as a single WSDL file or as a zip file which has a WSDL + and its dependencies (eg: XSDs) + operationId: updateWSDLOfAPI + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + properties: + file: + type: string + description: WSDL file or archive to upload + format: binary + url: + type: string + description: WSDL Definition url + responses: + 200: + description: | + OK. + Successful response with updated WSDL definition + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@api.wsdl "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/wsdl"' + x-examples: + $ref: docs/examples/apis/wsdl/apiId_wsdl_put.yaml + + /apis/{apiId}/graphql-policies/complexity: + get: + tags: + - GraphQL Policies + summary: Get the Complexity Related Details of an API + description: | + This operation can be used to retrieve complexity related details belonging to an API by providing the API id. + parameters: + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + Requested complexity details returned. + headers: + Content-Type: + description: | + The content of the body. + schema: + type: string + default: application/json + content: + application/json: + schema: + $ref: '#/components/schemas/GraphQLQueryComplexityInfo' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/graphql-policies/complexity"' + operationId: getGraphQLPolicyComplexityOfAPI + + + put: + tags: + - GraphQL Policies + summary: Update Complexity Related Details of an API + description: | + This operation can be used to update complexity details belonging to an API by providing the id of the API. + parameters: + - $ref: '#/components/parameters/apiId' + requestBody: + description: Role-depth mapping that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/GraphQLQueryComplexityInfo' + responses: + 200: + description: | + Created. + Complexity details created successfully. + content: {} + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/graphql-policies/complexity"' + operationId: updateGraphQLPolicyComplexityOfAPI + + /apis/{apiId}/graphql-policies/complexity/types: + get: + tags: + - GraphQL Policies + summary: Retrieve Types and Fields of a GraphQL Schema + description: | + This operation can be used to retrieve all types and fields of the GraphQL Schema by providing the API id. + parameters: + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + Types and fields returned successfully. + headers: + Content-Type: + description: | + The content of the body. + schema: + type: string + default: application/json + content: + application/json: + schema: + $ref: '#/components/schemas/GraphQLSchemaTypeList' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/graphql-policies/complexity/types"' + operationId: getGraphQLPolicyComplexityTypesOfAPI + + /apis/{apiId}/resource-paths: + get: + tags: + - APIs + summary: Get Resource Paths of an API + description: | + This operation can be used to retrieve resource paths defined for a specific api. + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + ResourcePaths returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modified the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ResourcePathList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/resource-paths"' + operationId: getAPIResourcePaths + + /apis/{apiId}/auditapi: + get: + tags: + - API Audit + summary: Retrieve the Security Audit Report of the Audit API + description: | + Retrieve the Security Audit Report of the Audit API + parameters: + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + The Security Audit Report has been returned. + headers: + Content-Type: + description: | + The content of the body. + schema: + type: string + default: application/json + content: + application/json: + schema: + $ref: '#/components/schemas/AuditReport' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/auditapi"' + x-examples: + $ref: "docs/examples/apis/apis_id_auditapi_get.yaml" + operationId: getAuditReportOfAPI + + /apis/{apiId}/external-stores: + get: + tags: + - External Stores + summary: Get the List of External Stores to which an API is Published + description: | + This operation can be used to retrieve a list of external stores which an API is published to by providing the id of the API. + operationId: getAllPublishedExternalStoresByAPI + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + External Store list is returned. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIExternalStoreList' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/external-stores"' + x-examples: + $ref: docs/examples/external-stores/external_stores.yaml#/getPublishedExternalStoresByAPI + + /apis/{apiId}/publish-to-external-stores: + post: + tags: + - External Stores + summary: Publish an API to External Stores + description: | + This operation can be used to publish an API to a list of external stores. + operationId: publishAPIToExternalStores + parameters: + - $ref: '#/components/parameters/apiId' + - name: externalStoreIds + in: query + description: External Store Ids of stores which the API needs to be published + or updated. + required: true + schema: + type: string + - $ref: '#/components/parameters/If-Match' + responses: + 200: + description: | + OK. + API was successfully published to all the selected external stores. + headers: + ETag: + description: | + Entity Tag of the blocked subscription. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the subscription has been blocked. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIExternalStoreList' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/publish-to-external-stores?externalStoreId=Store123#"' + x-examples: + $ref: docs/examples/external-stores/external_stores.yaml#/publishToExternalStore + + /apis/export: + get: + tags: + - Import Export + summary: Export an API + description: | + This operation can be used to export the details of a particular API as a zip file. + parameters: + - name: apiId + in: query + description: UUID of the API + schema: + type: string + - name: name + in: query + description: | + API Name + schema: + type: string + - name: version + in: query + description: | + Version of the API + schema: + type: string + - name: revisionNumber + in: query + description: | + Revision number of the API artifact + schema: + type: string + - name: providerName + in: query + description: | + Provider name of the API + schema: + type: string + - name: format + in: query + description: | + Format of output documents. Can be YAML or JSON. + schema: + type: string + enum: + - JSON + - YAML + - name: preserveStatus + in: query + description: | + Preserve API Status on export + schema: + type: boolean + - name: latestRevision + in: query + description: | + Export the latest revision of the API + schema: + type: boolean + default: false + responses: + 200: + description: | + OK. + Export Successful. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/zip: + schema: + type: string + format: binary + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_create + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/export?apiId=96077508-fd01-4fae-bc64-5de0e2baf43c&name=PizzaShackAPI&version=1.0&provider=admin&format=YAML" + > exportAPI.zip' + operationId: exportAPI + + /apis/import: + post: + tags: + - Import Export + summary: Import an API + description: | + This operation can be used to import an API. + parameters: + - name: preserveProvider + in: query + description: | + Preserve Original Provider of the API. This is the user choice to keep or replace the API provider + required: false + schema: + type: boolean + - name: rotateRevision + in: query + description: | + Once the revision max limit reached, undeploy and delete the earliest revision and create a new revision + required: false + schema: + type: boolean + - name: overwrite + in: query + description: | + Whether to update the API or not. This is used when updating already existing APIs + required: false + schema: + type: boolean + requestBody: + content: + multipart/form-data: + schema: + required: + - file + properties: + file: + type: string + description: Zip archive consisting on exported api configuration + format: binary + responses: + 200: + description: | + Created. + API Imported Successfully. + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@admin-PizzaShackAPI-1.0.0.zip "https://127.0.0.1:9443/api/am/publisher/v2/apis/import?preserveProvider=false&overwrite=false"' + operationId: importAPI + + ###################################################### + # The "Subscription Collection" resource APIs + ###################################################### + /subscriptions: + get: + tags: + - Subscriptions + summary: Get all Subscriptions + description: | + This operation can be used to retrieve a list of subscriptions of the user associated with the provided access token. This operation is capable of + + 1. Retrieving all subscriptions for the user's APIs. + `GET https://127.0.0.1:9443/api/am/publisher/v2/subscriptions` + + 2. Retrieving subscriptions for a specific API. + `GET https://127.0.0.1:9443/api/am/publisher/v2/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed` + parameters: + - $ref: '#/components/parameters/apiId-Q-Opt' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/If-None-Match' + - name: query + in: query + description: | + Keywords to filter subscriptions + schema: + type: string + responses: + 200: + description: | + OK. + Subscription list returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriptionList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:subscription_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions?apiId=96077508-fd01-4fae-bc64-5de0e2baf43c"' + operationId: getSubscriptions + + ###################################################### + # The Individual Subscription resource APIs + ###################################################### + /subscriptions/{subscriptionId}/usage: + get: + tags: + - API Monetization + summary: Get Details of a Pending Invoice for a Monetized Subscription with Metered Billing. + description: | + This operation can be used to get details of a pending invoice for a monetized subscription with meterd billing. + parameters: + - $ref: '#/components/parameters/subscriptionId' + responses: + 200: + description: | + OK. + Details of a pending invoice returned. + headers: + ETag: + description: Entity Tag of the response resource. Used by caches, or + in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: Date and time the resource has been modified the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIMonetizationUsage' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + description: | + Not Found. + Requested Subscription does not exist. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + security: + - OAuth2Security: + - apim:subscription_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809/usage"' + operationId: getSubscriptionUsage + + /subscriptions/{subscriptionId}/subscriber-info: + get: + tags: + - Subscriber + summary: Get Details of a Subscriber + description: | + This operation can be used to get details of a user who subscribed to the API. + parameters: + - $ref: '#/components/parameters/subscriptionId' + responses: + 200: + description: | + OK. + Details of the subscriber are returned. + content: + application/json: + schema: + $ref: '#/components/schemas/SubscriberInfo' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:subscription_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809/subscriber-info"' + operationId: getSubscriberInfoBySubscriptionId + + /subscriptions/block-subscription: + post: + tags: + - Subscriptions + summary: Block a Subscription + description: | + This operation can be used to block a subscription. Along with the request, `blockState` must be specified as a query parameter. + + 1. `BLOCKED` : Subscription is completely blocked for both Production and Sandbox environments. + 2. `PROD_ONLY_BLOCKED` : Subscription is blocked for Production environment only. + parameters: + - $ref: '#/components/parameters/subscriptionId-Q' + - name: blockState + in: query + description: | + Subscription block state. + required: true + schema: + type: string + enum: + - BLOCKED + - PROD_ONLY_BLOCKED + - $ref: '#/components/parameters/If-Match' + responses: + 200: + description: | + OK. + Subscription was blocked successfully. + headers: + ETag: + description: | + Entity Tag of the blocked subscription. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the subscription has been blocked. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:subscription_block + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED"' + operationId: blockSubscription + + /subscriptions/unblock-subscription: + post: + tags: + - Subscriptions + summary: Unblock a Subscription + description: | + This operation can be used to unblock a subscription specifying the subscription Id. The subscription will be fully unblocked after performing this operation. + parameters: + - $ref: '#/components/parameters/subscriptionId-Q' + - $ref: '#/components/parameters/If-Match' + responses: + 200: + description: | + OK. + Subscription was unblocked successfully. + headers: + ETag: + description: | + Entity Tag of the unblocked subscription. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the subscription has been unblocked. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:subscription_block + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809"' + operationId: unBlockSubscription + + + ###################################################### + # The "Thorttling Tier Collection" resource APIs + ###################################################### + /throttling-policies/{policyLevel}: + get: + tags: + - Throttling Policies + summary: Get All Throttling Policies for the Given Type + description: | + This operation can be used to list the available policies for a given policy level. Tier level should be specified as a path parameter and should be one of `subscription` and `api`. + `subscription` is for Subscription Level policies and `api` is for Resource Level policies + operationId: getAllThrottlingPolicies + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/policyLevel' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + List of policies returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ThrottlingPolicyList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api"' + + ###################################################### + # The "Subscription Throttling Based on Quota Type" resource APIs + ###################################################### + /throttling-policies/streaming/subscription: + get: + tags: + - Throttling Policies + summary: Get subscription throttling policies based on quota type + description: | + This operation can be used to list the available subscription policies for a given tenent ID based on the given quota type. + Quota Type should be provide as a query parameters and supported Quota types are "requestCount" ,"bandwidthVolume" and "eventCount" + operationId: getSubscriptionThrottlingPolicies + parameters: + - $ref: '#/components/parameters/tierQuotaType' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + List of subscription policies returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ThrottlingPolicyList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/subscription?tierQuotaType=RequestCountLimit"' + + ###################################################### + # The "Individual Throttling Tier" resource APIs + ###################################################### + /throttling-policies/{policyLevel}/{policyName}: + get: + tags: + - Throttling Policies + summary: Get Details of a Policy + description: | + This operation can be used to retrieve details of a single policy by specifying the policy level and policy name. + operationId: getThrottlingPolicyByName + parameters: + - $ref: '#/components/parameters/policyName' + - $ref: '#/components/parameters/policyLevel' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Tier returned + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ThrottlingPolicy' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api/Platinum"' + + ###################################################### + # The "Mediation Policy Collection" resource APIs + ###################################################### + /mediation-policies: + get: + tags: + - Global Mediation Policies + summary: | + Get all global level mediation policies + description: | + This operation provides you a list of available all global level mediation policies. + operationId: getAllGlobalMediationPolicies + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: query + in: query + description: -Not supported yet- + schema: + type: string + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + List of mediation policies is returned. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/MediationList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + - apim:mediation_policy_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/mediation-policies"' + x-examples: + $ref: docs/examples/mediation-policies/mediation_policies_get.yaml + + ################################################################### + # The "Individual Mediation Policy" resource + ################################################################### + /mediation-policies/{mediationPolicyId}/content: + get: + tags: + - Global Mediation Policy + summary: Download a Global Mediation Policy + description: | + This operation can be used to download a particular global mediation policy. + operationId: getGlobalMediationPolicyContent + parameters: + - $ref: '#/components/parameters/mediationPolicyId' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Mediation policy returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_view + - apim:mediation_policy_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/mediation-policies/d48a3412-1b85-49be-99f4-b81a3722ae73/content" + > mediation.xml' + + /apis/{apiId}/client-certificates: + get: + tags: + - Client Certificates + summary: Retrieve/ Search Uploaded Client Certificates + description: | + This operation can be used to retrieve and search the uploaded client certificates. + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: alias + in: query + description: Alias for the client certificate + schema: + type: string + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. Successful response with the list of matching certificate information in the body. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ClientCertificates' + 400: + $ref: '#/components/responses/BadRequest' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + - apim:client_certificates_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates?alias=wso2carbon"' + operationId: getAPIClientCertificates + + post: + tags: + - Client Certificates + summary: Upload a New Certificate + description: | + This operation can be used to upload a new certificate for an endpoint. + parameters: + - $ref: '#/components/parameters/apiId' + requestBody: + content: + multipart/form-data: + schema: + required: + - alias + - certificate + - tier + properties: + certificate: + type: string + description: The certificate that needs to be uploaded. + format: binary + alias: + maxLength: 30 + minLength: 1 + type: string + description: Alias for the certificate + tier: + type: string + description: api tier to which the certificate should be applied. + required: true + responses: + 200: + description: | + OK. + The Certificate added successfully. + headers: + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ClientCertMetadata' + 400: + $ref: '#/components/responses/BadRequest' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + - apim:client_certificates_add + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon + -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates"' + operationId: addAPIClientCertificate + + /apis/{apiId}/client-certificates/{alias}: + get: + tags: + - Client Certificates + summary: Get the Certificate Information + description: | + This operation can be used to get the information about a certificate. + parameters: + - name: alias + in: path + required: true + schema: + type: string + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateInfo' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + - apim:client_certificates_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' + operationId: getAPIClientCertificateByAlias + + put: + tags: + - Client Certificates + summary: Update a Certificate + description: | + This operation can be used to update an uploaded certificate. + parameters: + - name: alias + in: path + description: Alias for the certificate + required: true + schema: + maxLength: 30 + minLength: 1 + type: string + - $ref: '#/components/parameters/apiId' + requestBody: + content: + multipart/form-data: + schema: + properties: + certificate: + type: string + description: The certificate that needs to be uploaded. + format: binary + tier: + type: string + description: The tier of the certificate + responses: + 200: + description: | + OK. + The Certificate updated successfully. + headers: + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ClientCertMetadata' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + - apim:client_certificates_update + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon + -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' + operationId: updateAPIClientCertificateByAlias + + delete: + tags: + - Client Certificates + summary: Delete a Certificate + description: | + This operation can be used to delete an uploaded certificate. + parameters: + - name: alias + in: path + description: | + The alias of the certificate that should be deleted. + required: true + schema: + type: string + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. + The Certificate deleted successfully. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + - apim:client_certificates_update + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' + operationId: deleteAPIClientCertificateByAlias + + /apis/{apiId}/client-certificates/{alias}/content: + get: + tags: + - Client Certificates + summary: Download a Certificate + description: | + This operation can be used to download a certificate which matches the given alias. + parameters: + - $ref: '#/components/parameters/apiId' + - name: alias + in: path + required: true + schema: + type: string + responses: + 200: + description: | + OK. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + - apim:client_certificates_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon/content"' + operationId: getAPIClientCertificateContentByAlias + + ###################################################### + # The "Certificate Management" resource APIs + ###################################################### + /endpoint-certificates: + get: + tags: + - Endpoint Certificates + summary: Retrieve/Search Uploaded Certificates + description: | + This operation can be used to retrieve and search the uploaded certificates. + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: alias + in: query + description: Alias for the certificate + schema: + maxLength: 30 + type: string + - name: endpoint + in: query + description: Endpoint of which the certificate is uploaded + schema: + type: string + responses: + 200: + description: | + OK. Successful response with the list of matching certificate information in the body. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Certificates' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + - apim:ep_certificates_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/endpoint-certificates?alias=wso2carbon&endpoint=www.abc.com"' + operationId: getEndpointCertificates + + post: + tags: + - Endpoint Certificates + summary: Upload a new Certificate. + description: | + This operation can be used to upload a new certificate for an endpoint. + requestBody: + content: + multipart/form-data: + schema: + required: + - alias + - certificate + - endpoint + properties: + certificate: + type: string + description: The certificate that needs to be uploaded. + format: binary + alias: + maxLength: 30 + minLength: 1 + type: string + description: Alias for the certificate + endpoint: + type: string + description: Endpoint to which the certificate should be applied. + required: true + responses: + 200: + description: | + OK. + The Certificate added successfully. + headers: + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/CertMetadata' + 400: + $ref: '#/components/responses/BadRequest' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + - apim:ep_certificates_add + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=alias + -F "endpoint=endpoint=https://www.abc.com" "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/endpoint-certificates"' + operationId: addEndpointCertificate + + /endpoint-certificates/{alias}: + get: + tags: + - Endpoint Certificates + summary: Get the Certificate Information + description: | + This operation can be used to get the information about a certificate. + parameters: + - name: alias + in: path + required: true + schema: + type: string + responses: + 200: + description: | + OK. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/CertificateInfo' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + - apim:ep_certificates_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/endpoint-certificates/wso2carbon"' + operationId: getEndpointCertificateByAlias + + put: + tags: + - Endpoint Certificates + summary: Update a certificate. + description: | + This operation can be used to update an uploaded certificate. + parameters: + - name: alias + in: path + description: Alias for the certificate + required: true + schema: + maxLength: 30 + minLength: 1 + type: string + requestBody: + content: + multipart/form-data: + schema: + required: + - certificate + properties: + certificate: + type: string + description: The certificate that needs to be uploaded. + format: binary + required: true + responses: + 200: + description: | + OK. + The Certificate updated successfully. + headers: + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/CertMetadata' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + - apim:ep_certificates_update + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F certificate=@test.crt "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/endpoint-certificates/wso2carbon"' + operationId: updateEndpointCertificateByAlias + + delete: + tags: + - Endpoint Certificates + summary: Delete a certificate. + description: | + This operation can be used to delete an uploaded certificate. + parameters: + - name: alias + in: path + description: | + The alias of the certificate that should be deleted. + required: true + schema: + type: string + responses: + 200: + description: | + OK. + The Certificate deleted successfully. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_create + - apim:ep_certificates_update + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/endpoint-certificates/wso2carbon"' + operationId: deleteEndpointCertificateByAlias + + /endpoint-certificates/{alias}/content: + get: + tags: + - Endpoint Certificates + summary: Download a Certificate + description: | + This operation can be used to download a certificate which matches the given alias. + parameters: + - name: alias + in: path + required: true + schema: + type: string + responses: + 200: + description: | + OK. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + - apim:ep_certificates_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/endpoint-certificates/wso2carbon/content"' + operationId: getEndpointCertificateContentByAlias + + ###################################################### + # The "Content Search Results" resource APIs + ###################################################### + /search: + get: + tags: + - Unified Search + summary: | + Retrieve/Search APIs and API Documents by Content + description: | + This operation provides you a list of available APIs and API Documents qualifying the given keyword match. + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: query + in: query + description: | + **Search**. + + You can search by proving a keyword. + schema: + type: string + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + List of qualifying APIs and API documents is returned. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/SearchResultList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + - apim:api_import_export + - apim:api_product_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/search?query=pizza"' + x-examples: + $ref: docs/examples/apis/search_get.yaml + operationId: search + + ###################################################### + # The "API Product Collection" resource APIs + ###################################################### + /api-products: + get: + tags: + - API Products + summary: | + Retrieve/Search API Products + description: | + This operation provides you a list of available API Products qualifying under a given search condition. + + Each retrieved API Product is represented with a minimal amount of attributes. If you want to get complete details of an API Product, you need to use **Get details of an API Product** operation. + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - name: query + in: query + schema: + type: string + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + List of qualifying API Products is returned. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIProductList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products?query=PizzaAPIProduct"' + operationId: getAllAPIProducts + + post: + tags: + - API Products + summary: Create a New API Product + description: | + This operation can be used to create a new API Product specifying the details of the API Product in the payload. + requestBody: + description: API object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/APIProduct' + required: true + responses: + 201: + description: | + 'Created. + Successful response with the newly created object as entity in the body. + Location header contains URL of newly created entity.' + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIProduct' + 400: + $ref: '#/components/responses/BadRequest' + 415: + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/api-products"' + operationId: createAPIProduct + + ################################################################ + # The "Individual API Product" resource APIs + ################################################################ + /api-products/{apiProductId}: + get: + tags: + - API Products + summary: Get Details of an API Product + description: | + Using this operation, you can retrieve complete details of a single API Product. You need to provide the Id of the API to retrive it. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Requested API Product is returned + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIProduct' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33"' + operationId: getAPIProduct + + put: + tags: + - API Products + summary: Update an API Product + description: | + This operation can be used to update an existing API product. + But the properties `name`, `provider` and `version` cannot be changed. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/If-Match' + requestBody: + description: API object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/APIProduct' + required: true + responses: + 200: + description: | + OK. + Successful response with updated API product object + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIProduct' + 400: + $ref: '#/components/responses/BadRequest' + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33"' + operationId: updateAPIProduct + + + delete: + tags: + - API Products + summary: Delete an API Product + description: | + This operation can be used to delete an existing API Product proving the Id of the API Product. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/If-Match' + responses: + 200: + description: | + OK. + Resource successfully deleted. + content: {} + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_product_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33"' + operationId: deleteAPIProduct + + /api-products/{apiProductId}/thumbnail: + get: + tags: + - API Products + summary: Get Thumbnail Image + description: | + This operation can be used to download a thumbnail image of an API product. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Thumbnail image returned + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/thumbnail" + > image.jpeg' + operationId: getAPIProductThumbnail + + put: + tags: + - API Products + summary: Upload a Thumbnail Image + description: | + This operation can be used to upload a thumbnail image of an API Product. The thumbnail to be uploaded should be given as a form data parameter `file`. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + required: + - file + properties: + file: + type: string + description: Image to upload + format: binary + required: true + responses: + 200: + description: | + OK. + Image updated + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the uploaded thumbnail image of the API Product. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/FileInfo' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F file=@image.jpeg "https://127.0.0.1:9443/api/am/publisher/v2/api-products/d48a3412-1b85-49be-99f4-b81a3722ae73/thumbnail"' + operationId: updateAPIProductThumbnail + + /api-products/{apiProductId}/swagger: + get: + tags: + - API Products + summary: Get Swagger Definition + description: | + This operation can be used to retrieve the swagger definition of an API. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Requested swagger document of the API is returned + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/swagger"' + operationId: getAPIProductSwagger + + /api-products/{apiProductId}/is-outdated: + get: + tags: + - API Products + summary: Check Whether API Product is Outdated + description: | + This operation can be used to retrieve the status indicating if an API Product is outdated due to updating of dependent APIs (This resource is not supported at the moment) + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Requested swagger document of the API is returned + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/APIProductOutdatedStatus' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_publish + operationId: getIsAPIProductOutdated + + /api-products/{apiProductId}/documents: + get: + tags: + - API Product Documents + summary: Get a List of Documents of an API Product + description: | + This operation can be used to retrive a list of documents belonging to an API Product by providing the id of the API Product. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Document list is returned. + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/DocumentList' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents"' + operationId: getAPIProductDocuments + + post: + tags: + - API Product Documents + summary: Add a New Document to an API Product + description: | + This operation can be used to add a new documentation to an API Product. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API Product document ** API once we obtain a document Id by this operation. + parameters: + - $ref: '#/components/parameters/apiProductId' + requestBody: + description: Document object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + required: true + responses: + 201: + description: | + Created. + Successful response with the newly created Document object as entity in the body. + Location header contains URL of newly added document. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + Location to the newly created Document. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + 400: + $ref: '#/components/responses/BadRequest' + 415: + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents"' + operationId: addAPIProductDocument + + /api-products/{apiProductId}/documents/{documentId}: + get: + tags: + - API Product Documents + summary: Get a Document of an API Product + description: | + This operation can be used to retrieve a particular document's metadata associated with an API. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Document returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3"' + operationId: getAPIProductDocument + + put: + tags: + - API Product Documents + summary: Update a Document of an API Product + description: | + This operation can be used to update metadata of an API's document. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/If-Match' + requestBody: + description: Document object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + required: true + responses: + 200: + description: | + OK. + Document updated + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the updated document. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3"' + operationId: updateAPIProductDocument + + delete: + tags: + - API Product Documents + summary: Delete a Document of an API Product + description: | + This operation can be used to delete a document associated with an API Product. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/If-Match' + responses: + 200: + description: | + OK. + Resource successfully deleted. + content: {} + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3"' + operationId: deleteAPIProductDocument + + /api-products/{apiProductId}/documents/{documentId}/content: + get: + tags: + - API Product Documents + summary: Get the Content of an API Product Document + description: | + This operation can be used to retrive the content of an API's document. + + The document can be of 3 types. In each cases responses are different. + + 1. **Inline type**: + The content of the document will be retrieved in `text/plain` content type + + _Sample cURL_ : `curl -k -H "Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51" -F inlineContent=@"docs.txt" -X POST "https://localhost:9443/api/am/publisher/v2/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` + 2. **FILE type**: + The file will be downloaded with the related content type (eg. `application/pdf`) + 3. **URL type**: + The client will recieve the URL of the document as the Location header with the response with - `303 See Other` + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/Accept' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + File or inline content returned. + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 303: + description: | + See Other. + Source can be retrived from the URL specified at the Location header. + headers: + Location: + description: | + The Source URL of the document. + schema: + type: string + content: {} + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: {} + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3/content"' + operationId: getAPIProductDocumentContent + + post: + tags: + - API Product Documents + summary: Upload the Content of an API Product Document + description: | + Thid operation can be used to upload a file or add inline content to an API Product document. + + **IMPORTANT:** + * Either **file** or **inlineContent** form data parameters should be specified at one time. + * Document's source type should be **FILE** in order to upload a file to the document using **file** parameter. + * Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter. + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/documentId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + properties: + file: + type: string + description: Document to upload + format: binary + inlineContent: + type: string + description: Inline content of the document + responses: + 200: + description: | + OK. + Document updated + headers: + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the updated content of the document. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Document' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: multipart/form-data" -F file=@sample.pdf "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3/content"' + operationId: addAPIProductDocumentContent + + ###################################################### + # The "API Product Revisions" resource API + ###################################################### + /api-products/{apiProductId}/revisions: + + #-------------------------------------------- + # List available revisions of an API Product + #-------------------------------------------- + get: + tags: + - API Product Revisions + summary: List available revisions of an API Product + description: | + List available revisions of an API Product + operationId: getAPIProductRevisions + parameters: + - $ref: '#/components/parameters/apiProductId' + - name: query + in: query + schema: + type: string + responses: + 200: + description: | + OK. + List of API Product revisions are returned. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionList' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_product_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"' + + #-------------------------------------------- + # Create a new API Product revision + #-------------------------------------------- + post: + tags: + - API Product Revisions + summary: Create a new API Product revision + description: | + Create a new API Product revision + operationId: createAPIProductRevision + parameters: + - $ref: '#/components/parameters/apiProductId' + requestBody: + description: API Product object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevision' + responses: + 201: + description: | + Created. + Successful response with the newly created APIRevision object as the entity in the body. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevision' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"' + + ###################################################### + # The "API Revisions" individual resource API Product + ###################################################### + /api-products/{apiProductId}/revisions/{revisionId}: + + #-------------------------------------------- + # Get a revision + #-------------------------------------------- + get: + tags: + - API Product Revisions + summary: Retrieve a revision of an API Product + description: | + Retrieve a revision of an API Product + operationId: getAPIProductRevision + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/revisionId' + responses: + 200: + description: | + OK. + An API revision is returned. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevision' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' + + #-------------------------------------------- + # Delete a revision + #-------------------------------------------- + delete: + tags: + - API Product Revisions + summary: Delete a revision of an API Product + description: | + Delete a revision of an API Product + operationId: deleteAPIProductRevision + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/revisionId' + responses: + 200: + description: | + OK. + List of remaining API revisions are returned. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionList' + 204: + description: | + No Content. + Successfully deleted the revision + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' + + /api-products/{apiProductId}/deploy-revision: + + #-------------------------------------------- + # List available deployed revision deployment details of an API Product + #-------------------------------------------- + get: + tags: + - API Product Revisions + summary: List available deployed revision deployment details of an API Product + description: | + List available deployed revision deployment details of an API Product + operationId: getAPIProductRevisionDeployments + parameters: + - $ref: '#/components/parameters/apiProductId' + responses: + 200: + description: | + OK. + List of deployed revision deployment details are returned. + content: + application/json: + schema: + $ref: '#/components/schemas/APIRevisionDeploymentList' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"' + + #-------------------------------------------- + # Deploy a revision + #-------------------------------------------- + post: + tags: + - API Product Revisions + summary: Deploy a revision + description: | + Deploy a revision + operationId: deployAPIProductRevision + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/revisionId-Q' + requestBody: + description: Deployment object that needs to be added + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' + responses: + 200: + description: | + OK. + 201: + description: | + Created. + Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + + /api-products/{apiProductId}/undeploy-revision: + #-------------------------------------------- + # Un-Deploy a revision from deployed gateway + #-------------------------------------------- + post: + tags: + - API Product Revisions + summary: Un-Deploy a revision + description: | + Un-Deploy a revision + operationId: undeployAPIProductRevision + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/revisionId-Q' + - $ref: '#/components/parameters/revisionNum-Q' + - name: allEnvironments + in: query + schema: + type: boolean + default: false + requestBody: + description: Deployment object that needs to be added + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' + responses: + 200: + description: | + OK. + 201: + description: | + Created. + Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + - apim:api_product_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + + /api-products/{apiProductId}/restore-revision: + + #-------------------------------------------------------- + # Restore a revision to the working copy of the API Product + #-------------------------------------------------------- + post: + tags: + - API Product Revisions + summary: Restore a revision + description: | + Restore a revision to the working copy of the API Product + operationId: restoreAPIProductRevision + parameters: + - $ref: '#/components/parameters/apiProductId' + - $ref: '#/components/parameters/revisionId-Q' + responses: + 201: + description: | + Restored. + Successful response with the newly restored API Product object as the entity in the body. + content: + application/json: + schema: + $ref: '#/components/schemas/APIProduct' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' + + /api-products/export: + get: + tags: + - Import Export + summary: Export an API Product + description: | + This operation can be used to export the details of a particular API Product as a zip file. + parameters: + - name: name + in: query + description: | + API Product Name + schema: + type: string + - name: version + in: query + description: | + Version of the API Product + schema: + type: string + - name: providerName + in: query + description: | + Provider name of the API Product + schema: + type: string + - name: revisionNumber + in: query + description: | + Revision number of the API Product + schema: + type: string + - name: format + in: query + description: | + Format of output documents. Can be YAML or JSON. + schema: + type: string + enum: + - JSON + - YAML + - name: preserveStatus + in: query + description: | + Preserve API Product Status on export + schema: + type: boolean + - name: latestRevision + in: query + description: | + Export the latest revision of the API Product + schema: + type: boolean + default: false + responses: + 200: + description: | + OK. + Export Successful. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/zip: + schema: + type: string + format: binary + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-products/export?name=LeasingAPIProduct&version=1.0.0&revisionNumber=2&provider=admin&format=YAML" + > exportAPIProduct.zip' + operationId: exportAPIProduct + + /api-products/import: + post: + tags: + - Import Export + summary: Import an API Product + description: | + This operation can be used to import an API Product. + parameters: + - name: preserveProvider + in: query + description: | + Preserve Original Provider of the API Product. This is the user choice to keep or replace the API Product provider + required: false + schema: + type: boolean + - name: rotateRevision + in: query + description: | + Once the revision max limit reached, undeploy and delete the earliest revision and create a new revision + required: false + schema: + type: boolean + - name: importAPIs + in: query + description: | + Whether to import the dependent APIs or not. + schema: + type: boolean + - name: overwriteAPIProduct + in: query + description: | + Whether to update the API Product or not. This is used when updating already existing API Products. + schema: + type: boolean + - name: overwriteAPIs + in: query + description: | + Whether to update the dependent APIs or not. This is used when updating already existing dependent APIs of an API Product. + schema: + type: boolean + requestBody: + content: + multipart/form-data: + schema: + required: + - file + properties: + file: + type: string + description: | + Zip archive consisting on exported API Product configuration + format: binary + responses: + 200: + description: | + Created. + API Product Imported Successfully. + content: {} + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 409: + $ref: '#/components/responses/Conflict' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_product_import_export + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -F file=@admin-PizzaShackAPIProduct.zip "https://127.0.0.1:9443/api/am/admin/v2/api-products/importt?preserveProvider=false&overwriteAPIProduct=false&overwriteAPIs=false&importAPIs=false"' + operationId: importAPIProduct + + ###################################################### + # Roles resource APIs + ###################################################### + /roles/{roleId}: + head: + tags: + - Roles + summary: Check Whether Given Role Name already Exist + description: | + Using this operation, user can check a given role name exists or not. + operationId: validateSystemRole + parameters: + - $ref: '#/components/parameters/roleId' + responses: + 200: + description: OK. Requested role name exists. + content: {} + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/roles/SW50ZXJuYWwvcHVibGlzaGVyCQ"' + + /me/roles/{roleId}: + head: + tags: + - Roles + summary: Validate Whether the Logged-in User has the Given Role + description: | + Using this operation, logged-in user can check whether he has given role. + operationId: validateUserRole + parameters: + - $ref: '#/components/parameters/roleId' + responses: + 200: + description: OK. Requested user has the role. + content: {} + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/me/roles/SW50ZXJuYWwvcHVibGlzaGVyCQ"' + + ###################################################### + # The "ExternalStore Collection" resource APIs + ###################################################### + /external-stores: + get: + tags: + - External Stores + summary: Retrieve External Stores List to Publish an API + description: | + Retrieve external stores list configured to publish an API + operationId: getAllExternalStores + responses: + 200: + description: | + OK. + External Stores list returned + content: + application/json: + schema: + $ref: '#/components/schemas/ExternalStore' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/external-stores"' + + ###################################################### + # The Publisher settings resource APIs + ###################################################### + /settings: + get: + tags: + - Settings + summary: Retreive Publisher Settings + description: | + Retreive publisher settings + responses: + 200: + description: | + OK. + Settings returned + content: + application/json: + schema: + $ref: '#/components/schemas/Settings' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:publisher_settings + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/settings"' + operationId: getSettings + + ###################################################### + # The tenant resource APIs + ###################################################### + /tenants: + get: + tags: + - Tenants + summary: | + Get Tenants by State + description: | + This operation is to get tenants by state + operationId: getTenantsByState + parameters: + - name: state + in: query + description: | + The state represents the current state of the tenant + + Supported states are [active, inactive] + schema: + type: string + default: active + enum: + - active + - inactive + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + 200: + description: | + OK. + Tenant names returned. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/TenantList' + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/tenants?state=active"' + + /tenants/{tenantDomain}: + head: + tags: + - Tenants + summary: Check Whether the Given Tenant already Exists + description: | + Using this operation, user can check whether a given tenant exists or not. + operationId: getTenantExistence + parameters: + - $ref: '#/components/parameters/tenantDomain' + responses: + 200: + description: OK. Requested tenant exists. + content: {} + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/tenants/wso2.com"' + x-examples: + $ref: docs/examples/tenants/tenants.yaml + + #################################################### + # Publisher Alerts management REST API + #################################################### + /alert-types: + get: + tags: + - Alerts + summary: | + Get the list of API Publisher alert types. + description: | + This operation is used to get the list of supportd alert types for the 'publisher' agent. + operationId: getPublisherAlertTypes + responses: + 200: + description: | + OK. + The list of publisher alert types are returned. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AlertTypesList' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:pub_alert_manage + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/alert-types"' + x-examples: + $ref: docs/examples/alerts/alerts.yaml#/get + + /alert-subscriptions: + get: + tags: + - Alert Subscriptions + summary: | + Get the List of API Publisher Alert Types Subscribed by the User + description: | + This operation is used to get the list of subscribed alert types by the user. + operationId: getSubscribedAlertTypes + responses: + 200: + description: | + OK. + The list of subscribed alert types are returned. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AlertsInfo' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:pub_alert_manage + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' + x-examples: + $ref: docs/examples/alerts/alerts_subscriptions.yaml#/get + + put: + tags: + - Alert Subscriptions + summary: | + Subscribe to the Selected Tlert types by the User + description: | + This operation is used to get the list of subscribed alert types by the user. + operationId: subscribeToAlerts + requestBody: + description: The alerts list and the email list to subscribe. + content: + application/json: + schema: + $ref: '#/components/schemas/AlertsInfo' + required: true + responses: + 201: + description: | + OK. + Successful response with the newly subscribed alerts. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AlertsInfoResponse' + 400: + $ref: '#/components/responses/BadRequest' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:pub_alert_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' + x-examples: + $ref: docs/examples/alerts/alerts_subscriptions.yaml#/put + + delete: + tags: + - Alert Subscriptions + summary: | + Unsubscribe User from All the Alert Types + description: | + This operation is used to unsubscribe the respective user from all the alert types. + operationId: unsubscribeAllAlerts + responses: + 200: + description: | + OK. + The user is unsubscribed from the alerts successfully. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: {} + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:pub_alert_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' + x-examples: + $ref: docs/examples/alerts/alerts_subscriptions.yaml#/delete + + /alerts/{alertType}/configurations: + get: + tags: + - Alert Configuration + summary: | + Get All AbnormalRequestsPerMin Alert Configurations + description: | + This operation is used to get all configurations of the AbnormalRequestsPerMin alert type. + operationId: getAllAlertConfigs + parameters: + - $ref: '#/components/parameters/alertType' + responses: + 200: + description: | + OK. + The Developer Portal alert configuration. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AlertConfigList' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:pub_alert_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/alerts/{alertType}/configurations"' + x-examples: + $ref: docs/examples/alerts/alerts_config.yaml#/get + + /alerts/{alertType}/configurations/{configurationId}: + put: + tags: + - Alert Configuration + summary: | + Add AbnormalRequestsPerMin Alert Configurations. + description: | + This operation is used to add configuration for the AbnormalRequestsPerMin alert type. + operationId: addAlertConfig + parameters: + - $ref: '#/components/parameters/alertType' + - $ref: '#/components/parameters/configurationId' + requestBody: + description: Configuration for AbnormalRequestCount alert type + content: + application/json: + schema: + $ref: '#/components/schemas/AlertConfigInfo' + required: true + responses: + 201: + description: | + Created. + Successful response with newly created object as entity. + Location header contains URL of newly created entity. + headers: + Location: + description: | + The location of the newly created entity. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AlertConfig' + 400: + $ref: '#/components/responses/BadRequest' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:pub_alert_manage + x-examples: + $ref: docs/examples/alerts/alerts_config.yaml#/put + + delete: + tags: + - Alert Configuration + summary: | + Delete the Selected Configuration from AbnormalRequestsPerMin Alert Type. + description: | + This operation is used to delete configuration from the AbnormalRequestsPerMin alert type. + operationId: deleteAlertConfig + parameters: + - $ref: '#/components/parameters/alertType' + - $ref: '#/components/parameters/configurationId' + responses: + 200: + description: | + OK. + The alert config is deleted successfully. + content: {} + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:pub_alert_manage + x-examples: + $ref: docs/examples/alerts/alerts_config.yaml#/delete + + ###################################################### + # The "Label Collection" resource API + ###################################################### + /labels: + get: + tags: + - Label Collection + summary: Get all Registered Labels + description: | + Get all registered Labels + responses: + 200: + description: | + OK. + Labels returned + content: + application/json: + schema: + $ref: '#/components/schemas/LabelList' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/labels"' + operationId: getLabels + + ###################################################### + # The "API Category Collection" resource API + ###################################################### + /api-categories: + get: + tags: + - API Category (Collection) + summary: Get all API categories + description: | + Get all API categories + responses: + 200: + description: | + OK. + Categories returned + content: + application/json: + schema: + $ref: '#/components/schemas/APICategoryList' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/api-categories"' + operationId: getAllAPICategories + + ###################################################### + # The "Scopes" resource APIs + ###################################################### + /scopes: + get: + tags: + - Scopes + summary: Get All Available Shared Scopes + description: | + This operation can be used to get all the available Shared Scopes. + operationId: getSharedScopes + parameters: + - $ref: '#/components/parameters/limit' + - $ref: '#/components/parameters/offset' + responses: + 200: + description: | + OK. + Shared Scope list is returned. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/ScopeList' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/scopes"' + + post: + tags: + - Scopes + summary: Add a New Shared Scope + description: | + This operation can be used to add a new Shared Scope. + operationId: addSharedScope + requestBody: + description: Scope object that needs to be added + content: + application/json: + schema: + $ref: '#/components/schemas/Scope' + required: true + responses: + 201: + description: | + Created. + Successful response with the newly created Scope object as an entity in the body. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Scope' + 400: + $ref: '#/components/responses/BadRequest' + 415: + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:shared_scope_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/scopes"' + + /scopes/{scopeId}: + get: + tags: + - Scopes + summary: Get a Shared Scope by Scope Id + description: | + This operation can be used to retrieve details of a Shared Scope by a given scope Id. + operationId: getSharedScope + parameters: + - $ref: '#/components/parameters/scopeId' + responses: + 200: + description: | + OK. + Requested Shared Scope is returned. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Scope' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901"' + + put: + tags: + - Scopes + summary: Update a Shared Scope + description: | + This operation can be used to update a Shared Scope by a given scope Id. + operationId: updateSharedScope + parameters: + - $ref: '#/components/parameters/scopeId' + requestBody: + description: Scope object that needs to be updated + content: + application/json: + schema: + $ref: '#/components/schemas/Scope' + required: true + responses: + 200: + description: | + OK. + Successful response with updated Scope object + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/Scope' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:shared_scope_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901"' + + delete: + tags: + - Scopes + summary: Delete a Shared Scope + description: | + This operation can be used to delete a Shared Scope proving the Id of the scope. + operationId: deleteSharedScope + parameters: + - $ref: '#/components/parameters/scopeId' + responses: + 200: + description: | + OK. + Resource successfully deleted. + content: {} + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:shared_scope_manage + x-code-samples: + - lang: Curl + source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901"' + + head: + tags: + - Scopes + summary: Check Given Scope Name already Exists + description: | + Using this operation, user can check a given scope name exists or not. + operationId: validateScope + parameters: + - $ref: '#/components/parameters/scopeName' + responses: + 200: + description: OK. Requested scope name exists. + content: {} + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + - apim:api_publish + x-code-samples: + - lang: Curl + source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/scopes/YXBpbTphcGlfdmlldw"' + + /scopes/{scopeId}/usage: + get: + tags: + - Scopes + summary: Get usages of a Shared Scope by Scope Id + description: | + This operation can be used to retrieve usages of a Shared Scope by a given scope Id. + operationId: getSharedScopeUsages + parameters: + - $ref: '#/components/parameters/scopeId' + responses: + 200: + description: | + OK. + Usages of the shared scope is returned. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/SharedScopeUsage' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901/usage"' + + ###################################################### + # The "Key Managers Collection" resource API + ###################################################### + /key-managers: + get: + tags: + - Key Managers (Collection) + summary: Get All Key Managers + description: | + Get all Key managers + responses: + 200: + description: | + OK. + Categories returned + content: + application/json: + schema: + $ref: '#/components/schemas/KeyManagerList' + security: + - OAuth2Security: + - apim:api_create + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/key-managers"' + operationId: getAllKeyManagers + + ###################################################### + # The "Deployments" resource APIs + ###################################################### + /deployments: + get: + tags: + - Deployments + summary: Retrieve Deployment Environments Details + description: | + This operation can be used to retrieve cloud clusters information defines in tenant-conf.json file. + + With that you can deploy an API to selected cloud environments. + operationId: deploymentsGet + responses: + 200: + description: | + OK. Successful response with the list of deployment environments information in the body. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/DeploymentList' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/deployments"' + + /apis/{apiId}/deployments: + get: + tags: + - DeploymentStatus + summary: Retrieve Deployment Status Details + description: | + This operation can be used to retrieve the status of deployments in cloud clusters. + + With that you can get the status of the deployed APIs in cloud environments. + operationId: deploymentsGetStatus + parameters: + - $ref: '#/components/parameters/apiId' + responses: + 200: + description: | + OK. Successful response with the list of deployment environments information in the body. + headers: + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/DeploymentStatusList' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + 500: + $ref: '#/components/responses/InternalServerError' + security: + - OAuth2Security: + - apim:api_view + x-code-samples: + - lang: Curl + source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" + "https://127.0.0.1:9443/api/am/publisher/v2/apis/92bc1330-1848-4fe8-b992-c792186c212e/deployments/"' + + /apis/validate-asyncapi: + post: + tags: + - Validation + summary: Validate an AsyncAPI Specification + description: + This operation can be used to validate and AsyncAPI Specification and retrieve a summary. Provide either 'url' + or 'file' to specify the definition. + operationId: validateAsyncAPISpecification + parameters: + - name: returnContent + in: query + description: + Specify whether to return the full content of the AsyncAPI specification in the response. This is only + applicable when using url based validation + schema: + type: boolean + default: false + requestBody: + content: + multipart/form-data: + schema: + properties: + url: + type: string + description: AsyncAPI definition url + file: + type: string + description: AsyncAPI definition as a file + format: binary + responses: + 200: + description: + OK. + API definition validation information is returned + headers: + Content-Type: + description: + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/AsyncAPISpecificationValidationResponse' + 400: + $ref: '#/components/responses/BadRequest' + 404: + $ref: '#/components/responses/NotFound' + security: + - OAuth2Security: + - apim:api_create + + /apis/import-asyncapi: + post: + tags: + - APIs + summary: import an AsyncAPI Specification + description: + This operation can be used to create and API from the AsyncAPI Specification. Provide either 'url' or 'file' + to specify the definition. + + Specify additionalProperties with **at least** API's name, version, context and endpointConfig. + operationId: importAsyncAPISpecification + requestBody: + content: + multipart/form-data: + schema: + properties: + file: + type: string + description: Definition to upload as a file + format: binary + url: + type: string + description: Definition url + additionalProperties: + type: string + description: Additional attributes specified as a stringified JSON with API's schema + responses: + 201: + description: + Created. Successful response with the newly created object as entity in the body. + Location header contains URL of newly created entity. + headers: + Etag: + description: + Entity Tag of the respons resource. Used by caches, or in conditional requests (Will be supported in the future). + schema: + type: string + Location: + description: + The URL of the newly created resource. + schema: + type: string + Content-type: + description: + The content type of the body. + schema: + type: string + content: + application/json: + schema: + $ref: '#/components/schemas/API' + 400: + $ref: '#/components/responses/BadRequest' + 415: + $ref: '#/components/responses/UnsupportedMediaType' + security: + - OAuth2Security: + - apim:api_create + + /apis/{apiId}/asyncapi: + get: + tags: + - APIs + summary: Get AsyncAPI definition + description: | + This operation can be used to retrieve the AsyncAPI definition of an API. + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-None-Match' + responses: + 200: + description: | + OK. + Requested AsyncAPI definition of the API is returned + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Willl= be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has beed modified the last time. + Used by caches, or in conditional request (Will be supported in future). + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + type: string + example: "" + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + content: { } + 404: + $ref: '#/components/responses/NotFound' + 406: + $ref: '#/components/responses/NotAcceptable' + security: + - OAuth2Security: + - apim:api_view + + put: + tags: + - APIs + summary: Update AsyncAPI definition + description: | + This operation can be used to update the AsyncAPI definition of an existing API. AsyncAPI definition to be updated is passed as a form data parameter 'apiDefinition'. + parameters: + - $ref: '#/components/parameters/apiId' + - $ref: '#/components/parameters/If-Match' + requestBody: + content: + multipart/form-data: + schema: + properties: + apiDefinition: + type: string + description: AsyncAPI definition of the API + url: + type: string + description: AsyncAPI definition URL of the API + file: + type: string + description: AsyncAPI definition as a file + format: binary + responses: + 200: + description: | + OK. + Successful response with updated AsyncAPI definition + headers: + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Last-Modified: + description: | + Date and time the resource has beed modified the last time. + Use =d by caches, or in conditional requests (Will be supported in future). + schema: + type: string + Location: + description: | + The URL of the newly created resource. + schema: + type: string + Content-Type: + description: | + The content type of the body. + schema: + type: string + content: + application/json: + schema: + type: string + example: "" + 400: + $ref: '#/components/responses/BadRequest' + 403: + $ref: '#/components/responses/Forbidden' + 404: + $ref: '#/components/responses/NotFound' + 412: + $ref: '#/components/responses/PreconditionFailed' + security: + - OAuth2Security: + - apim:api_create + +components: + schemas: + Comment: + title: Comment + required: + - content + type: object + properties: + id: + type: string + readOnly: true + example: 943d3002-000c-42d3-a1b9-d6559f8a4d49 + content: + maxLength: 512 + type: string + example: This is a comment + createdTime: + type: string + readOnly: true + example : 2021-02-11-09:57:25 + createdBy: + type: string + readOnly: true + example: admin + updatedTime: + type: string + readOnly: true + example : 2021-02-12-19:57:25 + category: + type: string + default: general + parentCommentId: + type: string + example: 6f38aea2-f41e-4ac9-b3f2-a9493d00ba97 + entryPoint: + type: string + enum: [devPortal, publisher] + commenterInfo: + $ref: '#/components/schemas/CommenterInfo' + replies: + $ref: '#/components/schemas/CommentList' + CommentList: + title: Comments List + type: object + properties: + count: + type: integer + description: | + Number of Comments returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Comment' + pagination: + $ref: '#/components/schemas/Pagination' + CommenterInfo: + type: object + properties: + firstName: + type: string + example: John + lastName: + type: string + example: David + fullName: + type: string + example: John David + APIList: + title: API List + type: object + properties: + count: + type: integer + description: | + Number of APIs returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/APIInfo' + pagination: + $ref: '#/components/schemas/Pagination' + APIListExpanded: + title: API List + type: object + properties: + count: + type: integer + description: | + Number of APIs returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/API' + pagination: + $ref: '#/components/schemas/Pagination' + + APIInfo: + title: API Info object with basic API details. + type: object + properties: + id: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: CalculatorAPI + description: + type: string + example: A calculator API that supports basic operations + context: + type: string + example: CalculatorAPI + version: + type: string + example: 1.0.0 + provider: + type: string + description: | + If the provider value is not given, the user invoking the API will be used as the provider. + example: admin + type: + type: string + example: HTTP + lifeCycleStatus: + type: string + example: CREATED + workflowStatus: + type: string + example: APPROVED + hasThumbnail: + type: boolean + example: true + securityScheme: + type: array + items: + type: string + + Topic: + title: Topic object + required: + - name + - mode + - description + type: object + properties: + id: + type: string + description: id + readOnly: true + example: 1222344 + name: + maxLength: 50 + minLength: 1 + pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+]*$)' + type: string + example: PizzaShackAPI + mode: + maxLength: 32766 + type: string + example: This is a simple API for Pizza Shack online pizza delivery store. + description: + maxLength: 32766 + type: string + example: This is a simple API for Pizza Shack online pizza delivery store. + TopicList: + title: Topic List + type: object + properties: + count: + type: integer + description: | + Number of Topics returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Topic' + pagination: + $ref: '#/components/schemas/Pagination' + API: + title: API object + required: + - context + - name + - version + type: object + properties: + id: + type: string + description: | + UUID of the api registry artifact + readOnly: true + example: 01234567-0123-0123-0123-012345678901 + name: + maxLength: 50 + minLength: 1 + pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+]*$)' + type: string + example: PizzaShackAPI + description: + maxLength: 32766 + type: string + example: This is a simple API for Pizza Shack online pizza delivery store. + context: + maxLength: 82 + minLength: 1 + type: string + example: pizza + version: + maxLength: 30 + minLength: 1 + type: string + pattern: '^[^~!@#;:%^*()+={}|\\<>"'',&/$]+$' + example: 1.0.0 + provider: + maxLength: 50 + type: string + description: | + If the provider value is not given user invoking the api will be used as the provider. + example: admin + lifeCycleStatus: + type: string + example: CREATED + x-otherScopes: + - apim:api_publish + wsdlInfo: + $ref: '#/components/schemas/WSDLInfo' + wsdlUrl: + type: string + readOnly: true + example: /apimgt/applicationdata/wsdls/admin--soap1.wsdl + testKey: + type: string + readOnly: true + example: 8swdwj9080edejhj + responseCachingEnabled: + type: boolean + example: true + cacheTimeout: + type: integer + example: 300 + destinationStatsEnabled: + type: string + example: Disabled + hasThumbnail: + type: boolean + example: false + isDefaultVersion: + type: boolean + example: false + isRevision: + type: boolean + example: false + revisionedApiId: + type: string + description: | + UUID of the api registry artifact + readOnly: true + example: 01234567-0123-0123-0123-012345678901 + revisionId: + type: integer + example: 1 + enableSchemaValidation: + type: boolean + example: false + enableStore: + type: boolean + example: true + x-otherScopes: + - apim:api_publish + type: + type: string + description: The api creation type to be used. Accepted values are HTTP, + WS, SOAPTOREST, GRAPHQL, WEBSUB, SSE + example: HTTP + default: HTTP + enum: + - HTTP + - WS + - SOAPTOREST + - SOAP + - GRAPHQL + - WEBSUB + - SSE + transport: + type: array + description: | + Supported transports for the API (http and/or https). + example: + - http + - https + items: + type: string + tags: + type: array + example: + - pizza + - food + items: + type: string + x-otherScopes: + - apim:api_publish + policies: + type: array + example: + - Unlimited + items: + type: string + x-otherScopes: + - apim:api_publish + apiThrottlingPolicy: + type: string + description: The API level throttling policy selected for the particular + API + example: Unlimited + x-otherScopes: + - apim:api_publish + authorizationHeader: + type: string + description: | + Name of the Authorization header used for invoking the API. If it is not set, Authorization header name specified + in tenant or system level will be used. + example: Authorization + securityScheme: + type: array + description: | + Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If + it is not set OAuth2 will be set as the security for the current API. + example: + - oauth2 + items: + type: string + maxTps: + $ref: '#/components/schemas/APIMaxTps' + visibility: + type: string + description: The visibility level of the API. Accepts one of the following. + PUBLIC, PRIVATE, RESTRICTED. + example: PUBLIC + default: PUBLIC + enum: + - PUBLIC + - PRIVATE + - RESTRICTED + x-otherScopes: + - apim:api_publish + visibleRoles: + type: array + description: The user roles that are able to access the API in Developer Portal + example: [] + items: + type: string + x-otherScopes: + - apim:api_publish + visibleTenants: + type: array + example: [] + items: + type: string + endpointSecurity: + $ref: '#/components/schemas/APIEndpointSecurity' + gatewayEnvironments: + type: array + description: | + List of gateway environments the API is available + example: + - Production and Sandbox + items: + type: string + x-otherScopes: + - apim:api_publish + deploymentEnvironments: + type: array + description: | + List of selected deployment environments and clusters + items: + $ref: '#/components/schemas/DeploymentEnvironments' + x-otherScopes: + - apim:api_publish + labels: + type: array + description: | + Labels of micro-gateway environments attached to the API. + example: [] + items: + type: string + mediationPolicies: + type: array + example: + - name: json_to_xml_in_message + type: in + - name: xml_to_json_out_message + type: out + - name: json_fault + type: fault + items: + $ref: '#/components/schemas/MediationPolicy' + subscriptionAvailability: + type: string + description: The subscription availability. Accepts one of the following. + CURRENT_TENANT, ALL_TENANTS or SPECIFIC_TENANTS. + example: CURRENT_TENANT + default: CURRENT_TENANT + enum: + - CURRENT_TENANT + - ALL_TENANTS + - SPECIFIC_TENANTS + x-otherScopes: + - apim:api_publish + subscriptionAvailableTenants: + type: array + example: [] + items: + type: string + additionalProperties: + type: object + additionalProperties: + type: string + description: Map of custom properties of API + x-otherScopes: + - apim:api_publish + monetization: + $ref: '#/components/schemas/APIMonetizationInfo' + accessControl: + type: string + description: | + Is the API is restricted to certain set of publishers or creators or is it visible to all the + publishers and creators. If the accessControl restriction is none, this API can be modified by all the + publishers and creators, if not it can only be viewable/modifiable by certain set of publishers and creators, + based on the restriction. + default: NONE + enum: + - NONE + - RESTRICTED + accessControlRoles: + type: array + description: The user roles that are able to view/modify as API publisher + or creator. + example: [] + items: + type: string + businessInformation: + $ref: '#/components/schemas/APIBusinessInformation' + x-otherScopes: + - apim:api_publish + corsConfiguration: + $ref: '#/components/schemas/APICorsConfiguration' + websubSubscriptionConfiguration: + $ref: '#/components/schemas/WebsubSubscriptionConfiguration' + workflowStatus: + type: string + example: APPROVED + createdTime: + type: string + lastUpdatedTime: + type: string + x-otherScopes: + - apim:api_publish + endpointConfig: + type: object + properties: {} + description: | + Endpoint configuration of the API. This can be used to provide different types of endpoints including Simple REST Endpoints, Loadbalanced and Failover. + + `Simple REST Endpoint` + { + "endpoint_type": "http", + "sandbox_endpoints": { + "url": "https://localhost:9443/am/sample/pizzashack/v1/api/" + }, + "production_endpoints": { + "url": "https://localhost:9443/am/sample/pizzashack/v1/api/" + } + } + + `Loadbalanced Endpoint` + + { + "endpoint_type": "load_balance", + "algoCombo": "org.apache.synapse.endpoints.algorithms.RoundRobin", + "sessionManagement": "", + "sandbox_endpoints": [ + { + "url": "https://localhost:9443/am/sample/pizzashack/v1/api/1" + }, + { + "endpoint_type": "http", + "template_not_supported": false, + "url": "https://localhost:9443/am/sample/pizzashack/v1/api/2" + } + ], + "production_endpoints": [ + { + "url": "https://localhost:9443/am/sample/pizzashack/v1/api/3" + }, + { + "endpoint_type": "http", + "template_not_supported": false, + "url": "https://localhost:9443/am/sample/pizzashack/v1/api/4" + } + ], + "sessionTimeOut": "", + "algoClassName": "org.apache.synapse.endpoints.algorithms.RoundRobin" + } + + `Failover Endpoint` + + { + "production_failovers":[ + { + "endpoint_type":"http", + "template_not_supported":false, + "url":"https://localhost:9443/am/sample/pizzashack/v1/api/1" + } + ], + "endpoint_type":"failover", + "sandbox_endpoints":{ + "url":"https://localhost:9443/am/sample/pizzashack/v1/api/2" + }, + "production_endpoints":{ + "url":"https://localhost:9443/am/sample/pizzashack/v1/api/3" + }, + "sandbox_failovers":[ + { + "endpoint_type":"http", + "template_not_supported":false, + "url":"https://localhost:9443/am/sample/pizzashack/v1/api/4" + } + ] + } + + `Default Endpoint` + + { + "endpoint_type":"default", + "sandbox_endpoints":{ + "url":"default" + }, + "production_endpoints":{ + "url":"default" + } + } + + `Endpoint from Endpoint Registry` + { + "endpoint_type": "Registry", + "endpoint_id": "{registry-name:entry-name:version}", + } + example: + endpoint_type: http + sandbox_endpoints: + url: https://localhost:9443/am/sample/pizzashack/v1/api/ + production_endpoints: + url: https://localhost:9443/am/sample/pizzashack/v1/api/ + endpointImplementationType: + type: string + example: INLINE + default: ENDPOINT + enum: + - INLINE + - ENDPOINT + scopes: + type: array + items: + $ref: '#/components/schemas/APIScope' + operations: + type: array + example: + - target: /order/{orderId} + verb: POST + authType: Application & Application User + throttlingPolicy: Unlimited + - target: /menu + verb: GET + authType: Application & Application User + throttlingPolicy: Unlimited + items: + $ref: '#/components/schemas/APIOperations' + threatProtectionPolicies: + type: object + properties: + list: + type: array + items: + type: object + properties: + policyId: + type: string + priority: + type: integer + categories: + type: array + description: | + API categories + items: + type: string + example: "" + x-otherScopes: + - apim:api_publish + keyManagers: + type: object + properties: {} + description: | + API Key Managers + readOnly: true + serviceInfo: + type: object + properties: + key: + type: string + example: PetStore-1.0.0 + name: + type: string + example: PetStore + version: + type: string + example: 1.0.0 + outdated: + type: boolean + example: false + x-scopes: + - apim:api_create + - apim:api_import_export + + #----------------------------------------------------- + # The API Revision resource + #----------------------------------------------------- + APIRevision: + title: API Info object with basic API details + properties: + displayName: + type: string + example: REVISION 1 + id: + type: string + example: c26b2b9b-4632-4ca4-b6f3-521c8863990c + description: + type: string + example: removed a post resource + createdTime: + type: string + format: date-time + apiInfo: + $ref: '#/components/schemas/APIRevisionAPIInfo' + deploymentInfo: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' + + #----------------------------------------------------- + # The API Revision - API Info resource + #----------------------------------------------------- + APIRevisionAPIInfo: + title: API Info object with basic Revisioned API details + readOnly: true + properties: + id: + type: string + example: 01234567-0123-0123-0123-012345678901 + + #----------------------------------------------------- + # The API Revision List resource + #----------------------------------------------------- + APIRevisionList: + title: API Revisions List + properties: + count: + type: integer + description: | + Number of API revisions returned + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/APIRevision' + #----------------------------------------------------- + # The API Revision Deployment List resource + #----------------------------------------------------- + APIRevisionDeploymentList: + title: API Revision to Deployment mapped object with basic API deployment details + properties: + list: + type: array + items: + $ref: '#/components/schemas/APIRevisionDeployment' + #----------------------------------------------------- + # The API Revision Deployment resource + #----------------------------------------------------- + APIRevisionDeployment: + title: APIRevisionDeployment Info object with basic API deployment details + properties: + revisionUuid: + type: string + example: c26b2b9b-4632-4ca4-b6f3-521c8863990c + name: + type: string + example: default + vhost: + maxLength: 255 + minLength: 1 + # hostname regex as per RFC 1123 (http://tools.ietf.org/html/rfc1123) and appended * + pattern: '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' + type: string + example: mg.wso2.com + displayOnDevportal: + type: boolean + example: true + deployedTime: + type: string + format: date-time + + AuditReport: + title: Resource for Audit Report + type: object + properties: + report: + type: string + description: | + The API Security Audit Report + grade: + type: string + description: | + The overall grade of the Security Audit + example: "27.95" + numErrors: + type: integer + description: | + The number of errors in the API Definition + example: 20 + externalApiId: + type: string + description: | + The External API ID + example: fd21f9f7-3674-49cf-8a83-dca401f635de + APIProductList: + title: API Product List + type: object + properties: + count: + type: integer + description: | + Number of API Products returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/APIProductInfo' + pagination: + $ref: '#/components/schemas/Pagination' + APIProductInfo: + title: API Info object with basic API details. + type: object + properties: + id: + type: string + description: | + UUID of the api product + readOnly: true + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + description: Name of the API Product + example: PizzaShackAPIProduct + context: + type: string + example: pizzaproduct + description: + type: string + description: A brief description about the API + example: This is a simple API for Pizza Shack online pizza delivery store + provider: + type: string + description: | + If the provider value is not given, the user invoking the API will be used as the provider. + example: admin + hasThumbnail: + type: boolean + example: true + state: + type: string + description: | + State of the API product. Only published api products are visible on the Developer Portal + enum: + - CREATED + - PUBLISHED + securityScheme: + type: array + description: | + Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If + it is not set OAuth2 will be set as the security for the current API. + example: + - oauth2 + items: + type: string + APIProduct: + title: API Product object + required: + - name + type: object + properties: + id: + type: string + description: | + UUID of the api product + readOnly: true + example: 01234567-0123-0123-0123-012345678901 + name: + maxLength: 50 + minLength: 1 + type: string + description: Name of the API Product + example: PizzaShackAPIProduct + context: + maxLength: 60 + minLength: 1 + type: string + example: pizzaproduct + description: + type: string + description: A brief description about the API + example: This is a simple API for Pizza Shack online pizza delivery store + provider: + maxLength: 50 + type: string + description: | + If the provider value is not given, the user invoking the API will be used as the provider. + example: admin + hasThumbnail: + type: boolean + example: false + state: + type: string + description: | + State of the API product. Only published api products are visible on the Developer Portal + enum: + - CREATED + - PUBLISHED + enableSchemaValidation: + type: boolean + example: false + enableStore: + type: boolean + example: true + testKey: + type: string + readOnly: true + example: 8swdwj9080edejhj + isRevision: + type: boolean + example: false + revisionedApiProductId: + type: string + description: | + UUID of the api product registry artifact + readOnly: true + example: 01234567-0123-0123-0123-012345678901 + revisionId: + type: integer + example: 1 + responseCachingEnabled: + type: boolean + example: true + cacheTimeout: + type: integer + example: 300 + visibility: + type: string + description: The visibility level of the API. Accepts one of the following. + PUBLIC, PRIVATE, RESTRICTED. + example: PUBLIC + default: PUBLIC + enum: + - PUBLIC + - PRIVATE + - RESTRICTED + visibleRoles: + type: array + description: The user roles that are able to access the API + example: [] + items: + type: string + visibleTenants: + type: array + example: [] + items: + type: string + accessControl: + type: string + description: | + Defines whether the API Product is restricted to certain set of publishers or creators or is it visible to all the + publishers and creators. If the accessControl restriction is none, this API Product can be modified by all the + publishers and creators, if not it can only be viewable/modifiable by certain set of publishers and creators, + based on the restriction. + default: NONE + enum: + - NONE + - RESTRICTED + accessControlRoles: + type: array + description: The user roles that are able to view/modify as API Product + publisher or creator. + example: [] + items: + type: string + gatewayEnvironments: + type: array + description: | + List of gateway environments the API Product is available + example: + - Production and Sandbox + items: + type: string + apiType: + type: string + description: The API type to be used. Accepted values are API, APIPRODUCT + example: APIPRODUCT + enum: + - API + - APIPRODUCT + transport: + type: array + description: | + Supported transports for the API (http and/or https). + example: + - http + - https + items: + type: string + tags: + type: array + example: + - pizza + - food + items: + type: string + policies: + type: array + example: + - Unlimited + items: + type: string + apiThrottlingPolicy: + type: string + description: The API level throttling policy selected for the particular + API Product + example: Unlimited + authorizationHeader: + type: string + description: | + Name of the Authorization header used for invoking the API. If it is not set, Authorization header name specified + in tenant or system level will be used. + example: Authorization + securityScheme: + type: array + description: | + Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If + it is not set OAuth2 will be set as the security for the current API. + example: + - oauth2 + items: + type: string + subscriptionAvailability: + type: string + description: The subscription availability. Accepts one of the following. + CURRENT_TENANT, ALL_TENANTS or SPECIFIC_TENANTS. + example: CURRENT_TENANT + default: ALL_TENANTS + enum: + - CURRENT_TENANT + - ALL_TENANTS + - SPECIFIC_TENANTS + subscriptionAvailableTenants: + type: array + example: [] + items: + type: string + x-otherScopes: + - apim:api_publish + additionalProperties: + type: object + additionalProperties: + type: string + description: Map of custom properties of API + monetization: + $ref: '#/components/schemas/APIMonetizationInfo' + businessInformation: + $ref: '#/components/schemas/APIProductBusinessInformation' + corsConfiguration: + $ref: '#/components/schemas/APICorsConfiguration' + createdTime: + type: string + lastUpdatedTime: + type: string + apis: + type: array + description: | + APIs and resources in the API Product. + example: + - name: PizzaShackAPI + apiId: 01234567-0123-0123-0123-012345678901 + version: "1.0" + operations: + - target: /order/{orderId} + verb: POST + authType: Application & Application User + throttlingPolicy: Unlimited + - target: /menu + verb: GET + authType: Application & Application User + throttlingPolicy: Unlimited + items: + $ref: '#/components/schemas/ProductAPI' + scopes: + type: array + example: [] + items: + $ref: '#/components/schemas/APIScope' + categories: + type: array + description: | + API categories + example: [] + items: + type: string + ProductAPI: + title: ProductAPI + required: + - apiId + type: object + properties: + name: + type: string + example: PizzaShackAPI + apiId: + type: string + example: 01234567-0123-0123-0123-012345678901 + version: + type: string + example: "1.0" + operations: + type: array + items: + $ref: '#/components/schemas/APIOperations' + ResourcePath: + title: ResourcePath + required: + - id + type: object + properties: + id: + type: integer + example: 1 + resourcePath: + type: string + example: /menu + httpVerb: + type: string + example: GET + ResourcePathList: + title: ResourcePath List + type: object + properties: + count: + type: integer + description: | + Number of API Resource Paths returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/ResourcePath' + pagination: + $ref: '#/components/schemas/Pagination' + APIProductOutdatedStatus: + title: APIProduct is outdated status + type: object + properties: + isOutdated: + type: boolean + description: | + Indicates if an API Product is outdated + example: true + APIProductBusinessInformation: + type: object + properties: + businessOwner: + maxLength: 120 + type: string + example: businessowner + businessOwnerEmail: + type: string + example: businessowner@wso2.com + technicalOwner: + maxLength: 120 + type: string + example: technicalowner + technicalOwnerEmail: + type: string + example: technicalowner@wso2.com + Claim: + title: Claim + type: object + properties: + name: + type: string + example: email + URI: + type: string + example: http://wso2.org/claims/emailaddress + value: + type: string + example: admin@wso2.com + SubscriberInfo: + title: SubscriberInfo + type: object + properties: + name: + type: string + example: admin + claims: + type: array + items: + $ref: '#/components/schemas/Claim' + Application: + title: Application + required: + - name + - throttlingTier + type: object + properties: + applicationId: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: CalculatorApp + subscriber: + type: string + example: admin + throttlingTier: + type: string + example: Unlimited + description: + type: string + example: Sample calculator application + groupId: + type: string + example: "" + ApplicationInfo: + title: Application info object with basic application details + type: object + properties: + applicationId: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: CalculatorApp + subscriber: + type: string + example: admin + description: + type: string + example: Sample calculator application + subscriptionCount: + type: integer + DocumentList: + title: Document List + type: object + properties: + count: + type: integer + description: | + Number of Documents returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Document' + pagination: + $ref: '#/components/schemas/Pagination' + Document: + title: Document + required: + - name + - sourceType + - type + - visibility + type: object + properties: + documentId: + type: string + readOnly: true + example: 01234567-0123-0123-0123-012345678901 + name: + maxLength: 60 + minLength: 1 + type: string + example: PizzaShackDoc + type: + type: string + example: HOWTO + enum: + - HOWTO + - SAMPLES + - PUBLIC_FORUM + - SUPPORT_FORUM + - API_MESSAGE_FORMAT + - SWAGGER_DOC + - OTHER + summary: + maxLength: 32766 + minLength: 1 + type: string + example: Summary of PizzaShackAPI Documentation + sourceType: + type: string + example: INLINE + enum: + - INLINE + - MARKDOWN + - URL + - FILE + sourceUrl: + type: string + readOnly: true + example: "" + fileName: + type: string + readOnly: true + example: "" + inlineContent: + type: string + example: This is doc content. This can have many lines. + otherTypeName: + type: string + readOnly: true + example: "" + visibility: + type: string + example: API_LEVEL + enum: + - OWNER_ONLY + - PRIVATE + - API_LEVEL + createdTime: + type: string + readOnly: true + createdBy: + type: string + example: admin + lastUpdatedTime: + type: string + readOnly: true + lastUpdatedBy: + type: string + readOnly: true + example: admin + GraphQLSchema: + title: GraphQL Schema + required: + - name + type: object + properties: + name: + type: string + example: admin--HackerNewsAPI.graphql + schemaDefinition: + type: string + GraphQLQueryComplexityInfo: + title: GraphQL Query Complexity Info + type: object + properties: + list: + type: array + items: + $ref: '#/components/schemas/GraphQLCustomComplexityInfo' + GraphQLCustomComplexityInfo: + title: GraphQL Custom Complexity Info + required: + - complexityValue + - field + - type + type: object + properties: + type: + type: string + description: | + The type found within the schema of the API + example: Country + field: + type: string + description: | + The field which is found under the type within the schema of the API + example: name + complexityValue: + type: integer + description: | + The complexity value allocated for the associated field under the specified type + example: 1 + GraphQLSchemaTypeList: + title: List of types and corresponding fields of the GraphQL Schema + type: object + properties: + typeList: + type: array + items: + $ref: '#/components/schemas/GraphQLSchemaType' + GraphQLSchemaType: + title: Single type and corresponding fields found within the GraphQL Schema + type: object + properties: + type: + type: string + description: | + Type found within the GraphQL Schema + example: Country + fieldList: + type: array + description: | + Array of fields under current type + example: + - code + - name + items: + type: string + MediationList: + title: Mediation List + type: object + properties: + count: + type: integer + description: | + Number of mediation sequences returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/MediationInfo' + pagination: + $ref: '#/components/schemas/Pagination' + MediationInfo: + title: MediationInfo + required: + - id + - name + - type + type: object + properties: + name: + type: string + example: json_fault.xml + id: + type: string + example: 01234567-0123-0123-0123-012345678901 + type: + type: string + example: in + enum: + - in + - out + - fault + Mediation: + title: Mediation + required: + - name + - type + type: object + properties: + id: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: json_fault.xml + type: + type: string + example: in + enum: + - in + - out + - fault + ThrottlingPolicyList: + title: Throttling policy list + type: object + properties: + count: + type: integer + description: | + Number of Tiers returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/ThrottlingPolicy' + pagination: + $ref: '#/components/schemas/Pagination' + ThrottlingPolicy: + title: Tier + required: + - name + - requestCount + - stopOnQuotaReach + - tierPlan + - unitTime + type: object + properties: + name: + type: string + example: Platinum + description: + type: string + example: Allows 50 request(s) per minute. + policyLevel: + type: string + example: api + enum: + - subscription + - api + displayName: + type: string + example: Platinum + attributes: + type: object + additionalProperties: + type: string + description: | + Custom attributes added to the policy policy + example: {} + requestCount: + type: integer + description: | + Maximum number of requests which can be sent within a provided unit time + format: int64 + example: 50 + dataUnit: + description: | + Unit of data allowed to be transfered. Allowed values are "KB", "MB" and "GB" + type: string + example: KB + unitTime: + type: integer + format: int64 + example: 60000 + timeUnit: + type: string + example: min + rateLimitCount: + type: integer + default: 0 + description: Burst control request count + example: 10 + rateLimitTimeUnit: + type: string + description: Burst control time unit + example: min + quotaPolicyType: + type: string + description: Default quota limit type + enum: + - REQUESTCOUNT + - BANDWIDTHVOLUME + example: REQUESTCOUNT + tierPlan: + type: string + description: | + This attribute declares whether this policy is available under commercial or free + example: FREE + enum: + - FREE + - COMMERCIAL + stopOnQuotaReach: + type: boolean + description: | + By making this attribute to false, you are capabale of sending requests + even if the request count exceeded within a unit time + example: true + monetizationProperties: + type: object + additionalProperties: + type: string + description: Properties of a tier plan which are related to monetization + example: {} + SubscriptionList: + title: Subscription List + type: object + properties: + count: + type: integer + description: | + Number of Subscriptions returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Subscription' + pagination: + $ref: '#/components/schemas/Pagination' + Subscription: + title: Subscription + required: + - applicationInfo + - subscriptionId + - subscriptionStatus + - throttlingPolicy + type: object + properties: + subscriptionId: + type: string + example: 01234567-0123-0123-0123-012345678901 + applicationInfo: + $ref: '#/components/schemas/ApplicationInfo' + throttlingPolicy: + type: string + example: Unlimited + subscriptionStatus: + type: string + example: BLOCKED + enum: + - BLOCKED + - PROD_ONLY_BLOCKED + - UNBLOCKED + - ON_HOLD + - REJECTED + - TIER_UPDATE_PENDING + APIMonetizationUsage: + title: API monetization usage object + type: object + properties: + properties: + type: object + additionalProperties: + type: string + description: Map of custom properties related to monetization usage + APIRevenue: + title: API revenue data object + type: object + properties: + properties: + type: object + additionalProperties: + type: string + description: Map of custom properties related to API revenue + MediationPolicy: + title: Mediation Policy + required: + - name + type: object + properties: + id: + type: string + example: 69ea3fa6-55c6-472e-896d-e449dd34a824 + name: + type: string + example: log_in_message + type: + type: string + example: in + shared: + type: boolean + example: true + Error: + title: Error object returned with 4XX HTTP Status + required: + - code + - message + type: object + properties: + code: + type: integer + format: int64 + message: + type: string + description: Error message. + description: + type: string + description: | + A detail description about the error message. + moreInfo: + type: string + description: | + Preferably an url with more details about the error. + error: + type: array + description: | + If there are more than one error list them out. + For example, list out validation errors by each field. + items: + $ref: '#/components/schemas/ErrorListItem' + ErrorListItem: + title: Description of individual errors that may have occurred during a request. + required: + - code + - message + type: object + properties: + code: + type: string + message: + type: string + description: | + Description about individual errors occurred + description: + type: string + description: | + A detail description about the error message. + Environment: + title: Environment + required: + - endpoints + - name + - serverUrl + - showInApiConsole + - type + type: object + properties: + name: + type: string + example: default + displayName: + type: string + example: Default + type: + type: string + example: hybrid + serverUrl: + type: string + example: https://localhost:9443/services/ + showInApiConsole: + type: boolean + example: true + endpoints: + $ref: '#/components/schemas/EnvironmentEndpoints' + vhosts: + type: array + items: + $ref: '#/components/schemas/VHost' + EnvironmentList: + title: Environment List + type: object + properties: + count: + type: integer + description: | + Number of Environments returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Environment' + EnvironmentEndpoints: + title: Environment Endpoints + type: object + properties: + http: + type: string + description: HTTP environment URL + example: http://localhost:8280 + https: + type: string + description: HTTPS environment URL + example: https://localhost:8243 + ws: + type: string + description: WS environment URL + example: http://localhost:9099 + wss: + type: string + description: WSS environment URL + example: https://localhost:8099 + VHost: + title: Virtual Host + type: object + properties: + host: + type: string + example: mg.wso2.com + httpContext: + type: string + example: pets + httpPort: + type: integer + example: 80 + httpsPort: + type: integer + example: 443 + wsPort: + type: integer + example: 9099 + wssPort: + type: integer + example: 8099 + FileInfo: + title: File Information including meta data + type: object + properties: + relativePath: + type: string + description: relative location of the file (excluding the base context and + host of the Publisher API) + example: apis/01234567-0123-0123-0123-012345678901/thumbnail + mediaType: + type: string + description: media-type of the file + example: image/jpeg + APIMaxTps: + type: object + properties: + production: + type: integer + format: int64 + example: 1000 + sandbox: + type: integer + format: int64 + example: 1000 + APIEndpointSecurity: + type: object + properties: + type: + type: string + description: Accepts one of the following, basic or digest. + example: BASIC + enum: + - BASIC + - DIGEST + username: + type: string + example: admin + password: + type: string + example: password + APIBusinessInformation: + type: object + properties: + businessOwner: + maxLength: 120 + type: string + example: businessowner + businessOwnerEmail: + type: string + example: businessowner@wso2.com + pattern: '^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$' + technicalOwner: + maxLength: 120 + type: string + example: technicalowner + technicalOwnerEmail: + type: string + example: technicalowner@wso2.com + + WebsubSubscriptionConfiguration: + type: object + properties: + secret: + type: string + description: Secret key to be used for subscription + signingAlgorithm: + type: string + description: The algorithm used for signing + signatureHeader: + type: string + description: The header uses to send the signature + + APICorsConfiguration: + type: object + properties: + corsConfigurationEnabled: + type: boolean + default: false + accessControlAllowOrigins: + type: array + items: + type: string + accessControlAllowCredentials: + type: boolean + default: false + accessControlAllowHeaders: + type: array + items: + type: string + accessControlAllowMethods: + type: array + items: + type: string + description: | + CORS configuration for the API + Endpoint: + title: Endpoints + type: object + properties: + id: + type: string + description: | + UUID of the Endpoint entry + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + description: | + name of the Endpoint entry + example: Endpoint 1 + endpointConfig: + type: object + properties: + endpointType: + type: string + example: FAIL_OVER + enum: + - SINGLE + - LOAD_BALANCED + - FAIL_OVER + list: + type: array + items: + $ref: '#/components/schemas/EndpointConfig' + endpointSecurity: + type: object + properties: + enabled: + type: boolean + example: false + type: + type: string + example: basic + username: + type: string + example: basic + password: + type: string + example: basic + maxTps: + type: integer + description: Endpoint max tps + format: int64 + example: 1000 + type: + type: string + example: http + EndpointConfig: + title: Endpoint Configuration + type: object + properties: + url: + type: string + description: | + Service url of the endpoint + example: http://localhost:8280 + timeout: + type: string + description: | + Time out of the endpoint + example: "1000" + attributes: + type: array + items: + type: object + properties: + name: + type: string + example: Suspension time + value: + type: string + example: 2s + EndpointList: + title: Endpoint List + type: object + properties: + count: + type: integer + description: | + Number of Endpoints returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Endpoint' + Scope: + title: Scope + required: + - name + type: object + properties: + id: + type: string + description: | + UUID of the Scope. Valid only for shared scopes. + readOnly: true + example: 01234567-0123-0123-0123-012345678901 + name: + maxLength: 255 + minLength: 1 + type: string + description: | + name of Scope + example: apim:api_view + displayName: + maxLength: 255 + type: string + description: | + display name of Scope + example: api_view + description: + maxLength: 512 + type: string + description: | + description of Scope + example: This Scope can used to view Apis + bindings: + type: array + description: | + role bindings list of the Scope + example: + - admin + - Internal/creator + - Internal/publisher + items: + type: string + usageCount: + type: integer + description: | + usage count of Scope + readOnly: true + example: 3 + SharedScopeUsage: + title: SharedScopeUsage + required: + - id + - name + type: object + properties: + id: + type: string + description: | + UUID of the Scope. Valid only for shared scopes. + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + description: | + name of Scope + example: apim:api_view + usedApiList: + type: array + description: | + API list which have used the shared scope + items: + $ref: '#/components/schemas/SharedScopeUsedAPIInfo' + SharedScopeUsedAPIInfo: + title: API object using shared scope + required: + - context + - name + - version + type: object + properties: + name: + type: string + example: CalculatorAPI + context: + type: string + example: CalculatorAPI + version: + type: string + example: 1.0.0 + provider: + type: string + description: | + If the provider value is not given user invoking the api will be used as the provider. + example: admin + usedResourceList: + type: array + description: | + Resource list which have used the shared scope within this API + items: + $ref: '#/components/schemas/SharedScopeUsedAPIResourceInfo' + SharedScopeUsedAPIResourceInfo: + title: API resource object using shared scope + type: object + properties: + target: + type: string + example: /add + verb: + type: string + example: POST + APIScope: + title: APIScope + required: + - scope + type: object + properties: + scope: + $ref: '#/components/schemas/Scope' + shared: + type: boolean + description: | + States whether scope is shared. This will not be honored when updating/adding scopes to APIs or when + adding/updating Shared Scopes. + example: true + APIOperations: + title: Operation + type: object + properties: + id: + type: string + example: postapiresource + target: + type: string + example: /order/{orderId} + verb: + type: string + example: POST + authType: + type: string + example: Application & Application User + default: Any + throttlingPolicy: + type: string + example: Unlimited + scopes: + type: array + example: [] + items: + type: string + usedProductIds: + type: array + example: [] + items: + type: string + amznResourceName: + type: string + example: "" + amznResourceTimeout: + type: integer + payloadSchema: + type: string + example: "" + uriMapping: + type: string + example: "" + ScopeList: + title: Scope List + type: object + properties: + count: + type: integer + description: | + Number of Scopes returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Scope' + pagination: + $ref: '#/components/schemas/Pagination' + ExternalStore: + title: External Store + type: object + properties: + id: + type: string + description: | + The external store identifier, which is a unique value. + example: Store123# + displayName: + type: string + description: | + The name of the external API Store that is displayed in the Publisher UI. + example: UKStore + type: + type: string + description: | + The type of the Store. This can be a WSO2-specific API Store or an external one. + example: wso2 + endpoint: + type: string + description: | + The endpoint URL of the external store + example: http://localhost:9764/store + APIExternalStore: + title: API External Store + type: object + properties: + id: + type: string + description: | + The external store identifier, which is a unique value. + example: Store123# + lastUpdatedTime: + type: string + description: | + The recent timestamp which a given API is updated in the external store. + example: 2019-09-09T13:57:16.229 + APIExternalStoreList: + title: API External Store List + type: object + properties: + count: + type: integer + description: | + Number of external stores returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/APIExternalStore' + ExternalStoreList: + title: External Store List + type: object + properties: + count: + type: integer + description: | + Number of external stores returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/ExternalStore' + Certificates: + title: Certificates + type: object + properties: + count: + type: integer + example: 1 + certificates: + type: array + items: + $ref: '#/components/schemas/CertMetadata' + pagination: + $ref: '#/components/schemas/Pagination' + description: Representation of a list of certificates + CertMetadata: + title: Certificate + type: object + properties: + alias: + type: string + example: wso2carbon + endpoint: + type: string + example: www.abc.com + description: Representation of the details of a certificate + CertificateInfo: + title: Certificate information + type: object + properties: + status: + type: string + example: Active + validity: + $ref: '#/components/schemas/CertificateValidity' + version: + type: string + example: V3 + subject: + type: string + example: CN=wso2.com, OU=wso2, O=wso2, L=Colombo, ST=Western, C=LK + CertificateValidity: + title: Certificate Valid period + type: object + properties: + from: + type: string + example: 12-12-2017 + to: + type: string + example: 01-01-2019 + ClientCertificates: + title: Client Certificates + type: object + properties: + count: + type: integer + example: 1 + certificates: + type: array + items: + $ref: '#/components/schemas/ClientCertMetadata' + pagination: + $ref: '#/components/schemas/Pagination' + description: Representation of a list of client certificates + ClientCertMetadata: + title: Client certificate meta data + type: object + properties: + alias: + type: string + example: wso2carbon + apiId: + type: string + example: 64eca60b-2e55-4c38-8603-e9e6bad7d809 + tier: + type: string + example: Gold + description: Meta data of certificate + Label: + title: Label + required: + - name + type: object + properties: + name: + type: string + example: marketing_store + description: + type: string + example: Public microgateway for marketing + access_urls: + type: array + example: https://localhost:9095 + items: + type: string + LabelList: + title: Label List + type: object + properties: + count: + type: integer + description: | + Number of Labels returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Label' + pagination: + $ref: '#/components/schemas/Pagination' + LifecycleState: + title: Lifecycle State + type: object + properties: + state: + type: string + example: Created + checkItems: + type: array + items: + type: object + properties: + name: + type: string + example: Deprecate old versions after publishing the API + value: + type: boolean + example: false + requiredStates: + type: array + example: [] + items: + type: string + availableTransitions: + type: array + items: + type: object + properties: + event: + type: string + example: Publish + targetState: + type: string + example: Published + LifecycleHistory: + title: Lifecycle history item list + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/LifecycleHistoryItem' + LifecycleHistoryItem: + title: Lifecycle history item + type: object + properties: + previousState: + type: string + example: Created + postState: + type: string + example: Published + user: + type: string + example: admin + updatedTime: + type: string + format: dateTime + example: 2019-02-31T23:59:60Z + WorkflowResponse: + title: workflow Response + required: + - workflowStatus + type: object + properties: + workflowStatus: + type: string + description: | + This attribute declares whether this workflow task is approved or rejected. + example: APPROVED + enum: + - CREATED + - APPROVED + - REJECTED + - REGISTERED + jsonPayload: + type: string + description: | + Attributes that returned after the workflow execution + example: null + lifecycleState: + $ref: '#/components/schemas/LifecycleState' + OpenAPIDefinitionValidationResponse: + title: OpenAPI Definition Validation Response + required: + - isValid + type: object + properties: + isValid: + type: boolean + description: | + This attribute declares whether this definition is valid or not. + example: true + content: + type: string + description: | + OpenAPI definition content. + info: + type: object + properties: + name: + type: string + example: PetStore + version: + type: string + example: 1.0.0 + context: + type: string + example: /petstore + description: + type: string + example: A sample API that uses a petstore as an example to demonstrate + swagger-2.0 specification + openAPIVersion: + type: string + example: 3.0.0 + endpoints: + type: array + description: | + contains host/servers specified in the OpenAPI file/URL + items: + type: string + example: https://localhost:9443/am/sample/pizzashack/v1/api/ + description: | + API definition information + errors: + type: array + description: | + If there are more than one error list them out. + For example, list out validation errors by each field. + items: + $ref: '#/components/schemas/ErrorListItem' + WSDLValidationResponse: + title: WSDL Definition Validation Response + required: + - isValid + type: object + properties: + isValid: + type: boolean + description: | + This attribute declares whether this definition is valid or not. + example: true + errors: + type: array + description: | + If there are more than one error list them out. + For example, list out validation errors by each field. + items: + $ref: '#/components/schemas/ErrorListItem' + wsdlInfo: + type: object + properties: + version: + type: string + description: | + WSDL version + example: "1.1" + endpoints: + type: array + description: | + A list of endpoints the service exposes + items: + type: object + properties: + name: + type: string + description: Name of the endpoint + example: StockQuoteSoap + location: + type: string + description: Endpoint URL + example: http://www.webservicex.net/stockquote.asmx + description: Summary of the WSDL including the basic information + GraphQLValidationResponse: + title: GraphQL API definition validation Response + required: + - errorMessage + - isValid + type: object + properties: + isValid: + type: boolean + description: | + This attribute declares whether this definition is valid or not. + example: true + errorMessage: + type: string + description: | + This attribute declares the validation error message + graphQLInfo: + type: object + properties: + operations: + type: array + items: + $ref: '#/components/schemas/APIOperations' + graphQLSchema: + $ref: '#/components/schemas/GraphQLSchema' + description: Summary of the GraphQL including the basic information + ApiEndpointValidationResponse: + title: API Endpoint url validation response + required: + - statusCode + - statusMessage + type: object + properties: + statusCode: + type: integer + description: HTTP status code + example: 200 + statusMessage: + type: string + description: string + example: OK + error: + type: string + description: | + If an error occurs, the error message will be set to this property. + If not, this will remain null. + example: null + ThreatProtectionPolicyList: + title: Threat Protection Policy List + type: object + properties: + list: + type: array + items: + $ref: '#/components/schemas/ThreatProtectionPolicy' + ThreatProtectionPolicy: + title: Threat Protection Policy Schema + required: + - name + - policy + - type + type: object + properties: + uuid: + type: string + description: Policy ID + name: + type: string + description: Name of the policy + type: + type: string + description: Type of the policy + policy: + type: string + description: policy as a json string + SearchResultList: + title: Unified Search Result List + type: object + properties: + count: + type: integer + description: | + Number of results returned. + example: 1 + list: + type: array + items: + type: object + pagination: + $ref: '#/components/schemas/Pagination' + SearchResult: + title: Search Result + required: + - name + type: object + properties: + id: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: TestAPI + type: + type: string + example: API + enum: + - DOC + - API + - APIProduct + transportType: + type: string + description: Accepted values are HTTP, WS, SOAPTOREST, GRAPHQL + discriminator: + propertyName: name + APISearchResult: + title: API Result + allOf: + - $ref: '#/components/schemas/SearchResult' + - type: object + properties: + description: + type: string + description: A brief description about the API + example: A calculator API that supports basic operations + context: + type: string + description: A string that represents the context of the user's request + example: CalculatorAPI + version: + type: string + description: The version of the API + example: 1.0.0 + provider: + type: string + description: | + If the provider value is not given, the user invoking the API will be used as the provider. + example: admin + status: + type: string + description: This describes in which status of the lifecycle the API is + example: CREATED + thumbnailUri: + type: string + example: /apis/01234567-0123-0123-0123-012345678901/thumbnail + APIProductSearchResult: + title: API Result + allOf: + - $ref: '#/components/schemas/SearchResult' + - type: object + properties: + description: + type: string + description: A brief description about the API + example: A calculator API that supports basic operations + context: + type: string + description: A string that represents the context of the user's request + example: CalculatorAPI + version: + type: string + description: The version of the API Product + example: 1.0.0 + provider: + type: string + description: | + If the provider value is not given, the user invoking the API will be used as the provider. + example: admin + status: + type: string + description: This describes in which status of the lifecycle the APIPRODUCT + is + example: PUBLISHED + thumbnailUri: + type: string + example: /apis/01234567-0123-0123-0123-012345678901/thumbnail + APIMonetizationInfo: + title: API monetization object + required: + - enabled + type: object + properties: + enabled: + type: boolean + description: Flag to indicate the monetization status + example: true properties: - offset: - type: integer - example: 12 - limit: - type: integer - example: 25 - total: - type: integer - example: 1290 - -#----------------------------------------------------- -# The API Info resource -#----------------------------------------------------- - APIInfo: - title: API Info object with basic API details. - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorAPI - description: - type: string - example: A calculator API that supports basic operations - context: - type: string - example: CalculatorAPI - version: - type: string - example: 1.0.0 - provider: - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - type: string - example: admin - status: - type: string - example: CREATED - thumbnailUri: - type: string - example: /apis/01234567-0123-0123-0123-012345678901/thumbnail - -#----------------------------------------------------- -# The API resource -#----------------------------------------------------- - API: - title: API object - required: - - name - - context - - version - - tiers - - isDefaultVersion - - transport - - endpointConfig - - visibility - - type - properties: - id: - type: string - description: | - UUID of the api registry artifact - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - description: Name of the API - example: CalculatorAPI - description: - type: string - description: A brief description about the API - example: A calculator API that supports basic operations - context: - type: string - description: A string that represents the context of the user's request - example: CalculatorAPI - version: - type: string - description: The version of the API - example: 1.0.0 - provider: - description: | - If the provider value is not given user invoking the api will be used as the provider. - type: string - example: admin - apiDefinition: - description: | - Swagger definition of the API which contains details about URI templates and scopes - type: string - example: "{\"paths\":{\"/substract\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"parameters\":[{\"name\":\"x\",\"required\":true,\"type\":\"string\",\"in\":\"query\"},{\"name\":\"y\",\"required\":true,\"type\":\"string\",\"in\":\"query\"}],\"responses\":{\"200\":{}}}},\"/add\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"parameters\":[{\"name\":\"x\",\"required\":true,\"type\":\"string\",\"in\":\"query\"},{\"name\":\"y\",\"required\":true,\"type\":\"string\",\"in\":\"query\"}],\"responses\":{\"200\":{}}}}},\"swagger\":\"2.0\",\"info\":{\"title\":\"CalculatorAPI\",\"version\":\"1.0.0\"}}" - wsdlUri: - description: | - WSDL URL if the API is based on a WSDL endpoint - type: string - example: "http://www.webservicex.com/globalweather.asmx?wsdl" - status: - type: string - description: This describes in which status of the lifecycle the API is - example: CREATED - responseCaching: - type: string - example: Disabled - cacheTimeout: - type: integer - example: 300 - destinationStatsEnabled: - type: string - example: Disabled - isDefaultVersion: - type: boolean - example: false - type: - type: string - description: The transport to be set. Accepted values are HTTP, WS - enum: - - HTTP - - WS - example: HTTP - default: HTTP - transport: - description: | - Supported transports for the API (http and/or https). - type: array - items: + type: object + additionalProperties: + type: string + description: Map of custom properties related to monetization + DocumentSearchResult: + title: Document Result + allOf: + - $ref: '#/components/schemas/SearchResult' + - type: object + properties: + docType: + type: string + example: HOWTO + enum: + - HOWTO + - SAMPLES + - PUBLIC_FORUM + - SUPPORT_FORUM + - API_MESSAGE_FORMAT + - SWAGGER_DOC + - OTHER + summary: + type: string + example: Summary of Calculator Documentation + sourceType: + type: string + example: INLINE + enum: + - INLINE + - URL + - FILE + sourceUrl: + type: string + example: "" + otherTypeName: + type: string + example: "" + visibility: + type: string + example: API_LEVEL + enum: + - OWNER_ONLY + - PRIVATE + - API_LEVEL + apiName: + type: string + description: The name of the associated API + example: TestAPI + apiVersion: + type: string + description: The version of the associated API + example: 1.0.0 + apiProvider: + type: string + example: admin + apiUUID: + type: string + associatedType: + type: string + MockResponsePayloadList: + title: Mock Response Payload list + type: object + properties: + list: + type: array + items: + $ref: '#/components/schemas/MockResponsePayloadInfo' + MockResponsePayloadInfo: + title: Mock Response Payload info object + type: object + properties: + path: + type: string + description: path of the resource + example: /menu + content: + type: string + description: new modified code + example: "var accept = \"\\\"\"+mc.getProperty('AcceptHeader')+\"\\\"\"\ + ;\nvar responseCode = mc.getProperty('query.param.responseCode');\nvar\ + \ responseCodeStr = \"\\\"\"+responseCode+\"\\\"\";\nvar responses = [];\n\ + \nif (!responses[200]) {\n responses [200] = [];\n}\nresponses[200][\"\ + application/json\"] = \n[ {\n \"price\" : \"string\",\n \"description\"\ + \ : \"string\",\n \"name\" : \"string\",\n \"image\" : \"string\"\n\ + } ]\n\n/*if (!responses[304]) {\n responses[304] = [];\n}\nresponses[304][\"\ + application/(json or xml)\"] = {}/<>*/\n\nif (!responses[406]) {\n responses\ + \ [406] = [];\n}\nresponses[406][\"application/json\"] = \n{\n \"message\"\ + \ : \"string\",\n \"error\" : [ {\n \"message\" : \"string\",\n \ + \ \"code\" : 0\n } ],\n \"description\" : \"string\",\n \"code\" :\ + \ 0,\n \"moreInfo\" : \"string\"\n}\n\nresponses[501] = [];\nresponses[501][\"\ + application/json\"] = {\n\"code\" : 501,\n\"description\" : \"Not Implemented\"\ + }\nresponses[501][\"application/xml\"] = 501Not\ + \ Implemented;\n\nif (!responses[responseCode])\ + \ {\n responseCode = 501;\n}\n\nif (responseCode == null) {\n responseCode\ + \ = 200;\n responseCodeStr = \"200\";\n}\n\nif (accept == null || !responses[responseCode][accept])\ + \ {\n accept = \"application/json\";\n}\n\nif (accept === \"application/json\"\ + ) {\n mc.setProperty('CONTENT_TYPE', 'application/json');\n mc.setProperty('HTTP_SC',\ + \ responseCodeStr);\n mc.setPayloadJSON(responses[responseCode][\"application/json\"\ + ]);\n} else if (accept === \"application/xml\") {\n mc.setProperty('CONTENT_TYPE',\ + \ 'application/xml');\n mc.setProperty('HTTP_SC', responseCodeStr);\n\ + \ mc.setPayloadXML(responses[responseCode][\"application/xml\"]);\n}" + verb: + type: string + example: POST + ResourcePolicyList: + title: Resource policy List + type: object + properties: + list: + type: array + items: + $ref: '#/components/schemas/ResourcePolicyInfo' + count: + type: integer + description: | + Number of policy resources returned. + example: 1 + ResourcePolicyInfo: + title: Resource policy Info object with conversion policy resource details. + type: object + properties: + id: + type: string + description: | + UUID of the resource policy registry artifact + readOnly: true + example: 01234567-0123-0123-0123-012345678901 + httpVerb: + type: string + description: HTTP verb used for the resource path + example: get + resourcePath: + type: string + description: A string that represents the resource path of the api for the + related resource policy + example: checkPhoneNumber + content: + type: string + description: The resource policy content + example:
+ Settings: + title: SettingsDTO + type: object + properties: + devportalUrl: type: string - example: ["http","https"] - tags: - type: array - description: Search keywords related to the API - items: + description: The Developer Portal URL + example: https://localhost:9443/devportal + environment: + type: array + items: + $ref: '#/components/schemas/Environment' + scopes: + type: array + example: + - apim:api_create + - apim:api_publish + items: + type: string + monetizationAttributes: + type: array + example: [] + items: + $ref: '#/components/schemas/MonetizationAttribute' + securityAuditProperties: + type: object + properties: {} + externalStoresEnabled: + type: boolean + description: | + Is External Stores configuration enabled + example: true + docVisibilityEnabled: + type: boolean + description: | + Is Document Visibility configuration enabled + example: false + crossTenantSubscriptionEnabled: + type: boolean + description: | + Is Cross Tenant Subscriptions Enabled + example: false + default: false + deployments: + type: array + items: + $ref: '#/components/schemas/Deployments' + SecurityAuditAttribute: + title: SecurityAuditAttributeDTO + type: object + properties: + isGlobal: + type: boolean + example: false + overrideGlobal: + type: boolean + example: false + apiToken: type: string - example: ["substract","add"] - tiers: - type: array - description: The subscription tiers selected for the particular API - items: + example: b1267ytf-b7gc-4aee-924d-ece81241efec + collectionId: type: string - example: ["Unlimited"] - apiLevelPolicy: - description: The policy selected for the particular API - type: string - example: "Unlimited" - maxTps: - properties: - production: - type: integer - format: int64 - example: 1000 - sandbox: - type: integer - format: int64 - example: 1000 - thumbnailUri: - type: string - example: "/apis/01234567-0123-0123-0123-012345678901/thumbnail" - visibility: - type: string - description: The visibility level of the API. Accepts one of the following. PUBLIC, PRIVATE, RESTRICTED OR CONTROLLED. - enum: - - PUBLIC - - PRIVATE - - RESTRICTED - - CONTROLLED - example: PUBLIC - visibleRoles: - type: array - description: The user roles that are able to access the API - items: - type: string - example: [] - endpointConfig: - type: string - example: "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":{\"suspendErrorCode\":\"101000\",\"suspendDuration\":\"2000\",\"suspendMaxDuration\":\"3\",\"factor\":\"2\",\"retryErroCode\":\"101000\",\"retryTimeOut\":\"4\",\"retryDelay\":\"1000\",\"actionSelect\":\"fault\",\"actionDuration\":\"3000\"}},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}" - endpointSecurity: - properties: - type: + example: 456ef957-5a79-449f-83y3-9027945d3c60 + baseUrl: + type: string + WSDLInfo: + title: WSDL information of the API. This is only available if the API is a SOAP + API. + type: object + properties: + type: + type: string + description: Indicates whether the WSDL is a single WSDL or an archive in + ZIP format + enum: + - WSDL + - ZIP + Pagination: + title: Pagination + type: object + properties: + offset: + type: integer + example: 0 + limit: + type: integer + example: 1 + total: + type: integer + example: 10 + next: + type: string + description: | + Link to the next subset of resources qualified. + Empty if no more resources are to be returned. + previous: + type: string + description: | + Link to the previous subset of resources qualified. + Empty if current subset is the first subset returned. + MonetizationAttribute: + title: Monetization attribute object + type: object + properties: + required: + type: boolean + description: | + Is attribute required + example: true + name: + type: string + description: | + Name of the attribute + displayName: + type: string + description: | + Display name of the attribute + description: + type: string + description: | + Description of the attribute + hidden: + type: boolean + description: | + Is attribute hidden + default: + type: string + description: | + Default value of the attribute + Tenant: + title: Tenant + type: object + properties: + domain: + type: string + description: tenant domain + example: wso2.com + status: + type: string + description: current status of the tenant active/inactive + example: active + TenantList: + title: Tenant list + type: object + properties: + count: + type: integer + description: | + Number of tenants returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Tenant' + pagination: + $ref: '#/components/schemas/Pagination' + AlertTypesList: + title: Alert Types List + type: object + properties: + count: + type: integer + description: The number of alerts + example: 3 + alerts: + type: array + items: + $ref: '#/components/schemas/AlertType' + AlertType: + title: Alert Type + type: object + properties: + id: + type: integer + description: The alert Id + example: 1 + name: + type: string + description: The name of the alert. + example: AbnormalRequestTime + requireConfiguration: + type: boolean + description: Whether the alert type require additional configurations. + example: true + Alert: + title: Alert + type: object + properties: + id: + type: integer + description: The alert Id + example: 1 + name: + type: string + description: The name of the alert. + example: AbnormalRequestsPerMin + configuration: + type: array + items: + $ref: '#/components/schemas/AlertConfig' + AlertsInfo: + title: Alerts Info + type: object + properties: + alerts: + type: array + items: + $ref: '#/components/schemas/Alert' + emailList: + type: array + items: type: string - example: basic - description: Accepts one of the following, basic or digest. - enum: - - basic - - digest - username: + AlertsInfoResponse: + title: Alerts Info Response + type: object + properties: + alerts: + type: array + items: + $ref: '#/components/schemas/Alert' + emailList: + type: array + items: type: string - example: admin - password: + failedConfigurations: + type: array + items: + $ref: '#/components/schemas/AlertConfig' + AlertConfigList: + title: Alert Configuration List + type: object + properties: + count: + type: integer + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/AlertConfig' + AlertConfig: + title: Alert Configuration + type: object + properties: + configurationId: + type: string + description: The alert config subscription id. + example: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K + configuration: + type: object + additionalProperties: type: string - example: password - gatewayEnvironments: - description: | - Comma separated list of gateway environments. - type: string - example: Production and Sandbox - sequences: - type: array - items: - $ref: '#/definitions/Sequence' - example: [] - subscriptionAvailability: - type: string - description: The subscription availability. Accepts one of the following. current_tenant, all_tenants or specific_tenants. - enum: - - current_tenant - - all_tenants - - specific_tenants - example: current_tenant - subscriptionAvailableTenants: - type: array - items: - type: string - example: ["tenant1", "tenant2"] + description: The config parameters. + example: + apiName: PizzaShackAPI + apiVersion: 1.0.0 + applicationName: DefaultApplication + requestConunt: "12" + AlertConfigInfo: + title: Alert Configuration Info + type: object additionalProperties: - type: object - description : Map of custom properties of API - accessControl: type: string - description: | - Is the API is restricted to certain set of publishers or creators or is it visible to all the - publishers and creators. If the accessControl restriction is none, this API can be modified by all the - publishers and creators, if not it can only be viewable/modifiable by certain set of publishers and creators, - based on the restriction. enum: - - NONE - - RESTRICTED - accessControlRoles: - type: array - description: The user roles that are able to view/modify as API publisher or creator. - items: - type: string - example: [admin] - businessInformation: + description: The config parameters. + example: + apiName: PizzaShackAPI + apiVersion: 1.0.0 + applicationName: DefaultApplication + requestConunt: "12" + APICategory: + title: API Category + required: + - name + type: object + properties: + id: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: Finance + description: + type: string + example: Finance related APIs + APICategoryList: + title: API Category List + type: object + properties: + count: + type: integer + description: | + Number of API categories returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/APICategory' + KeyManagerInfo: + title: Key Manager Info + required: + - name + - type + type: object + properties: + id: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: WSO2 IS + displayName: + type: string + description: | + display name of Keymanager + example: Keymanager1 + type: + type: string + example: IS + description: + type: string + example: This is a key manager for Developers + enabled: + type: boolean + example: true + additionalProperties: + type: array + items: + type: object + properties: {} + KeyManagerList: + title: Key Manager List + type: object + properties: + count: + type: integer + description: | + Number of Key managers returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/KeyManagerInfo' + DeploymentList: + title: Deployment List + type: object + properties: + count: + type: integer + description: | + Number of deployment clusters returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/Deployments' + Deployments: + title: Deployments + required: + - clusters + - name + type: object + properties: + name: + type: string + example: Kubernetes + clusters: + type: array + items: + $ref: '#/components/schemas/DeploymentClusterInfo' + DeploymentClusterInfo: + title: DeploymentClusterInfo + required: + - accessURL + - clusterName + - displayName + - properties + type: object + properties: + clusterName: + type: string + example: minikube + accessURL: + type: string + example: https://api.com + displayName: + type: string + example: kubernetes-minikube properties: - businessOwner: - type: string - example: businessowner - businessOwnerEmail: + type: object + additionalProperties: type: string - example: businessowner@wso2.com - technicalOwner: - type: string - example: technicalowner - technicalOwnerEmail: + DeploymentStatusList: + title: DeploymentStatus List + type: object + properties: + count: + type: integer + description: | + Status of the deployments returned. + example: 1 + list: + type: array + items: + $ref: '#/components/schemas/DeploymentStatus' + DeploymentStatus: + title: DeploymentStatus + required: + - clusters + - type + type: object + properties: + type: + type: string + example: Kubernetes + clusters: + type: array + items: + $ref: '#/components/schemas/DeploymentClusterStatus' + DeploymentClusterStatus: + title: DeploymentClusterStatus + required: + - clusterName + - healthStatus + - podsRunning + type: object + properties: + clusterName: + type: string + example: Minikube + podsRunning: + type: integer + healthStatus: + type: array + items: + $ref: '#/components/schemas/PodStatus' + DeploymentEnvironments: + title: DeploymentEnvironments + required: + - clusterName + - type + type: object + properties: + type: + type: string + example: Kubernetes + clusterName: + type: array + example: + - minikube + items: type: string - example: technicalowner@wso2.com - corsConfiguration: - description: | - CORS configuration for the API - properties: - corsConfigurationEnabled: - type: boolean - default: false - accessControlAllowOrigins: - type: array - items: - type: string - accessControlAllowCredentials: - type: boolean - default: false - accessControlAllowHeaders: - type: array - items: + PodStatus: + title: PodStatus + required: + - name + - ready + - status + type: object + properties: + name: + type: string + example: petStore-677bb7cc65-shb2f + ready: + type: string + example: 1/1 + status: + type: string + example: running + creationTimestamp: + type: string + example: 2020-05-12T06:12:00Z + AsyncAPISpecificationValidationResponse: + title: AsyncAPI Specification Validation Response + required: + - isValid + type: object + properties: + isValid: + type: boolean + description: + This attribute declares whether this definition is valid or not. + example: true + content: + type: string + description: + AsyncAPI specification content + info: + type: object + properties: + name: type: string - accessControlAllowMethods: - type: array - items: + example: Streetlights + version: type: string - -#----------------------------------------------------- -# The Application resource -#----------------------------------------------------- - Application: - title: Application - required: - - name - - throttlingTier - properties: - applicationId: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorApp - subscriber: - type: string - example: admin - throttlingTier: - type: string - example: Unlimited - description: - type: string - example: Sample calculator application - groupId: - type: string - example: "" - -#----------------------------------------------------- -# The Document List resource -#----------------------------------------------------- - DocumentList: - title: Document List - properties: - count: + example: 1.0.0 + context: + type: string + example: /streetlights + description: + type: string + example: A sample API that uses a streetlights as an example to demonstrate AsyncAPI specifications + asyncAPIVersion: + type: string + example: 2.0 + endpoints: + type: array + description: + contains host/servers specified in the AsyncAPI file/URL + items: + type: string + example: "https://localhost:9443/am/sample/pizzashack/v1/api/" + description: + API definition information + errors: + type: array + description: + If there are more than one error list them out. + For example, list out validation error by each field. + items: + $ref: '#/components/schemas/ErrorListItem' + responses: + BadRequest: + description: Bad Request. Invalid request or validation error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: 400 + message: Bad Request + description: Invalid request or validation error + moreInfo: "" + error: [] + Conflict: + description: Conflict. Specified resource already exists. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: 409 + message: Conflict + description: Specified resource already exists + moreInfo: "" + error: [] + Forbidden: + description: Forbidden. The request must be conditional but no condition has + been specified. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: 403 + message: Forbidden + description: The request must be conditional but no condition has been + specified + moreInfo: "" + error: [] + InternalServerError: + description: Internal Server Error. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: 500 + message: Internal Server Error + description: The server encountered an internal error. Please contact + administrator. + moreInfo: "" + error: [] + NotAcceptable: + description: Not Acceptable. The requested media type is not supported. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: 406 + message: Not Acceptable + description: The requested media type is not supported + moreInfo: "" + error: [] + NotFound: + description: Not Found. The specified resource does not exist. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: 404 + message: Not Found + description: The specified resource does not exist + moreInfo: "" + error: [] + PreconditionFailed: + description: Precondition Failed. The request has not been performed because + one of the preconditions is not met. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: 412 + message: Precondition Failed + description: The request has not been performed because one of the preconditions + is not met + moreInfo: "" + error: [] + Unauthorized: + description: Unauthorized. The user is not authorized. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: 401 + message: Unauthorized + description: The user is not authorized + moreInfo: "" + error: [] + UnsupportedMediaType: + description: Unsupported Media Type. The entity of the request was not in a + supported format. + content: + application/json: + schema: + $ref: '#/components/schemas/Error' + example: + code: 415 + message: Unsupported media type + description: The entity of the request was not in a supported format + moreInfo: "" + error: [] + parameters: + replyLimit: + name: replyLimit + in: query + description: | + Maximum size of replies array to return. + schema: type: integer - description: | - Number of Documents returned. - example: 1 - next: - type: string - description: | - Link to the next subset of resources qualified. - Empty if no more resources are to be returned. - example: "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=2" - previous: + default: 25 + replyOffset: + name: replyOffset + in: query + description: | + Starting point within the complete list of replies. + schema: + type: integer + default: 0 + commentId: + name: commentId + in: path + description: | + Comment Id + required: true + schema: type: string - description: | - Link to the previous subset of resources qualified. - Empty if current subset is the first subset returned. - example: "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=0" - list: - type: array - items: - $ref: '#/definitions/Document' - -#----------------------------------------------------- -# The Document resource -#----------------------------------------------------- - Document: - title: Document - required: - - name - - type - - sourceType - - visibility - properties: - documentId: + parentCommentID: + name: replyTo + in: query + description: | + ID of the perent comment. + schema: type: string - example: 01234567-0123-0123-0123-012345678901 - name: + includeCommenterInfo: + name: includeCommenterInfo + in: query + description: | + Whether we need to display commentor details. + schema: + type: boolean + default : false + apiId: + name: apiId + in: path + description: | + **API ID** consisting of the **UUID** of the API. + required: true + schema: type: string - example: CalculatorDoc - type: + endpointId: + name: endpointId + in: path + description: | + **Endpoint ID** consisting of the **UUID** of the Endpoint**. + required: true + schema: type: string - enum: - - HOWTO - - SAMPLES - - PUBLIC_FORUM - - SUPPORT_FORUM - - API_MESSAGE_FORMAT - - SWAGGER_DOC - - OTHER - example: HOWTO - summary: + apiId-Q: + name: apiId + in: query + description: | + **API ID** consisting of the **UUID** of the API. + The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. + Should be formatted as **provider-name-version**. + required: true + schema: type: string - example: "Summary of Calculator Documentation" - sourceType: + apiId-Q-Opt: + name: apiId + in: query + description: | + **API ID** consisting of the **UUID** of the API. + The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. + Should be formatted as **provider-name-version**. + schema: type: string - enum: - - INLINE - - URL - - FILE - example: INLINE - sourceUrl: + labelType-Q: + name: labelType + in: query + description: | + **API ID** consisting of the **UUID** of the API. + The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. + Should be formatted as **provider-name-version**. + schema: type: string - example: "" - otherTypeName: + name: + name: name + in: path + description: | + Name of the API + required: true + schema: type: string - example: "" - visibility: + version: + name: version + in: path + description: | + Version of the API + required: true + schema: type: string - enum: - - OWNER_ONLY - - PRIVATE - - API_LEVEL - example: API_LEVEL - -#----------------------------------------------------- -# The Mediation List resource -#----------------------------------------------------- - mediationList: - title: Mediation List - properties: - count: - type: integer - description: | - Number of mediation sequences returned. - example: 1 - next: + apiName-Q: + name: name + in: query + description: | + Name of the API + schema: type: string - description: | - Link to the next subset of sequences qualified. - Empty if no more sequences are to be returned. - example: "" - previous: + apiVersion-Q: + name: version + in: query + description: | + Version of the API + schema: type: string - description: | - Link to the previous subset of sequences qualified. - Empty if current subset is the first subset returned. - example: "" - list: - type: array - items: - $ref: '#/definitions/MediationInfo' - -#----------------------------------------------------- -# The MediationInfo resource -#----------------------------------------------------- - MediationInfo: - title: MediationInfo - required: - - name - - type - - id - properties: - name: + apiProvider-Q: + name: providerName + in: query + description: | + Provider name of the API + schema: type: string - example: json_fault.xml - id: + documentId: + name: documentId + in: path + description: | + Document Identifier + required: true + schema: type: string - example: 01234567-0123-0123-0123-012345678901 - type: + applicationId: + name: applicationId + in: path + description: | + **Application Identifier** consisting of the UUID of the Application. + required: true + schema: type: string - enum: - - in - - out - - fault - example: in -#----------------------------------------------------- -# The Mediation resource -#----------------------------------------------------- - Mediation: - title: Mediation - required: - - name - - type - - config - properties: - id: + subscriptionId: + name: subscriptionId + in: path + description: | + Subscription Id + required: true + schema: type: string - example: 01234567-0123-0123-0123-012345678901 - name: + mediationPolicyId: + name: mediationPolicyId + in: path + description: | + Mediation policy Id + required: true + schema: type: string - example: json_fault.xml - type: + resourcePolicyId: + name: resourcePolicyId + in: path + description: | + registry resource Id + required: true + schema: type: string - enum: - - in - - out - - fault - example: in - config: + subscriptionId-Q: + name: subscriptionId + in: query + description: | + Subscription Id + required: true + schema: type: string - example: ' - - - - ' - -#----------------------------------------------------- -# The MediationInfo resource -#----------------------------------------------------- - Wsdl: - title: Wsdl - required: - - name - properties: - name: - type: string - example: admin--calculatorAPI2.0.wsdl - wsdlDefinition: - type: string + # API Revision Identifier + # Specified as part of the path expression + revisionId: + name: revisionId + in: path + description: | + Revision ID of an API + required: true + schema: + type: string -# The Tier List resource -#----------------------------------------------------- - TierList: - title: Tier List - properties: - count: - type: integer - description: | - Number of Tiers returned. - example: 1 - next: + # API Revision Identifier + # Specified as part of the query string + revisionId-Q: + name: revisionId + in: query + description: | + Revision ID of an API + schema: type: string - description: | - Link to the next subset of resources qualified. - Empty if no more resources are to be returned. - example: "/tiers/api?limit=1&offset=2" - previous: + revisionNum-Q: + name: revisionNumber + in: query + description: | + Revision Number of an API + schema: type: string - description: | - Link to the previous subset of resources qualified. - Empty if current subset is the first subset returned. - example: "/tiers/api?limit=1&offset=0" - list: - type: array - items: - $ref: '#/definitions/Tier' - -#----------------------------------------------------- -# The Tier resource -#----------------------------------------------------- - Tier: - title: Tier - required: - - name - - tierPlan - - requestCount - - unitTime - - stopOnQuotaReach - properties: - name: + policyName: + name: policyName + in: path + description: | + Tier name + required: true + schema: type: string - example: Platinum - description: + policyName-Q: + name: policyName + in: query + description: | + Name of the policy + required: true + schema: type: string - example: "Allows 50 request(s) per minute." - tierLevel: + policyLevel: + name: policyLevel + in: path + description: | + List API or Application or Resource type policies. + required: true + schema: type: string enum: - api - - application - - resource - example: api - attributes: - description: | - Custom attributes added to the tier policy - type: object - additionalProperties: - type: string - example: {} - requestCount: - description: | - Maximum number of requests which can be sent within a provided unit time - type: integer - format: int64 - example: 50 - unitTime: - type: integer - format: int64 - example: 60000 - timeUnit: - type: string - example: "min" - tierPlan: - description: | - This attribute declares whether this tier is available under commercial or free - type: string - enum: - - FREE - - COMMERCIAL - example: FREE - stopOnQuotaReach: - description: | - By making this attribute to false, you are capabale of sending requests - even if the request count exceeded within a unit time - type: boolean - example: true - -#----------------------------------------------------- -# The Tier Permission resource -#----------------------------------------------------- - TierPermission: - title: tierPermission - required: - - permissionType - - roles - properties: - permissionType: + - subcription + policyLevel-Q: + name: policyLevel + in: query + description: | + List API or Application or Resource type policies. + required: true + schema: type: string enum: - - allow - - deny - example: deny - roles: - type: array - items: - type: string - example: ["Internal/everyone"] - -#----------------------------------------------------- -# The Subscription List resource -#----------------------------------------------------- - SubscriptionList: - title: Subscription List - properties: - count: + - api + - subcription + limit: + name: limit + in: query + description: | + Maximum size of resource array to return. + schema: type: integer - description: | - Number of Subscriptions returned. - example: 1 - next: - type: string - description: | - Link to the next subset of resources qualified. - Empty if no more resources are to be returned. - example: "/subscriptions?limit=1&offset=2&apiId=01234567-0123-0123-0123-012345678901&groupId=" - previous: - type: string - description: | - Link to the previous subset of resources qualified. - Empty if current subset is the first subset returned. - example: "/subscriptions?limit=1&offset=0&apiId=01234567-0123-0123-0123-012345678901&groupId=" - list: - type: array - items: - $ref: '#/definitions/Subscription' - -#----------------------------------------------------- -# The Subscription resource -#----------------------------------------------------- - Subscription: - title: Subscription - required: - - applicationId - - apiIdentifier - - tier - properties: - subscriptionId: - type: string - example: 01234567-0123-0123-0123-012345678901 - applicationId: - type: string - example: 01234567-0123-0123-0123-012345678901 - apiIdentifier: - type: string - example: 01234567-0123-0123-0123-012345678901 - tier: - type: string - example: Unlimited - status: - type: string - enum: - - BLOCKED - - PROD_ONLY_BLOCKED - - UNBLOCKED - - ON_HOLD - - REJECTED - example: UNBLOCKED - -#----------------------------------------------------- -# The Extended Subscription resource -#----------------------------------------------------- - ExtendedSubscription: - title: Subscription with Ext. Workflow Reference - required: - - workflowId - allOf: - - $ref: '#/definitions/Subscription' - - properties: - workflowId: - type: string - example: 01234567-0123-0123-0123-012345678901 - -#----------------------------------------------------- -# The Sequence resource -#----------------------------------------------------- - Sequence: - title: Sequence - required: - - name - properties: - name: - type: string - example: log_in_message - type: - type: string - example: in - id: + default: 25 + Accept: + name: Accept + in: header + description: | + Media types acceptable for the response. Default is application/json. + schema: type: string - example: 69ea3fa6-55c6-472e-896d-e449dd34a824 - shared: - type: boolean - example: true - -#----------------------------------------------------- -# The Error resource -#----------------------------------------------------- - Error: - title: Error object returned with 4XX HTTP status - required: - - code - - message - properties: - code: + default: application/json + offset: + name: offset + in: query + description: | + Starting point within the complete list of items qualified. + schema: type: integer - format: int64 - message: - type: string - description: Error message. - description: - type: string - description: | - A detail description about the error message. - moreInfo: + default: 0 + If-None-Match: + name: If-None-Match + in: header + description: | + Validator for conditional requests; based on the ETag of the formerly retrieved + variant of the resource. + schema: type: string - description: | - Preferably an url with more details about the error. - error: - type: array - description: | - If there are more than one error list them out. - For example, list out validation errors by each field. - items: - $ref: '#/definitions/ErrorListItem' - -#----------------------------------------------------- -# The Error List Item resource -#----------------------------------------------------- - ErrorListItem: - title: Description of individual errors that may have occurred during a request. - required: - - code - - message - properties: - code: + If-Match: + name: If-Match + in: header + description: | + Validator for conditional requests; based on ETag. + schema: type: string - message: + scopeName: + name: scopeId + in: path + description: | + Scope name + required: true + schema: type: string - description: | - Description about individual errors occurred - -#----------------------------------------------------- -# The Environment resource -#----------------------------------------------------- - Environment: - title: Environment - required: - - name - - type - - serverUrl - - endpoints - - showInApiConsole - properties: - name: + scopeId: + name: scopeId + in: path + description: | + Scope Id consisting the UUID of the shared scope + required: true + schema: type: string - example: Production and Sandbox - type: + expand: + name: expand + in: query + description: | + Defines whether the returned response should contain full details of API + schema: + type: boolean + threatProtectionPolicyId: + name: policyId + in: path + description: | + The UUID of a Policy + required: true + schema: type: string - example: hybrid - serverUrl: + roleId: + name: roleId + in: path + description: | + The Base 64 URL encoded role name with domain. If the given role is in secondary user-store, role ID should be + derived as Base64URLEncode({user-store-name}/{role-name}). If the given role is in PRIMARY user-store, role ID + can be derived as Base64URLEncode(role-name) + required: true + schema: type: string - example: "https://localhost:9443/services/" - showInApiConsole: - type: boolean - example: true - endpoints: - $ref: '#/definitions/EnvironmentEndpoints' - -#----------------------------------------------------- -# The Environment List resource -#----------------------------------------------------- - EnvironmentList: - title: Environment List - properties: - count: - type: integer - description: | - Number of Environments returned. - example: 1 - list: - type: array - items: - $ref: '#/definitions/Environment' - - -#----------------------------------------------------- -# The Environment Endpoint resource -#----------------------------------------------------- - EnvironmentEndpoints : - title: Environment Endpoints - properties: - http: + requestedTenant: + name: X-WSO2-Tenant + in: header + description: | + For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be + retirieved from. + schema: type: string - description: HTTP environment URL - example: "http://localhost:8280" - https: + apiProductId: + name: apiProductId + in: path + description: | + **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. + required: true + schema: type: string - description: HTTPS environment URL - example: "https://localhost:8243" - -#----------------------------------------------------- -# The File Information resource -#----------------------------------------------------- - FileInfo : - title: File Information including meta data - properties: - relativePath: + x-encoded: true + x-encoded: true + tenantDomain: + name: tenantDomain + in: path + description: | + The domain of a specific tenant + required: true + schema: type: string - description: relative location of the file (excluding the base context and host of the Publisher API) - example: "apis/01234567-0123-0123-0123-012345678901/thumbnail" - mediaType: + alertType: + name: alertType + in: path + description: The alert type. + required: true + schema: type: string - description: media-type of the file - example: "image/jpeg" - - -#----------------------------------------------------- -# The workflow response resource -#----------------------------------------------------- - Workflow: - title: workflow - required: - - status - properties: - status: - description: | - This attribute declares whether this workflow task is approved or rejected. + configurationId: + name: configurationId + in: path + description: The alert configuration id. + required: true + schema: type: string - enum: - - APPROVED - - REJECTED - example: APPROVED - attributes: - description: | - Custom attributes to complete the workflow task - type: object - additionalProperties: - type: string - example: {} - description: + tierQuotaType: + name: tierQuotaType + description: Filter the subscription base on tier quota type + in: query + schema: type: string - example: "Approve workflow request." \ No newline at end of file + requestBodies: + threatProtectionPolicy: + description: | + Threat protection policy request parameter + content: + application/json: + schema: + $ref: '#/components/schemas/ThreatProtectionPolicy' + required: true + securitySchemes: + OAuth2Security: + type: oauth2 + flows: + password: + tokenUrl: https://localhost:9443/oauth2/token + scopes: + openid: Authorize access to user details + apim:api_view: View API + apim:api_create: Create API + apim:api_delete: Delete API + apim:api_publish: Publish API + apim:subscription_view: View Subscription + apim:subscription_block: Block Subscription + apim:external_services_discover: Discover External Services + apim:threat_protection_policy_create: Create threat protection policies + apim:threat_protection_policy_manage: Update and delete threat protection policies + apim:document_create: Create API documents + apim:document_manage: Update and delete API documents + apim:mediation_policy_view: View mediation policies + apim:mediation_policy_create: Create mediation policies + apim:mediation_policy_manage: Update and delete mediation policies + apim:client_certificates_view: View client certificates + apim:client_certificates_add: Add client certificates + apim:client_certificates_update: Update and delete client certificates + apim:ep_certificates_view: View backend endpoint certificates + apim:ep_certificates_add: Add backend endpoint certificates + apim:ep_certificates_update: Update and delete backend endpoint certificates + apim:publisher_settings: Retrieve store settings + apim:pub_alert_manage: Get/ subscribe/ configure publisher alerts + apim:shared_scope_manage: Manage shared scopes + apim:app_import_export: Import and export applications related operations + apim:api_import_export: Import and export APIs related operations + apim:api_product_import_export: Import and export API Products related operations diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index f033de1d89..ce938982e9 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -43,10 +43,22 @@ org.eclipse.osgi org.eclipse.osgi + + + javax.ws.rs + javax.ws.rs + + org.eclipse.osgi org.eclipse.osgi.services + + + javax.ws.rs + javax.ws.rs + + org.testng @@ -55,62 +67,166 @@ org.wso2.tomcat tomcat + + + javax.ws.rs + javax.ws.rs + + org.wso2.tomcat tomcat-servlet-api + + + javax.ws.rs + javax.ws.rs + + org.wso2.carbon org.wso2.carbon.core + + + javax.ws.rs + javax.ws.rs + + org.wso2.carbon org.wso2.carbon.logging + + + javax.ws.rs + javax.ws.rs + + org.wso2.carbon org.wso2.carbon.utils + + + javax.ws.rs + javax.ws.rs + + org.apache.axis2.wso2 axis2 + + + javax.ws.rs + javax.ws.rs + + com.google.code.gson gson + + + javax.ws.rs + javax.ws.rs + + org.wso2.orbit.org.scannotation scannotation + + + javax.ws.rs + javax.ws.rs + + javax.ws.rs jsr311-api + + + javax.ws.rs + javax.ws.rs + + org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations + + + javax.ws.rs + javax.ws.rs + + org.wso2.carbon.governance org.wso2.carbon.governance.api + + + javax.ws.rs + javax.ws.rs + + org.wso2.carbon.governance org.wso2.carbon.governance.lcm + + + javax.ws.rs + javax.ws.rs + + javax.ws.rs javax.ws.rs-api + + + javax.ws.rs + javax.ws.rs + + org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.common + + + javax.ws.rs + javax.ws.rs + + - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.integration.client + org.wso2.carbon.apimgt + org.wso2.carbon.apimgt.api + provided + 9.0.5 + + + javax.ws.rs + javax.ws.rs + + + + + org.wso2.carbon.apimgt + org.wso2.carbon.apimgt.impl + 9.0.5 + provided + + + javax.ws.rs + javax.ws.rs + + com.h2database.wso2 @@ -144,70 +260,62 @@ org.wso2.carbon.apimgt.webapp.publisher.* - org.osgi.framework, - org.osgi.service.component, - org.apache.commons.logging, - javax.servlet, - javax.xml.*, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - com.google.gson.*, - org.apache.catalina, - org.apache.catalina.core, - org.apache.axis2.*;version="${axis2.osgi.version.range}", - org.wso2.carbon.core, - org.apache.commons.lang, - org.wso2.carbon.utils, - org.wso2.carbon.apimgt.annotations.*, - org.wso2.carbon.governance.lcm.util.*, - org.wso2.carbon.registry.core.*, - io.swagger.annotations, - javax.net.ssl, - org.scannotation, - org.scannotation.archiveiterator, - org.w3c.dom, - org.wso2.carbon.apimgt.integration.client.*, - org.wso2.carbon.context, - org.wso2.carbon.core.util, - org.wso2.carbon.user.api, - org.wso2.carbon.user.core.*, - org.wso2.carbon.utils.multitenancy, - org.wso2.carbon.apimgt.integration.generated.client.publisher.api, - org.wso2.carbon.apimgt.integration.generated.client.publisher.model + com.google.gson;version="2.3",com.google.gson.reflect; + version="2.3",io.swagger.annotations,javax.servlet;version="2.6",javax.xml,javax.xml.bind,javax.xml.bind.annotat + ion,javax.xml.parsers,org.apache.catalina;version="9.0",org.apache.ca + talina.core;version="9.0",org.apache.commons.logging;version="1.2",org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}",org.scannotation;version="1.0",org.scannotation.archiveiterator;ve + rsion="1.0",org.w3c.dom,org.wso2.carbon.apimgt.annotations.api,org.ws + o2.carbon.apimgt.api,org.wso2.carbon.apimgt.api.model,org.wso2.carbon + .apimgt.impl,org.wso2.carbon.apimgt.webapp.publisher,org.wso2.carbon. + apimgt.webapp.publisher.config,org.wso2.carbon.apimgt.webapp.publishe + r.dto,org.wso2.carbon.apimgt.webapp.publisher.exception,org.wso2.carb + on.apimgt.webapp.publisher.lifecycle.listener,org.wso2.carbon.apimgt. + webapp.publisher.lifecycle.util,org.wso2.carbon.base;version="1.0",or + g.wso2.carbon.context;version="4.6",org.wso2.carbon.core;version="4.6 + ",org.wso2.carbon.core.util;version="4.6",org.wso2.carbon.registry.co + re.service;version="1.0",org.wso2.carbon.user.api;version="1.0",org.w + so2.carbon.user.core.service;version="4.6",org.wso2.carbon.user.core. + tenant;version="4.6",org.wso2.carbon.utils;version="4.6",org.wso2.car + bon.utils.multitenancy;version="4.6" - javax.ws.rs-api, - scribe;scope=compile|runtime;inline=false; + + jsr311-api;scope=compile|runtime;inline=false + - * + - - org.jacoco - jacoco-maven-plugin - - ${basedir}/target/coverage-reports/jacoco-unit.exec - - - - jacoco-initialize - - prepare-agent - - - - jacoco-site - test - - report - - - ${basedir}/target/coverage-reports/jacoco-unit.exec - ${basedir}/target/coverage-reports/site - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java index 2fe35e472b..a6b98ad438 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -18,15 +18,34 @@ */ package org.wso2.carbon.apimgt.webapp.publisher; -import feign.FeignException; -import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.*; -import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient; +import org.wso2.carbon.apimgt.api.APIManagementException; +import org.wso2.carbon.apimgt.api.APIProvider; +import org.wso2.carbon.apimgt.api.FaultGatewaysException; +import org.wso2.carbon.apimgt.api.model.API; +import org.wso2.carbon.apimgt.api.model.APIIdentifier; +import org.wso2.carbon.apimgt.api.model.APIRevision; +import org.wso2.carbon.apimgt.api.model.APIRevisionDeployment; +import org.wso2.carbon.apimgt.api.model.CORSConfiguration; +import org.wso2.carbon.apimgt.api.model.Scope; +import org.wso2.carbon.apimgt.api.model.Tier; +import org.wso2.carbon.apimgt.api.model.URITemplate; +import org.wso2.carbon.apimgt.impl.APIConstants; +import org.wso2.carbon.apimgt.impl.APIManagerFactory; import org.wso2.carbon.apimgt.webapp.publisher.config.WebappPublisherConfig; +import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiUriTemplate; import org.wso2.carbon.apimgt.webapp.publisher.exception.APIManagerPublisherException; -import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; -import java.util.*; + +import java.util.ArrayList; +import java.util.Arrays; +import java.util.HashSet; +import java.util.Iterator; +import java.util.List; +import java.util.Set; + +//import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.*; +//import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient; /** * This class represents the concrete implementation of the APIPublisherService that corresponds to providing all @@ -39,6 +58,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { private static final String PUBLISHED_STATUS = "PUBLISHED"; private static final String CREATED_STATUS = "CREATED"; private static final String PUBLISH_ACTION = "Publish"; + public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance(); @Override public void publishAPI(APIConfig apiConfig) throws APIManagerPublisherException { @@ -47,99 +67,127 @@ public class APIPublisherServiceImpl implements APIPublisherService { PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true); PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(apiConfig.getOwner()); try { - PublisherClient publisherClient = APIPublisherDataHolder.getInstance().getIntegrationClientService() - .getPublisherClient(); + APIProvider apiProvider = API_MANAGER_FACTORY.getAPIProvider(apiConfig.getOwner()); API api = getAPI(apiConfig); - APIList apiList = publisherClient.getApis().apisGet(100, 0, "name:" + api.getName(), CONTENT_TYPE, null); - if (!isExist(api, apiList)) { - api = publisherClient.getApi().apisPost(api, CONTENT_TYPE, null); - if (CREATED_STATUS.equals(api.getStatus())) { - publisherClient.getApi().apisChangeLifecyclePost(PUBLISH_ACTION, api.getId(), null, null, null); + if (!apiProvider.isAPIAvailable(api.getId())) { + API createdAPI = apiProvider.addAPI(api); + if (CREATED_STATUS.equals(createdAPI.getStatus())) { + apiProvider.changeLifeCycleStatus(tenantDomain, createdAPI.getUuid(), PUBLISH_ACTION, null); + APIRevision apiRevision = new APIRevision(); + apiRevision.setApiUUID(createdAPI.getUuid()); + apiRevision.setDescription("Initial Revision"); + String apiRevisionId = apiProvider.addAPIRevision(apiRevision, tenantDomain); + APIRevisionDeployment apiRevisionDeployment = new APIRevisionDeployment(); + apiRevisionDeployment.setDeployment(API_PUBLISH_ENVIRONMENT); + apiRevisionDeployment.setVhost("localhost"); + apiRevisionDeployment.setDisplayOnDevportal(true); + + List apiRevisionDeploymentList = new ArrayList<>(); + apiRevisionDeploymentList.add(apiRevisionDeployment); + apiProvider.deployAPIRevision(createdAPI.getUuid(), apiRevisionId, apiRevisionDeploymentList); + } } else { if (WebappPublisherConfig.getInstance().isEnabledUpdateApi()) { - for (APIInfo apiInfo : apiList.getList()) { - if (api.getName().equals(apiInfo.getName()) && api.getVersion().equals(apiInfo.getVersion())) { - api = publisherClient.getApi().apisApiIdPut(apiInfo.getId(), api, CONTENT_TYPE, null, null); - if (api != null && CREATED_STATUS.equals(api.getStatus())) { - publisherClient.getApi().apisChangeLifecyclePost(PUBLISH_ACTION, api.getId(), null, null, - null); - } + API existingAPI = apiProvider.getAPI(api.getId()); + api.setStatus(existingAPI.getStatus()); + apiProvider.updateAPI(api); + if (api.getId().getName().equals(existingAPI.getId().getName()) && + api.getId().getVersion().equals(existingAPI.getId().getVersion())) { + if (CREATED_STATUS.equals(existingAPI.getStatus())) { + apiProvider.changeLifeCycleStatus(tenantDomain, existingAPI.getUuid(), PUBLISH_ACTION, null); } - } } } - } catch (FeignException e) { + + + } catch (FaultGatewaysException | APIManagementException e) { throw new APIManagerPublisherException(e); } finally { PrivilegedCarbonContext.endTenantFlow(); } } - private boolean isExist(API api, APIList apiList) { - if (apiList == null || apiList.getList() == null || apiList.getList().size() == 0) { - return false; - } - for (APIInfo existingApi : apiList.getList()) { - if (existingApi.getName() != null && existingApi.getName().equals(api. - getName()) && existingApi.getVersion() != null && - existingApi.getVersion().equals(api.getVersion())) { - return true; - } - } - return false; - } - private API getAPI(APIConfig config) { - API api = new API(); - api.setName(config.getName()); + APIIdentifier apiIdentifier = new APIIdentifier(config.getOwner(), config.getName(), config.getVersion()); + API api = new API(apiIdentifier); api.setDescription(""); - String context = config.getContext(); context = context.startsWith("/") ? context : ("/" + context); - api.setContext(context); - api.setVersion(config.getVersion()); - api.setProvider(config.getOwner()); - api.setApiDefinition(APIPublisherUtil.getSwaggerDefinition(config)); - api.setWsdlUri(null); - api.setStatus(PUBLISHED_STATUS); - api.setResponseCaching("DISABLED"); - api.setDestinationStatsEnabled("false"); - api.isDefaultVersion(config.isDefault()); - List transport = new ArrayList<>(); - transport.add("https"); - transport.add("http"); - api.transport(transport); - api.setTags(Arrays.asList(config.getTags())); - api.addTiersItem(UNLIMITED_TIER); - api.setGatewayEnvironments(API_PUBLISH_ENVIRONMENT); + api.setContext(context + "/" + config.getVersion()); +// api.setContext(context); + api.setStatus(CREATED_STATUS); + api.setWsdlUrl(null); + api.setResponseCache("Disabled"); + api.setContextTemplate(context + "/{version}" ); + api.setSwaggerDefinition(APIPublisherUtil.getSwaggerDefinition(config)); + api.setType("HTTP"); + + Set uriTemplates = new HashSet<>(); + Iterator iterator; + for (iterator = config.getUriTemplates().iterator(); iterator.hasNext(); ) { + ApiUriTemplate apiUriTemplate = iterator.next(); + URITemplate uriTemplate = new URITemplate(); + uriTemplate.setAuthType(apiUriTemplate.getAuthType()); + uriTemplate.setHTTPVerb(apiUriTemplate.getHttpVerb()); + uriTemplate.setResourceURI(apiUriTemplate.getResourceURI()); + uriTemplate.setUriTemplate(apiUriTemplate.getUriTemplate()); + Scope scope = new Scope(); + if (apiUriTemplate.getScope() != null) { + scope.setName(apiUriTemplate.getScope().getName()); + scope.setDescription(apiUriTemplate.getScope().getDescription()); + scope.setKey(apiUriTemplate.getScope().getKey()); + scope.setRoles(apiUriTemplate.getScope().getRoles()); + uriTemplate.setScope(scope); + } + uriTemplates.add(uriTemplate); + } + api.setUriTemplates(uriTemplates); + + api.setApiOwner(config.getOwner()); + + + api.setDefaultVersion(config.isDefault()); + api.setTransports("https,http"); + + Set tags = new HashSet<>(); + tags.addAll(Arrays.asList(config.getTags())); + api.setTags(tags); + + Set availableTiers = new HashSet<>(); + availableTiers.add(new Tier(UNLIMITED_TIER)); + api.setAvailableTiers(availableTiers); + + Set environments = new HashSet<>(); + environments.add(API_PUBLISH_ENVIRONMENT); + api.setEnvironments(environments); + if (config.isSharedWithAllTenants()) { - api.setSubscriptionAvailability(API.SubscriptionAvailabilityEnum.all_tenants); - api.setVisibility(API.VisibilityEnum.PUBLIC); + api.setSubscriptionAvailability(APIConstants.SUBSCRIPTION_TO_ALL_TENANTS); + api.setVisibility(APIConstants.API_GLOBAL_VISIBILITY); } else { - api.setSubscriptionAvailability(API.SubscriptionAvailabilityEnum.current_tenant); - api.setVisibility(API.VisibilityEnum.PRIVATE); + api.setSubscriptionAvailability(APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT); + api.setVisibility(APIConstants.API_PRIVATE_VISIBILITY); } - String endpointConfig = "{\"production_endpoints\":{\"url\":\"" + config.getEndpoint() + - "\",\"config\":null},\"implementation_status\":\"managed\",\"endpoint_type\":\"http\"}"; - + // String endpointConfig = "{\"production_endpoints\":{\"url\":\"" + config.getEndpoint() + + // "\",\"config\":null},\"endpoint_type\":\"http\"}"; + String endpointConfig = "{ \"endpoint_type\": \"http\", \"sandbox_endpoints\": { \"url\": \" " + + config.getEndpoint() + "\" }, \"production_endpoints\": { \"url\": \" "+ config.getEndpoint()+"\" } }"; api.setEndpointConfig(endpointConfig); - APICorsConfiguration apiCorsConfiguration = new APICorsConfiguration(); List accessControlAllowOrigins = new ArrayList<>(); accessControlAllowOrigins.add("*"); - apiCorsConfiguration.setAccessControlAllowOrigins(accessControlAllowOrigins); List accessControlAllowHeaders = new ArrayList<>(); accessControlAllowHeaders.add("authorization"); accessControlAllowHeaders.add("Access-Control-Allow-Origin"); accessControlAllowHeaders.add("Content-Type"); accessControlAllowHeaders.add("SOAPAction"); - apiCorsConfiguration.setAccessControlAllowHeaders(accessControlAllowHeaders); - + accessControlAllowHeaders.add("apikey"); + accessControlAllowHeaders.add("testKey"); List accessControlAllowMethods = new ArrayList<>(); accessControlAllowMethods.add("GET"); accessControlAllowMethods.add("PUT"); @@ -147,10 +195,16 @@ public class APIPublisherServiceImpl implements APIPublisherService { accessControlAllowMethods.add("POST"); accessControlAllowMethods.add("PATCH"); accessControlAllowMethods.add("OPTIONS"); - apiCorsConfiguration.setAccessControlAllowMethods(accessControlAllowMethods); - apiCorsConfiguration.setAccessControlAllowCredentials(false); - apiCorsConfiguration.corsConfigurationEnabled(false); - api.setCorsConfiguration(apiCorsConfiguration); + CORSConfiguration corsConfiguration = new CORSConfiguration(false, accessControlAllowOrigins, false, + accessControlAllowHeaders, accessControlAllowMethods); + api.setCorsConfiguration(corsConfiguration); + + api.setAuthorizationHeader("Authorization"); + List keyManagers = new ArrayList<>(); + keyManagers.add("all"); + api.setKeyManagers(keyManagers); + api.setEnableStore(true); + return api; } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java index 639c2fe217..9acc17232f 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java @@ -18,7 +18,7 @@ */ package org.wso2.carbon.apimgt.webapp.publisher.internal; -import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; +//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.apimgt.webapp.publisher.APIConfig; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService; import org.wso2.carbon.registry.core.service.RegistryService; @@ -37,7 +37,7 @@ public class APIPublisherDataHolder { private RegistryService registryService; private boolean isServerStarted; private Stack unpublishedApis = new Stack<>(); - private IntegrationClientService integrationClientService; + // private IntegrationClientService integrationClientService; private static APIPublisherDataHolder thisInstance = new APIPublisherDataHolder(); @@ -117,12 +117,12 @@ public class APIPublisherDataHolder { this.unpublishedApis = unpublishedApis; } - public IntegrationClientService getIntegrationClientService() { - return integrationClientService; - } + // public IntegrationClientService getIntegrationClientService() { + // return integrationClientService; + // } - public void setIntegrationClientService( - IntegrationClientService integrationClientService) { - this.integrationClientService = integrationClientService; - } + // public void setIntegrationClientService( + // IntegrationClientService integrationClientService) { + // this.integrationClientService = integrationClientService; + // } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java index dd5736570c..a714d97aa8 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java @@ -22,7 +22,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; +//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherServiceImpl; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler; @@ -45,11 +45,7 @@ import org.wso2.carbon.user.core.service.RealmService; * policy="dynamic" * bind="setRegistryService" * unbind="unsetRegistryService" - * interface="org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService" - * cardinality="1..1" - * policy="dynamic" - * bind="setIntegrationClientService" - * unbind="unsetIntegrationClientService" + */ public class APIPublisherServiceComponent { @@ -120,14 +116,14 @@ public class APIPublisherServiceComponent { APIPublisherDataHolder.getInstance().setRegistryService(null); } - protected void setIntegrationClientService(IntegrationClientService integrationClientService) { - if (integrationClientService != null && log.isDebugEnabled()) { - log.debug("integrationClientService initialized"); - } - APIPublisherDataHolder.getInstance().setIntegrationClientService(integrationClientService); - } - - protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) { - APIPublisherDataHolder.getInstance().setIntegrationClientService(null); - } + // protected void setIntegrationClientService(IntegrationClientService integrationClientService) { + // if (integrationClientService != null && log.isDebugEnabled()) { + // log.debug("integrationClientService initialized"); + // } + // APIPublisherDataHolder.getInstance().setIntegrationClientService(integrationClientService); + // } + // + // protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) { + // APIPublisherDataHolder.getInstance().setIntegrationClientService(null); + // } } diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index 41507f9fa9..fca4d2100a 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -34,13 +34,13 @@ http://wso2.org - org.wso2.carbon.apimgt.integration.generated.client - org.wso2.carbon.apimgt.integration.client + + org.wso2.carbon.apimgt.webapp.publisher org.wso2.carbon.apimgt.application.extension org.wso2.carbon.apimgt.application.extension.api org.wso2.carbon.apimgt.annotations - org.wso2.carbon.apimgt.handlers + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml index e195e08097..9f50930c4f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - CXF,Carbon + CXF3,Carbon diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml index 876c0ab594..9ebaecc139 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml @@ -56,7 +56,7 @@ io.swagger.annotations.*;resolution:=optional, com.fasterxml.jackson.annotation, javax.validation.constraints, - javax.xml.bind.annotation.*, + javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", org.wso2.carbon.device.application.mgt.common.* diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml index 82d75d4687..f861513e29 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml @@ -51,8 +51,66 @@ Application Management Core Bundle org.wso2.carbon.device.application.mgt.core.internal - org.osgi.framework, - org.osgi.service.component, + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, org.wso2.carbon.context.*, @@ -62,8 +120,8 @@ javax.sql, com.google.gson.*, javax.naming, - javax.xml.bind.annotation, - javax.xml.bind, + javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", + javax.xml.bind; version="${javax.xml.bind.imp.pkg.version}", org.wso2.carbon.device.application.mgt.common.*, org.wso2.carbon.device.mgt.core.*, org.wso2.carbon.device.mgt.common.*, @@ -348,6 +406,14 @@ + + org.wso2.carbon.devicemgt + org.wso2.carbon.identity.jwt.client.extension + + + + + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java index b57ffebeb7..33a9d0706f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java @@ -63,7 +63,7 @@ public class OAuthUtils { apiApplicationKeyInfo = apiManagementProviderService. generateAndRetrieveApplicationKeys(registrationProfile.getApplicationName(), registrationProfile.getTags(), Constants.ApplicationInstall.DEFAULT_TOKEN_TYPE, - registrationProfile.getApplicationName(), registrationProfile.isAllowedToAllDomains(), + null, registrationProfile.isAllowedToAllDomains(), Constants.ApplicationInstall.DEFAULT_VALIDITY_PERIOD); } finally { PrivilegedCarbonContext.endTenantFlow(); diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml index da8baef61f..7a71395445 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - CXF,Carbon + CXF3,Carbon diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml index da8baef61f..7a71395445 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - CXF,Carbon + CXF3,Carbon diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index fa191390be..888eda3b79 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -133,10 +133,22 @@ + + + + + + + org.springframework + spring-web + provided + org.apache.cxf - cxf-rt-frontend-jaxws + cxf-bundle-jaxrs + provided + commons-codec.wso2 commons-codec @@ -147,24 +159,26 @@ - - org.apache.cxf - cxf-rt-frontend-jaxrs - - - org.apache.cxf - cxf-rt-transports-http - + + + + + + + + + + junit junit test - - javax.ws.rs - jsr311-api - provided - + + + + + org.wso2.carbon org.wso2.carbon.logging @@ -207,11 +221,11 @@ - - javax.servlet - javax.servlet-api - provided - + + + + + org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml index ed2ed21624..60db8782e9 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - CXF,Carbon + CXF3,Carbon diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index cbe533dd6d..94d2a8fec1 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -133,10 +133,26 @@ + + + + + + org.springframework + spring-web + provided + org.apache.cxf - cxf-rt-frontend-jaxws + cxf-bundle-jaxrs + provided + + + + + + commons-codec.wso2 commons-codec @@ -147,14 +163,10 @@ - - org.apache.cxf - cxf-rt-frontend-jaxrs - - - org.apache.cxf - cxf-rt-transports-http - + + + + junit junit @@ -204,11 +216,11 @@ - - javax.servlet - javax.servlet-api - provided - + + + + + org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/webapp-classloading.xml index ed2ed21624..60db8782e9 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - CXF,Carbon + CXF3,Carbon diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index 6942c86d84..898f828dc5 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -72,8 +72,8 @@ org.wso2.carbon.certificate.mgt.core.util - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, org.apache.commons.collections.map, javax.security.auth.x500, diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml index 6c47262ab0..698bba5d44 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml @@ -140,8 +140,8 @@ org.apache.axis2.deployment.*, org.apache.commons.lang;version="${commons-lang.wso2.osgi.version.range}", org.apache.commons.logging, - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.w3c.dom, org.wso2.carbon.context, org.wso2.carbon.device.mgt.common.*, diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml index 14a9d8c308..e8f93ec911 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml @@ -82,8 +82,8 @@ org.wso2.carbon.device.mgt.extensions.pull.notification.* - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, org.wso2.carbon.device.mgt.common.*, org.wso2.carbon.device.mgt.core.service diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml index b102c68e13..a40a895622 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml @@ -135,7 +135,8 @@ com.google.gson, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.wso2.carbon.device.mgt.common.operation.mgt, org.wso2.carbon.device.mgt.common.push.notification, org.apache.commons.logging, diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml index 447951938b..994f41bfe5 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml @@ -126,13 +126,13 @@ org.apache.commons.logging, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.wso2.carbon.context, org.wso2.carbon.device.mgt.common.operation.mgt, org.wso2.carbon.device.mgt.common.push.notification, org.wso2.carbon.device.mgt.common, org.wso2.carbon.device.mgt.core.service, - org.osgi.framework, org.wso2.carbon.device.mgt.core.operation.mgt, org.wso2.carbon.core, com.google.gson, diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index a59a3728a5..5b6766bb66 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -148,7 +148,8 @@ org.apache.commons.logging, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.wso2.carbon.context, org.wso2.carbon.device.mgt.common.operation.mgt, org.wso2.carbon.device.mgt.common.push.notification, @@ -157,7 +158,6 @@ org.wso2.carbon.device.mgt.core.service, org.wso2.carbon.event.output.adapter.core, org.wso2.carbon.event.output.adapter.core.exception, - org.osgi.framework, org.wso2.carbon.device.mgt.core.operation.mgt, org.wso2.carbon.core, org.wso2.carbon.device.application.mgt.common.*, diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index 1a6e1a58ab..81ac96adc5 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -135,14 +135,14 @@ org.apache.commons.logging, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.wso2.carbon.context, org.wso2.carbon.device.mgt.common.operation.mgt, org.wso2.carbon.device.mgt.common.push.notification, org.wso2.carbon.device.mgt.core.service, org.wso2.carbon.event.output.adapter.core, org.wso2.carbon.event.output.adapter.core.exception, - org.osgi.framework, org.wso2.carbon.core, org.wso2.carbon.device.mgt.common.* diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml index bd43c8b626..4eada72d20 100644 --- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml +++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml @@ -146,15 +146,26 @@ - org.apache.cxf - cxf-rt-frontend-jaxrs + org.springframework + spring-web provided org.apache.cxf - cxf-rt-transports-http + cxf-bundle-jaxrs provided + + + + + + + + + + + javax.ws.rs jsr311-api diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java index 9ccbecda3d..f9ee5e913d 100644 --- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java +++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java @@ -200,8 +200,8 @@ public class DeviceManagementConfigServiceImpl implements DeviceManagementConfig DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); KeyManagerConfigurations kmConfig = deviceManagementConfig.getKeyManagerConfigurations(); AppRegistrationCredentials credentials = DeviceManagerUtil.getApplicationRegistrationCredentials( - System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_GATEWAY_HOST), - System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_GATEWAY_HTTPS_PORT), + System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_CORE_HOST), + System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_CORE_HTTPS_PORT), kmConfig.getAdminUsername(), kmConfig.getAdminPassword()); AccessTokenInfo accessTokenForAdmin = DeviceManagerUtil.getAccessTokenForDeviceOwner( diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/webapp/META-INF/webapp-classloading.xml index 01aceabde5..a16c0a9cbf 100644 --- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - CXF,Carbon + CXF3,Carbon diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index 7e7060e5b2..d4849aceef 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -107,8 +107,8 @@ org.wso2.carbon.device.mgt.analytics.data.publisher.*;version="${carbon.device.mgt.version}" - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging.*, org.wso2.carbon.utils.multitenancy, org.wso2.carbon.context;version="${carbon.kernel.version.range}", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index d2992949d2..86b7e6e035 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -146,30 +146,41 @@ - org.apache.cxf - cxf-rt-frontend-jaxws - provided - - - org.apache.cxf - cxf-rt-frontend-jaxrs + org.springframework + spring-web provided org.apache.cxf - cxf-rt-transports-http + cxf-bundle-jaxrs provided + + + + + + + + + + + + + + + + commons-httpclient.wso2 commons-httpclient provided - - javax.ws.rs - jsr311-api - provided - + + + + + org.wso2.carbon org.wso2.carbon.utils @@ -200,11 +211,11 @@ org.wso2.carbon.device.mgt.common provided - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.analytics.data.publisher - provided - + + + + + org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.extensions @@ -351,11 +362,11 @@ org.wso2.carbon.analytics.api provided - - org.wso2.carbon.analytics - org.wso2.carbon.analytics.datasource.commons - provided - + + + + + org.wso2.carbon.devicemgt org.wso2.carbon.identity.jwt.client.extension @@ -402,11 +413,11 @@ org.wso2.carbon.event.stream.persistence.stub provided - - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.integration.client - provided - + + + + + org.powermock powermock-module-testng diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java index 9eddd91aeb..fc0ce9c794 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java @@ -67,64 +67,64 @@ import javax.ws.rs.core.Response; @Consumes(MediaType.APPLICATION_JSON) public interface DeviceEventManagementService { - @POST - @Path("/{type}") - @ApiOperation( - produces = MediaType.APPLICATION_JSON, - httpMethod = "POST", - value = "Adding the Event Type Definition", - notes = "Add the event definition for a device.", - tags = "Device Event Management", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events") - }) - } - ) - @ApiResponses( - value = { - @ApiResponse( - code = 200, - message = "OK. \n Successfully added the event defintion.", - responseHeaders = { - @ResponseHeader( - name = "Content-Type", - description = "The content type of the body"), - @ResponseHeader( - name = "ETag", - description = "Entity Tag of the response resource.\n" + - "Used by caches, or in conditional requests."), - @ResponseHeader( - name = "Last-Modified", - description = - "Date and time the resource was last modified.\n" + - "Used by caches, or in conditional requests."), - } - ), - @ApiResponse( - code = 400, - message = - "Bad Request. \n"), - @ApiResponse( - code = 406, - message = "Not Acceptable.\n The requested media type is not supported"), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Server error occurred while fetching the " + - "list of supported device types.", - response = ErrorResponse.class) - } - ) - Response deployDeviceTypeEventDefinition( - @ApiParam(name = "type", value = "The device type, such as android, ios, and windows.") - @PathParam("type")String deviceType, - @ApiParam(name = "skipPersist", value = "Is it required to persist the data or not") - @QueryParam("skipPersist") boolean skipPersist, - @ApiParam(name = "isSharedWithAllTenants", value = "Should artifacts be available to all tenants") - @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants, - @ApiParam(name = "deviceTypeEvent", value = "Add the data to complete the DeviceTypeEvent object.", - required = true) - @Valid DeviceTypeEvent deviceTypeEvent); +// @POST +// @Path("/{type}") +// @ApiOperation( +// produces = MediaType.APPLICATION_JSON, +// httpMethod = "POST", +// value = "Adding the Event Type Definition", +// notes = "Add the event definition for a device.", +// tags = "Device Event Management", +// extensions = { +// @Extension(properties = { +// @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events") +// }) +// } +// ) +// @ApiResponses( +// value = { +// @ApiResponse( +// code = 200, +// message = "OK. \n Successfully added the event defintion.", +// responseHeaders = { +// @ResponseHeader( +// name = "Content-Type", +// description = "The content type of the body"), +// @ResponseHeader( +// name = "ETag", +// description = "Entity Tag of the response resource.\n" + +// "Used by caches, or in conditional requests."), +// @ResponseHeader( +// name = "Last-Modified", +// description = +// "Date and time the resource was last modified.\n" + +// "Used by caches, or in conditional requests."), +// } +// ), +// @ApiResponse( +// code = 400, +// message = +// "Bad Request. \n"), +// @ApiResponse( +// code = 406, +// message = "Not Acceptable.\n The requested media type is not supported"), +// @ApiResponse( +// code = 500, +// message = "Internal Server Error. \n Server error occurred while fetching the " + +// "list of supported device types.", +// response = ErrorResponse.class) +// } +// ) +// Response deployDeviceTypeEventDefinition( +// @ApiParam(name = "type", value = "The device type, such as android, ios, and windows.") +// @PathParam("type")String deviceType, +// @ApiParam(name = "skipPersist", value = "Is it required to persist the data or not") +// @QueryParam("skipPersist") boolean skipPersist, +// @ApiParam(name = "isSharedWithAllTenants", value = "Should artifacts be available to all tenants") +// @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants, +// @ApiParam(name = "deviceTypeEvent", value = "Add the data to complete the DeviceTypeEvent object.", +// required = true) +// @Valid DeviceTypeEvent deviceTypeEvent); @DELETE @Path("/{type}") @@ -178,183 +178,183 @@ public interface DeviceEventManagementService { "ios, and windows.", required = false) @PathParam("type")String deviceType); - @GET - @Path("/{type}/{deviceId}") - @ApiOperation( - produces = MediaType.APPLICATION_JSON, - httpMethod = "GET", - value = "Getting Device Events", - notes = "Get the events for the device.", - tags = "Device Event Management", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view") - }) - } - ) - @ApiResponses( - value = { - @ApiResponse( - code = 200, - message = "OK. \n Successfully fetched the event definition.", - response = EventRecords.class, - responseHeaders = { - @ResponseHeader( - name = "Content-Type", - description = "The content type of the body"), - @ResponseHeader( - name = "ETag", - description = "Entity Tag of the response resource.\n" + - "Used by caches, or in conditional requests."), - @ResponseHeader( - name = "Last-Modified", - description = - "Date and time the resource was last modified.\n" + - "Used by caches, or in conditional requests."), - } - ), - @ApiResponse( - code = 400, - message = - "Bad Request. \n"), - @ApiResponse( - code = 406, - message = "Not Acceptable.\n The requested media type is not supported"), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Server error occurred while fetching the " + - "list of supported device types.", - response = ErrorResponse.class) - } - ) - Response getData(@ApiParam(name = "deviceId", value = "id of the device ", required = false) - @PathParam("deviceId") String deviceId, - @ApiParam(name = "from", value = "unix timestamp to retrieve", required = false) - @QueryParam("from") long from, - @ApiParam(name = "to", value = "unix time to retrieve", required = false) - @QueryParam("to") long to, - @ApiParam(name = "type", value = "name of the device type", required = false) - @PathParam("type") String deviceType, - @ApiParam(name = "offset", value = "offset of the records that needs to be picked up", required = false) - @QueryParam("offset") int offset, - @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false) - @QueryParam("limit") int limit); +// @GET +// @Path("/{type}/{deviceId}") +// @ApiOperation( +// produces = MediaType.APPLICATION_JSON, +// httpMethod = "GET", +// value = "Getting Device Events", +// notes = "Get the events for the device.", +// tags = "Device Event Management", +// extensions = { +// @Extension(properties = { +// @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view") +// }) +// } +// ) +// @ApiResponses( +// value = { +// @ApiResponse( +// code = 200, +// message = "OK. \n Successfully fetched the event definition.", +// response = EventRecords.class, +// responseHeaders = { +// @ResponseHeader( +// name = "Content-Type", +// description = "The content type of the body"), +// @ResponseHeader( +// name = "ETag", +// description = "Entity Tag of the response resource.\n" + +// "Used by caches, or in conditional requests."), +// @ResponseHeader( +// name = "Last-Modified", +// description = +// "Date and time the resource was last modified.\n" + +// "Used by caches, or in conditional requests."), +// } +// ), +// @ApiResponse( +// code = 400, +// message = +// "Bad Request. \n"), +// @ApiResponse( +// code = 406, +// message = "Not Acceptable.\n The requested media type is not supported"), +// @ApiResponse( +// code = 500, +// message = "Internal Server Error. \n Server error occurred while fetching the " + +// "list of supported device types.", +// response = ErrorResponse.class) +// } +// ) +// Response getData(@ApiParam(name = "deviceId", value = "id of the device ", required = false) +// @PathParam("deviceId") String deviceId, +// @ApiParam(name = "from", value = "unix timestamp to retrieve", required = false) +// @QueryParam("from") long from, +// @ApiParam(name = "to", value = "unix time to retrieve", required = false) +// @QueryParam("to") long to, +// @ApiParam(name = "type", value = "name of the device type", required = false) +// @PathParam("type") String deviceType, +// @ApiParam(name = "offset", value = "offset of the records that needs to be picked up", required = false) +// @QueryParam("offset") int offset, +// @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false) +// @QueryParam("limit") int limit); - @GET - @Path("last-known/{type}/{deviceId}") - @ApiOperation( - produces = MediaType.APPLICATION_JSON, - httpMethod = "GET", - value = "Getting Last Known Device Events", - notes = "Get the last known events for the device.", - tags = "Device Event Management", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view") - }) - } - ) - @ApiResponses( - value = { - @ApiResponse( - code = 200, - message = "OK. \n Successfully fetched the event.", - response = EventRecords.class, - responseHeaders = { - @ResponseHeader( - name = "Content-Type", - description = "The content type of the body"), - @ResponseHeader( - name = "ETag", - description = "Entity Tag of the response resource.\n" + - "Used by caches, or in conditional requests."), - @ResponseHeader( - name = "Last-Modified", - description = - "Date and time the resource was last modified.\n" + - "Used by caches, or in conditional requests."), - } - ), - @ApiResponse( - code = 400, - message = - "Bad Request. \n"), - @ApiResponse( - code = 406, - message = "Not Acceptable.\n The requested media type is not supported"), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Server error occurred while fetching the " + - "list of supported device types.", - response = ErrorResponse.class) - } - ) - Response getLastKnownData(@ApiParam(name = "deviceId", value = "id of the device ", required = true) - @PathParam("deviceId") String deviceId, - @ApiParam(name = "type", value = "name of the device type", required = true) - @PathParam("type") String deviceType, - @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false) - @QueryParam("limit") int limit); +// @GET +// @Path("last-known/{type}/{deviceId}") +// @ApiOperation( +// produces = MediaType.APPLICATION_JSON, +// httpMethod = "GET", +// value = "Getting Last Known Device Events", +// notes = "Get the last known events for the device.", +// tags = "Device Event Management", +// extensions = { +// @Extension(properties = { +// @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view") +// }) +// } +// ) +// @ApiResponses( +// value = { +// @ApiResponse( +// code = 200, +// message = "OK. \n Successfully fetched the event.", +// response = EventRecords.class, +// responseHeaders = { +// @ResponseHeader( +// name = "Content-Type", +// description = "The content type of the body"), +// @ResponseHeader( +// name = "ETag", +// description = "Entity Tag of the response resource.\n" + +// "Used by caches, or in conditional requests."), +// @ResponseHeader( +// name = "Last-Modified", +// description = +// "Date and time the resource was last modified.\n" + +// "Used by caches, or in conditional requests."), +// } +// ), +// @ApiResponse( +// code = 400, +// message = +// "Bad Request. \n"), +// @ApiResponse( +// code = 406, +// message = "Not Acceptable.\n The requested media type is not supported"), +// @ApiResponse( +// code = 500, +// message = "Internal Server Error. \n Server error occurred while fetching the " + +// "list of supported device types.", +// response = ErrorResponse.class) +// } +// ) +// Response getLastKnownData(@ApiParam(name = "deviceId", value = "id of the device ", required = true) +// @PathParam("deviceId") String deviceId, +// @ApiParam(name = "type", value = "name of the device type", required = true) +// @PathParam("type") String deviceType, +// @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false) +// @QueryParam("limit") int limit); - @GET - @Path("filter/{type}/{parameter}") - @ApiOperation( - produces = MediaType.APPLICATION_JSON, - httpMethod = "GET", - value = "Getting the filtered devices", - notes = "Get the list of devices based on the filter parameter", - tags = "Device Event Management", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view") - }) - } - ) - @ApiResponses( - value = { - @ApiResponse( - code = 200, - message = "OK. \n Successfully fetched the event.", - response = EventRecords.class, - responseHeaders = { - @ResponseHeader( - name = "Content-Type", - description = "The content type of the body"), - @ResponseHeader( - name = "ETag", - description = "Entity Tag of the response resource.\n" + - "Used by caches, or in conditional requests."), - @ResponseHeader( - name = "Last-Modified", - description = - "Date and time the resource was last modified.\n" + - "Used by caches, or in conditional requests."), - } - ), - @ApiResponse( - code = 400, - message = - "Bad Request. \n"), - @ApiResponse( - code = 406, - message = "Not Acceptable.\n The requested media type is not supported"), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Server error occurred while fetching the " + - "list of supported device types.", - response = ErrorResponse.class) - } - ) - Response getFilteredDevices( - @ApiParam(name = "type", value = "name of the device type", required = true) - @PathParam("type") String deviceType, - @ApiParam(name = "type", value = "name of the parameter", required = true) - @PathParam("type") String parameter, - @ApiParam(name = "limit", value = "minimum value the parameter can have", required = false) - @QueryParam("min") double min, - @ApiParam(name = "max", value = "max value the parameter can have", required = false) - @QueryParam("max") double max - ); +// @GET +// @Path("filter/{type}/{parameter}") +// @ApiOperation( +// produces = MediaType.APPLICATION_JSON, +// httpMethod = "GET", +// value = "Getting the filtered devices", +// notes = "Get the list of devices based on the filter parameter", +// tags = "Device Event Management", +// extensions = { +// @Extension(properties = { +// @ExtensionProperty(name = Constants.SCOPE, value = "perm:device-types:events:view") +// }) +// } +// ) +// @ApiResponses( +// value = { +// @ApiResponse( +// code = 200, +// message = "OK. \n Successfully fetched the event.", +// response = EventRecords.class, +// responseHeaders = { +// @ResponseHeader( +// name = "Content-Type", +// description = "The content type of the body"), +// @ResponseHeader( +// name = "ETag", +// description = "Entity Tag of the response resource.\n" + +// "Used by caches, or in conditional requests."), +// @ResponseHeader( +// name = "Last-Modified", +// description = +// "Date and time the resource was last modified.\n" + +// "Used by caches, or in conditional requests."), +// } +// ), +// @ApiResponse( +// code = 400, +// message = +// "Bad Request. \n"), +// @ApiResponse( +// code = 406, +// message = "Not Acceptable.\n The requested media type is not supported"), +// @ApiResponse( +// code = 500, +// message = "Internal Server Error. \n Server error occurred while fetching the " + +// "list of supported device types.", +// response = ErrorResponse.class) +// } +// ) +// Response getFilteredDevices( +// @ApiParam(name = "type", value = "name of the device type", required = true) +// @PathParam("type") String deviceType, +// @ApiParam(name = "type", value = "name of the parameter", required = true) +// @PathParam("type") String parameter, +// @ApiParam(name = "limit", value = "minimum value the parameter can have", required = false) +// @QueryParam("min") double min, +// @ApiParam(name = "max", value = "max value the parameter can have", required = false) +// @QueryParam("max") double max +// ); @GET @Path("/{type}") diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java index 5e55acdc77..8b3071f1ef 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java @@ -97,71 +97,71 @@ public interface GeoLocationBasedService { /** * Retrieve Analytics for the device type */ - @GET - @Path("stats/{deviceType}/{deviceId}") - @ApiOperation( - consumes = "application/json", - produces = "application/json", - httpMethod = "GET", - value = "Getting the Location Details of a Device", - notes = "Get the location details of a device during a define time period.", - response = Response.class, - tags = "Geo Service Management", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics-view") - }) - } - ) - @ApiResponses(value = { - @ApiResponse( - code = 200, - message = "OK.", - response = Response.class, - responseHeaders = { - @ResponseHeader( - name = "Content-Type", - description = "The content type of the body"), - @ResponseHeader( - name = "Last-Modified", - description = "Date and time the resource was last modified.\n" + - "Used by caches, or in conditional requests."), - }), - @ApiResponse( - code = 400, - message = "Bad Request. \n Invalid Device Identifiers found.", - response = Response.class), - @ApiResponse( - code = 401, - message = "Unauthorized. \n Unauthorized request."), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Error on retrieving stats", - response = Response.class) - }) - Response getGeoDeviceStats( - @ApiParam( - name = "deviceId", - value = "The device ID.", - required = true) - @PathParam("deviceId") String deviceId, - @ApiParam( - name = "device-type", - value = "The device type, such as ios, android, or windows.", - required = true) - @PathParam("deviceType") - @Size(max = 45) - String deviceType, - @ApiParam( - name = "from", - value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.", - required = true) - @QueryParam("from") long from, - @ApiParam( - name = "to", - value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.", - required = true) - @QueryParam("to") long to); +// @GET +// @Path("stats/{deviceType}/{deviceId}") +// @ApiOperation( +// consumes = "application/json", +// produces = "application/json", +// httpMethod = "GET", +// value = "Getting the Location Details of a Device", +// notes = "Get the location details of a device during a define time period.", +// response = Response.class, +// tags = "Geo Service Management", +// extensions = { +// @Extension(properties = { +// @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:analytics-view") +// }) +// } +// ) +// @ApiResponses(value = { +// @ApiResponse( +// code = 200, +// message = "OK.", +// response = Response.class, +// responseHeaders = { +// @ResponseHeader( +// name = "Content-Type", +// description = "The content type of the body"), +// @ResponseHeader( +// name = "Last-Modified", +// description = "Date and time the resource was last modified.\n" + +// "Used by caches, or in conditional requests."), +// }), +// @ApiResponse( +// code = 400, +// message = "Bad Request. \n Invalid Device Identifiers found.", +// response = Response.class), +// @ApiResponse( +// code = 401, +// message = "Unauthorized. \n Unauthorized request."), +// @ApiResponse( +// code = 500, +// message = "Internal Server Error. \n Error on retrieving stats", +// response = Response.class) +// }) +// Response getGeoDeviceStats( +// @ApiParam( +// name = "deviceId", +// value = "The device ID.", +// required = true) +// @PathParam("deviceId") String deviceId, +// @ApiParam( +// name = "device-type", +// value = "The device type, such as ios, android, or windows.", +// required = true) +// @PathParam("deviceType") +// @Size(max = 45) +// String deviceType, +// @ApiParam( +// name = "from", +// value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.", +// required = true) +// @QueryParam("from") long from, +// @ApiParam( +// name = "to", +// value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.", +// required = true) +// @QueryParam("to") long to); /** * Get data to show device locations in a map @@ -602,128 +602,128 @@ public interface GeoLocationBasedService { /** * Retrieve Geo alerts history */ - @GET - @Path("alerts/history/{deviceType}/{deviceId}") - @ApiOperation( - consumes = "application/json", - produces = "application/json", - httpMethod = "GET", - value = "Getting the Geo Service Alert History of a Device", - notes = "Get the geo alert history of a device during the defined time period.", - response = Response.class, - tags = "Geo Service Management", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage") - }) - } - ) - @ApiResponses(value = { - @ApiResponse( - code = 200, - message = "OK.", - response = Response.class, - responseHeaders = { - @ResponseHeader( - name = "Content-Type", - description = "The content type of the body"), - @ResponseHeader( - name = "Last-Modified", - description = "Date and time the resource was last modified.\n" + - "Used by caches, or in conditional requests.") - }), - @ApiResponse( - code = 400, - message = "Bad Request. \n Invalid Device Identifiers found.", - response = Response.class), - @ApiResponse( - code = 401, - message = "Unauthorized. \n Unauthorized request."), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Error on retrieving stats", - response = Response.class) - }) - Response getGeoAlertsHistory( - @ApiParam( - name = "deviceId", - value = "The device ID.", - required = true) - @PathParam("deviceId") String deviceId, - @ApiParam( - name = "device-type", - value = "The device type, such as ios, android, or windows.", - required = true) - @PathParam("deviceType") - @Size(max = 45) - String deviceType, - @ApiParam( - name = "from", - value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.", - required = true) - @QueryParam("from") long from, - @ApiParam( - name = "to", - value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.", - required = true) - @QueryParam("to") long to); +// @GET +// @Path("alerts/history/{deviceType}/{deviceId}") +// @ApiOperation( +// consumes = "application/json", +// produces = "application/json", +// httpMethod = "GET", +// value = "Getting the Geo Service Alert History of a Device", +// notes = "Get the geo alert history of a device during the defined time period.", +// response = Response.class, +// tags = "Geo Service Management", +// extensions = { +// @Extension(properties = { +// @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage") +// }) +// } +// ) +// @ApiResponses(value = { +// @ApiResponse( +// code = 200, +// message = "OK.", +// response = Response.class, +// responseHeaders = { +// @ResponseHeader( +// name = "Content-Type", +// description = "The content type of the body"), +// @ResponseHeader( +// name = "Last-Modified", +// description = "Date and time the resource was last modified.\n" + +// "Used by caches, or in conditional requests.") +// }), +// @ApiResponse( +// code = 400, +// message = "Bad Request. \n Invalid Device Identifiers found.", +// response = Response.class), +// @ApiResponse( +// code = 401, +// message = "Unauthorized. \n Unauthorized request."), +// @ApiResponse( +// code = 500, +// message = "Internal Server Error. \n Error on retrieving stats", +// response = Response.class) +// }) +// Response getGeoAlertsHistory( +// @ApiParam( +// name = "deviceId", +// value = "The device ID.", +// required = true) +// @PathParam("deviceId") String deviceId, +// @ApiParam( +// name = "device-type", +// value = "The device type, such as ios, android, or windows.", +// required = true) +// @PathParam("deviceType") +// @Size(max = 45) +// String deviceType, +// @ApiParam( +// name = "from", +// value = "Define the time to start getting the geo location history of the device in the Epoch or UNIX format.", +// required = true) +// @QueryParam("from") long from, +// @ApiParam( +// name = "to", +// value = "Define the time to finish getting the geo location history of the device in the Epoch or UNIX format.", +// required = true) +// @QueryParam("to") long to); /** * Retrieve Geo alerts history for geo clusters */ - @GET - @Path("alerts/history") - @ApiOperation( - consumes = "application/json", - produces = "application/json", - httpMethod = "GET", - value = "Retrieve Geo alerts history for geo clusters", - notes = "Retrieving geo alert history of all defined alerts for geo clusters", - response = Response.class, - tags = "Geo Service Management", - extensions = { - @Extension(properties = { - @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage") - }) - } - ) - @ApiResponses(value = { - @ApiResponse( - code = 200, - message = "OK.", - response = Response.class, - responseHeaders = { - @ResponseHeader( - name = "Content-Type", - description = "The content type of the body"), - @ResponseHeader( - name = "Last-Modified", - description = "Date and time the resource was last modified.\n" + - "Used by caches, or in conditional requests.") - }), - @ApiResponse( - code = 400, - message = "Bad Request. \n Invalid Device Identifiers found.", - response = Response.class), - @ApiResponse( - code = 401, - message = "Unauthorized. \n Unauthorized request."), - @ApiResponse( - code = 500, - message = "Internal Server Error. \n Error on retrieving stats", - response = Response.class) - }) - Response getGeoAlertsHistoryForGeoClusters( - @ApiParam( - name = "from", - value = "Get stats from what time", - required = true) - @QueryParam("from") long from, - @ApiParam( - name = "to", - value = "Get stats up to what time", - required = true) - @QueryParam("to") long to); +// @GET +// @Path("alerts/history") +// @ApiOperation( +// consumes = "application/json", +// produces = "application/json", +// httpMethod = "GET", +// value = "Retrieve Geo alerts history for geo clusters", +// notes = "Retrieving geo alert history of all defined alerts for geo clusters", +// response = Response.class, +// tags = "Geo Service Management", +// extensions = { +// @Extension(properties = { +// @ExtensionProperty(name = Constants.SCOPE, value = "perm:geo-service:alerts-manage") +// }) +// } +// ) +// @ApiResponses(value = { +// @ApiResponse( +// code = 200, +// message = "OK.", +// response = Response.class, +// responseHeaders = { +// @ResponseHeader( +// name = "Content-Type", +// description = "The content type of the body"), +// @ResponseHeader( +// name = "Last-Modified", +// description = "Date and time the resource was last modified.\n" + +// "Used by caches, or in conditional requests.") +// }), +// @ApiResponse( +// code = 400, +// message = "Bad Request. \n Invalid Device Identifiers found.", +// response = Response.class), +// @ApiResponse( +// code = 401, +// message = "Unauthorized. \n Unauthorized request."), +// @ApiResponse( +// code = 500, +// message = "Internal Server Error. \n Error on retrieving stats", +// response = Response.class) +// }) +// Response getGeoAlertsHistoryForGeoClusters( +// @ApiParam( +// name = "from", +// value = "Get stats from what time", +// required = true) +// @QueryParam("from") long from, +// @ApiParam( +// name = "to", +// value = "Get stats up to what time", +// required = true) +// @QueryParam("to") long to); /** diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java index f759ed13a9..52702536d1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java @@ -26,7 +26,7 @@ import org.apache.axis2.AxisFault; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; +//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; @@ -280,19 +280,20 @@ public class DeviceAgentServiceImpl implements DeviceAgentService { i++; } - if (DeviceMgtAPIUtils.getEventPublisherService().publishEvent(DeviceMgtAPIUtils.getStreamDefinition(type - , PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()) - , Constants.DEFAULT_STREAM_VERSION, metaData - , null, payloadData)) { + // todo: amalka: commented data publishing +// if (DeviceMgtAPIUtils.getEventPublisherService().publishEvent(DeviceMgtAPIUtils.getStreamDefinition(type +// , PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()) +// , Constants.DEFAULT_STREAM_VERSION, metaData +// , null, payloadData)) { return Response.status(Response.Status.OK).build(); - } else { - String msg = "Error occurred while publishing the event."; - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); - } - } catch (DataPublisherConfigurationException e) { - String msg = "Error occurred while publishing the event."; - log.error(msg, e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); +// } else { +// String msg = "Error occurred while publishing the event."; +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); +// } +// } catch (DataPublisherConfigurationException e) { +// String msg = "Error occurred while publishing the event."; +// log.error(msg, e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } catch (DeviceAccessAuthorizationException e) { String msg = "Error occurred when checking for authorization"; log.error(msg, e); @@ -380,19 +381,20 @@ public class DeviceAgentServiceImpl implements DeviceAgentService { i++; } - if (DeviceMgtAPIUtils.getEventPublisherService().publishEvent(DeviceMgtAPIUtils.getStreamDefinition(type - , PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()) - , Constants.DEFAULT_STREAM_VERSION, metaData - , null, payloadData)) { + // todo: amalka: commented data publishing +// if (DeviceMgtAPIUtils.getEventPublisherService().publishEvent(DeviceMgtAPIUtils.getStreamDefinition(type +// , PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()) +// , Constants.DEFAULT_STREAM_VERSION, metaData +// , null, payloadData)) { return Response.status(Response.Status.OK).build(); - } else { - String msg = "Error occurred while publishing the event."; - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); - } - } catch (DataPublisherConfigurationException e) { - String msg = "Error occurred while publishing the event."; - log.error(msg, e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); +// } else { +// String msg = "Error occurred while publishing the event."; +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); +// } +// } catch (DataPublisherConfigurationException e) { +// String msg = "Error occurred while publishing the event."; +// log.error(msg, e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build(); } catch (DeviceAccessAuthorizationException e) { String msg = "Error occurred when checking for authorization"; log.error(msg, e); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java index 6c04581110..f5a7dacfd1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java @@ -4,18 +4,18 @@ import org.apache.axis2.AxisFault; import org.apache.axis2.client.Stub; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.analytics.api.AnalyticsDataAPI; -import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil; -import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; -import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; -import org.wso2.carbon.analytics.dataservice.commons.SortByField; -import org.wso2.carbon.analytics.dataservice.commons.SortType; -import org.wso2.carbon.analytics.datasource.commons.Record; -import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; -import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException; -import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub; -import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTable; -import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTableRecord; +//import org.wso2.carbon.analytics.api.AnalyticsDataAPI; +//import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil; +//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; +//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; +//import org.wso2.carbon.analytics.dataservice.commons.SortByField; +//import org.wso2.carbon.analytics.dataservice.commons.SortType; +//import org.wso2.carbon.analytics.datasource.commons.Record; +//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; +//import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException; +//import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub; +//import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTable; +//import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTableRecord; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; @@ -81,49 +81,49 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe private static final String MQTT_CONTENT_VALIDATOR = "default"; private static final String TIMESTAMP_FIELD_NAME = "_timestamp"; - private static AnalyticsDataAPI getAnalyticsDataAPI() { - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - AnalyticsDataAPI analyticsDataAPI = - (AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null); - if (analyticsDataAPI == null) { - String msg = "Analytics api service has not initialized."; - log.error(msg); - throw new IllegalStateException(msg); - } - return analyticsDataAPI; - } - - private static EventRecords getAllEventsForDevice(String tableName, String query, List sortByFields - , int offset, int limit) throws AnalyticsException { - int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); - AnalyticsDataAPI analyticsDataAPI = getAnalyticsDataAPI(); - EventRecords eventRecords = new EventRecords(); - int eventCount = analyticsDataAPI.searchCount(tenantId, tableName, query); - if (eventCount == 0) { - eventRecords.setCount(0); - } - List resultEntries = analyticsDataAPI.search(tenantId, tableName, query, offset, limit, - sortByFields); - List recordIds = getRecordIds(resultEntries); - AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, null, recordIds); - eventRecords.setCount(eventCount); - List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response); - records.sort(new Comparator() { - @Override public int compare(Record r1, Record r2) { - return Long.compare(r2.getTimestamp(), r1.getTimestamp()); - } - }); - eventRecords.setList(records); - return eventRecords; - } - - private static List getRecordIds(List searchResults) { - List ids = new ArrayList<>(); - for (SearchResultEntry searchResult : searchResults) { - ids.add(searchResult.getId()); - } - return ids; - } +// private static AnalyticsDataAPI getAnalyticsDataAPI() { +// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); +// AnalyticsDataAPI analyticsDataAPI = +// (AnalyticsDataAPI) ctx.getOSGiService(AnalyticsDataAPI.class, null); +// if (analyticsDataAPI == null) { +// String msg = "Analytics api service has not initialized."; +// log.error(msg); +// throw new IllegalStateException(msg); +// } +// return analyticsDataAPI; +// } + +// private static EventRecords getAllEventsForDevice(String tableName, String query, List sortByFields +// , int offset, int limit) throws AnalyticsException { +// int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId(); +// AnalyticsDataAPI analyticsDataAPI = getAnalyticsDataAPI(); +// EventRecords eventRecords = new EventRecords(); +// int eventCount = analyticsDataAPI.searchCount(tenantId, tableName, query); +// if (eventCount == 0) { +// eventRecords.setCount(0); +// } +// List resultEntries = analyticsDataAPI.search(tenantId, tableName, query, offset, limit, +// sortByFields); +// List recordIds = getRecordIds(resultEntries); +// AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, null, recordIds); +// eventRecords.setCount(eventCount); +// List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response); +// records.sort(new Comparator() { +// @Override public int compare(Record r1, Record r2) { +// return Long.compare(r2.getTimestamp(), r1.getTimestamp()); +// } +// }); +// eventRecords.setList(records); +// return eventRecords; +// } + +// private static List getRecordIds(List searchResults) { +// List ids = new ArrayList<>(); +// for (SearchResultEntry searchResult : searchResults) { +// ids.add(searchResult.getId()); +// } +// return ids; +// } /** * Retrieves the stream definition from das for the given device type. @@ -195,65 +195,65 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe /** * Deploy Event Stream, Receiver, Publisher and Store Configuration. */ - @POST - @Path("/{type}") - @Override - public Response deployDeviceTypeEventDefinition(@PathParam("type") String deviceType, - @QueryParam("skipPersist") boolean skipPersist, - @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants, - @Valid DeviceTypeEvent deviceTypeEvent) { - TransportType transportType = deviceTypeEvent.getTransportType(); - EventAttributeList eventAttributes = deviceTypeEvent.getEventAttributeList(); - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); - try { - if (eventAttributes == null || eventAttributes.getList() == null || eventAttributes.getList().size() == 0 || - deviceType == null || transportType == null || - !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) { - String errorMessage = "Invalid Payload"; - log.error(errorMessage); - return Response.status(Response.Status.BAD_REQUEST).build(); - } - String streamName = DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain); - String streamNameWithVersion = streamName + ":" + Constants.DEFAULT_STREAM_VERSION; - publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes); - publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType); - if (!skipPersist) { - publishEventStore(streamName, Constants.DEFAULT_STREAM_VERSION, eventAttributes); - } - publishWebsocketPublisherDefinition(streamNameWithVersion, deviceType); - try { - PrivilegedCarbonContext.startTenantFlow(); - PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain( - MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true); - if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { - publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes); - publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType); - } - } finally { - PrivilegedCarbonContext.endTenantFlow(); - } - return Response.ok().build(); - } catch (AxisFault e) { - log.error("Failed to create event definitions for tenantDomain:" + tenantDomain, e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); - } catch (RemoteException e) { - log.error("Failed to connect with the remote services:" + tenantDomain, e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); - } catch (JWTClientException e) { - log.error("Failed to generate jwt token for tenantDomain:" + tenantDomain, e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); - } catch (UserStoreException e) { - log.error("Failed to connect with the user store, tenantDomain: " + tenantDomain, e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); - } catch (DeviceManagementException e) { - log.error("Failed to access device management service, tenantDomain: " + tenantDomain, e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); - } catch (EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException e) { - log.error("Failed to create event store for, tenantDomain: " + tenantDomain + " deviceType" + deviceType, - e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); - } - } +// @POST +// @Path("/{type}") +// @Override +// public Response deployDeviceTypeEventDefinition(@PathParam("type") String deviceType, +// @QueryParam("skipPersist") boolean skipPersist, +// @QueryParam("isSharedWithAllTenants") boolean isSharedWithAllTenants, +// @Valid DeviceTypeEvent deviceTypeEvent) { +// TransportType transportType = deviceTypeEvent.getTransportType(); +// EventAttributeList eventAttributes = deviceTypeEvent.getEventAttributeList(); +// String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); +// try { +// if (eventAttributes == null || eventAttributes.getList() == null || eventAttributes.getList().size() == 0 || +// deviceType == null || transportType == null || +// !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) { +// String errorMessage = "Invalid Payload"; +// log.error(errorMessage); +// return Response.status(Response.Status.BAD_REQUEST).build(); +// } +// String streamName = DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain); +// String streamNameWithVersion = streamName + ":" + Constants.DEFAULT_STREAM_VERSION; +// publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes); +// publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType); +// if (!skipPersist) { +// publishEventStore(streamName, Constants.DEFAULT_STREAM_VERSION, eventAttributes); +// } +// publishWebsocketPublisherDefinition(streamNameWithVersion, deviceType); +// try { +// PrivilegedCarbonContext.startTenantFlow(); +// PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain( +// MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true); +// if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { +// publishStreamDefinitons(streamName, Constants.DEFAULT_STREAM_VERSION, deviceType, eventAttributes); +// publishEventReceivers(streamNameWithVersion, transportType, tenantDomain, isSharedWithAllTenants, deviceType); +// } +// } finally { +// PrivilegedCarbonContext.endTenantFlow(); +// } +// return Response.ok().build(); +// } catch (AxisFault e) { +// log.error("Failed to create event definitions for tenantDomain:" + tenantDomain, e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); +// } catch (RemoteException e) { +// log.error("Failed to connect with the remote services:" + tenantDomain, e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); +// } catch (JWTClientException e) { +// log.error("Failed to generate jwt token for tenantDomain:" + tenantDomain, e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); +// } catch (UserStoreException e) { +// log.error("Failed to connect with the user store, tenantDomain: " + tenantDomain, e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); +// } catch (DeviceManagementException e) { +// log.error("Failed to access device management service, tenantDomain: " + tenantDomain, e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); +// } catch (EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException e) { +// log.error("Failed to create event store for, tenantDomain: " + tenantDomain + " deviceType" + deviceType, +// e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); +// } +// } /** * Delete device type specific artifacts from DAS. @@ -349,175 +349,175 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe /** * Returns device specific data for the give period of time. */ - @GET - @Path("/{type}/{deviceId}") - @Override - public Response getData(@PathParam("deviceId") String deviceId, @QueryParam("from") long from, - @QueryParam("to") long to, @PathParam("type") String deviceType, @QueryParam("offset") - int offset, @QueryParam("limit") int limit) { - if (from == 0 || to == 0) { - String errorMessage = "Invalid values for from/to"; - return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); - } - if (limit == 0) { - String errorMessage = "Invalid values for offset/limit"; - return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); - } - String fromDate = String.valueOf(from); - String toDate = String.valueOf(to); - String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId - + " AND _timestamp : [" + fromDate + " TO " + toDate + "]"; - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); - String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain)); - try { - if (deviceType == null || - !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) { - String errorMessage = "Invalid device type"; - log.error(errorMessage); - return Response.status(Response.Status.BAD_REQUEST).build(); - } - if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( - new DeviceIdentifier(deviceId, deviceType))) { - return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); - } - List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC); - sortByFields.add(sortByField); - EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, offset, limit); - return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build(); - } catch (AnalyticsException e) { - String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; - log.error(errorMsg); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); - } catch (DeviceAccessAuthorizationException e) { - log.error(e.getErrorMessage(), e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); - } catch (DeviceManagementException e) { - String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; - log.error(errorMsg); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); - } - } +// @GET +// @Path("/{type}/{deviceId}") +// @Override +// public Response getData(@PathParam("deviceId") String deviceId, @QueryParam("from") long from, +// @QueryParam("to") long to, @PathParam("type") String deviceType, @QueryParam("offset") +// int offset, @QueryParam("limit") int limit) { +// if (from == 0 || to == 0) { +// String errorMessage = "Invalid values for from/to"; +// return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); +// } +// if (limit == 0) { +// String errorMessage = "Invalid values for offset/limit"; +// return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); +// } +// String fromDate = String.valueOf(from); +// String toDate = String.valueOf(to); +// String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId +// + " AND _timestamp : [" + fromDate + " TO " + toDate + "]"; +// String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); +// String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain)); +// try { +// if (deviceType == null || +// !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) { +// String errorMessage = "Invalid device type"; +// log.error(errorMessage); +// return Response.status(Response.Status.BAD_REQUEST).build(); +// } +// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( +// new DeviceIdentifier(deviceId, deviceType))) { +// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); +// } +// List sortByFields = new ArrayList<>(); +// SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC); +// sortByFields.add(sortByField); +// EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, offset, limit); +// return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build(); +// } catch (AnalyticsException e) { +// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; +// log.error(errorMsg); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); +// } catch (DeviceAccessAuthorizationException e) { +// log.error(e.getErrorMessage(), e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); +// } catch (DeviceManagementException e) { +// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; +// log.error(errorMsg); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); +// } +// } /** * Returns last known data points up to the limit if limit is specified. Otherwise returns last known data point. * Limit parameter needs to be zero or positive. */ - @GET - @Path("/last-known/{type}/{deviceId}") - @Override - public Response getLastKnownData(@PathParam("deviceId") String deviceId, @PathParam("type") String deviceType, @QueryParam("limit") int limit) { - String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId; - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); - String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain)); - try { - if (deviceType == null || - !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) { - String errorMessage = "Invalid device type"; - log.error(errorMessage); - return Response.status(Response.Status.BAD_REQUEST).build(); - } - if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( - new DeviceIdentifier(deviceId, deviceType))) { - return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); - } - List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC); - sortByFields.add(sortByField); - if (limit == 0) { - EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, 1); - return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build(); - } else if (limit > 0) { - EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, limit); - return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build(); - } else { - String errorMessage = "Invalid limit value"; - return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); - } - } catch (AnalyticsException e) { - String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; - log.error(errorMsg); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); - } catch (DeviceAccessAuthorizationException e) { - log.error(e.getErrorMessage(), e); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); - } catch (DeviceManagementException e) { - String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; - log.error(errorMsg); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); - } - } +// @GET +// @Path("/last-known/{type}/{deviceId}") +// @Override +// public Response getLastKnownData(@PathParam("deviceId") String deviceId, @PathParam("type") String deviceType, @QueryParam("limit") int limit) { +// String query = DEFAULT_META_DEVICE_ID_ATTRIBUTE + ":" + deviceId; +// String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); +// String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain)); +// try { +// if (deviceType == null || +// !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) { +// String errorMessage = "Invalid device type"; +// log.error(errorMessage); +// return Response.status(Response.Status.BAD_REQUEST).build(); +// } +// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( +// new DeviceIdentifier(deviceId, deviceType))) { +// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); +// } +// List sortByFields = new ArrayList<>(); +// SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC); +// sortByFields.add(sortByField); +// if (limit == 0) { +// EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, 1); +// return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build(); +// } else if (limit > 0) { +// EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, limit); +// return Response.status(Response.Status.OK.getStatusCode()).entity(eventRecords).build(); +// } else { +// String errorMessage = "Invalid limit value"; +// return Response.status(Response.Status.BAD_REQUEST).entity(errorMessage).build(); +// } +// } catch (AnalyticsException e) { +// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; +// log.error(errorMsg); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); +// } catch (DeviceAccessAuthorizationException e) { +// log.error(e.getErrorMessage(), e); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR).build(); +// } catch (DeviceManagementException e) { +// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; +// log.error(errorMsg); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); +// } +// } /** * Returns the filterd device list. Devices are filterd using the paramter given and the timestamp of the record. * parameter should given as a range. */ - @GET - @Path("filter/{type}/{parameter}") - @Override - public Response getFilteredDevices(@PathParam("type") String deviceType, @PathParam("parameter") String parameter, - @QueryParam("min") double min, @QueryParam("max") double max) { - String query; - Calendar c = java.util.Calendar.getInstance(); - long currentTimestamp = c.getTimeInMillis(); - long previousTimestamp = currentTimestamp - 300 * 1000; - String fromDate = String.valueOf(previousTimestamp); - String toDate = String.valueOf(currentTimestamp); - if (min != 0 & max != 0) { - query = parameter + " : [" + min + " TO " + max + "]" + - " AND _timestamp : [" + fromDate + " TO " + toDate + "]"; - } else { - String errorMessage = "The of range values need to be given"; - log.error(errorMessage); - return Response.status(Response.Status.BAD_REQUEST).build(); - } - - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); - String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain)); - try { - if (deviceType == null || - !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) { - String errorMessage = "Invalid device type"; - log.error(errorMessage); - return Response.status(Response.Status.BAD_REQUEST).build(); - } - - List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC); - sortByFields.add(sortByField); - EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, 100); - List filterdEvents = eventRecords.getRecord(); - List uniqueFilterdEvents = new ArrayList(); - Set devices = new HashSet<>(); - - for (int i = 0; i < filterdEvents.size(); i++) { - String deviceid = (String) filterdEvents.get(i).getValue("meta_deviceId"); - if (!devices.contains(deviceid) && DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( - new DeviceIdentifier(deviceid, deviceType))) { - devices.add(deviceid); - uniqueFilterdEvents.add(filterdEvents.get(i)); - } - } - - EventRecords filterdRecords = new EventRecords(); - filterdRecords.setList(uniqueFilterdEvents); - return Response.status(Response.Status.OK.getStatusCode()).entity(filterdRecords).build(); - - } catch (AnalyticsException e) { - String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; - log.error(errorMsg); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); - } catch (DeviceManagementException e) { - String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; - log.error(errorMsg); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); - } catch (DeviceAccessAuthorizationException e) { - String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; - log.error(errorMsg); - return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); - } - } +// @GET +// @Path("filter/{type}/{parameter}") +// @Override +// public Response getFilteredDevices(@PathParam("type") String deviceType, @PathParam("parameter") String parameter, +// @QueryParam("min") double min, @QueryParam("max") double max) { +// String query; +// Calendar c = java.util.Calendar.getInstance(); +// long currentTimestamp = c.getTimeInMillis(); +// long previousTimestamp = currentTimestamp - 300 * 1000; +// String fromDate = String.valueOf(previousTimestamp); +// String toDate = String.valueOf(currentTimestamp); +// if (min != 0 & max != 0) { +// query = parameter + " : [" + min + " TO " + max + "]" + +// " AND _timestamp : [" + fromDate + " TO " + toDate + "]"; +// } else { +// String errorMessage = "The of range values need to be given"; +// log.error(errorMessage); +// return Response.status(Response.Status.BAD_REQUEST).build(); +// } +// +// String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); +// String sensorTableName = getTableName(DeviceMgtAPIUtils.getStreamDefinition(deviceType, tenantDomain)); +// try { +// if (deviceType == null || +// !DeviceMgtAPIUtils.getDeviceManagementService().getAvailableDeviceTypes().contains(deviceType)) { +// String errorMessage = "Invalid device type"; +// log.error(errorMessage); +// return Response.status(Response.Status.BAD_REQUEST).build(); +// } +// +// List sortByFields = new ArrayList<>(); +// SortByField sortByField = new SortByField(TIMESTAMP_FIELD_NAME, SortType.DESC); +// sortByFields.add(sortByField); +// EventRecords eventRecords = getAllEventsForDevice(sensorTableName, query, sortByFields, 0, 100); +// List filterdEvents = eventRecords.getRecord(); +// List uniqueFilterdEvents = new ArrayList(); +// Set devices = new HashSet<>(); +// +// for (int i = 0; i < filterdEvents.size(); i++) { +// String deviceid = (String) filterdEvents.get(i).getValue("meta_deviceId"); +// if (!devices.contains(deviceid) && DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( +// new DeviceIdentifier(deviceid, deviceType))) { +// devices.add(deviceid); +// uniqueFilterdEvents.add(filterdEvents.get(i)); +// } +// } +// +// EventRecords filterdRecords = new EventRecords(); +// filterdRecords.setList(uniqueFilterdEvents); +// return Response.status(Response.Status.OK.getStatusCode()).entity(filterdRecords).build(); +// +// } catch (AnalyticsException e) { +// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; +// log.error(errorMsg); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); +// } catch (DeviceManagementException e) { +// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; +// log.error(errorMsg); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(errorMsg).build(); +// } catch (DeviceAccessAuthorizationException e) { +// String errorMsg = "Error on retrieving stats on table " + sensorTableName + " with query " + query; +// log.error(errorMsg); +// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); +// } +// } private void publishEventReceivers(String streamNameWithVersion, TransportType transportType @@ -613,47 +613,47 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe } } - private void publishEventStore(String streamName, String version, EventAttributeList eventAttributes) - throws RemoteException, UserStoreException, JWTClientException, - EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException { - EventStreamPersistenceAdminServiceStub eventStreamPersistenceAdminServiceStub = - DeviceMgtAPIUtils.getEventStreamPersistenceAdminServiceStub(); - try { - AnalyticsTable analyticsTable = new AnalyticsTable(); - analyticsTable.setRecordStoreName(DEFAULT_EVENT_STORE_NAME); - analyticsTable.setStreamVersion(version); - analyticsTable.setTableName(streamName); - analyticsTable.setMergeSchema(false); - analyticsTable.setPersist(true); - AnalyticsTableRecord analyticsTableRecords[] = new AnalyticsTableRecord[eventAttributes.getList().size() + 1]; - int i = 0; - for (Attribute attribute : eventAttributes.getList()) { - AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord(); - analyticsTableRecord.setColumnName(attribute.getName()); - analyticsTableRecord.setColumnType(attribute.getType().toString().toUpperCase()); - analyticsTableRecord.setFacet(false); - analyticsTableRecord.setIndexed(false); - analyticsTableRecord.setPersist(true); - analyticsTableRecord.setPrimaryKey(false); - analyticsTableRecord.setScoreParam(false); - analyticsTableRecords[i] = analyticsTableRecord; - i++; - } - AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord(); - analyticsTableRecord.setColumnName(DEFAULT_META_DEVICE_ID_ATTRIBUTE); - analyticsTableRecord.setColumnType(AttributeType.STRING.toString().toUpperCase()); - analyticsTableRecord.setFacet(false); - analyticsTableRecord.setIndexed(true); - analyticsTableRecord.setPersist(true); - analyticsTableRecord.setPrimaryKey(false); - analyticsTableRecord.setScoreParam(false); - analyticsTableRecords[i] = analyticsTableRecord; - analyticsTable.setAnalyticsTableRecords(analyticsTableRecords); - eventStreamPersistenceAdminServiceStub.addAnalyticsTable(analyticsTable); - } finally { - cleanup(eventStreamPersistenceAdminServiceStub); - } - } +// private void publishEventStore(String streamName, String version, EventAttributeList eventAttributes) +// throws RemoteException, UserStoreException, JWTClientException, +// EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException { +// EventStreamPersistenceAdminServiceStub eventStreamPersistenceAdminServiceStub = +// DeviceMgtAPIUtils.getEventStreamPersistenceAdminServiceStub(); +// try { +// AnalyticsTable analyticsTable = new AnalyticsTable(); +// analyticsTable.setRecordStoreName(DEFAULT_EVENT_STORE_NAME); +// analyticsTable.setStreamVersion(version); +// analyticsTable.setTableName(streamName); +// analyticsTable.setMergeSchema(false); +// analyticsTable.setPersist(true); +// AnalyticsTableRecord analyticsTableRecords[] = new AnalyticsTableRecord[eventAttributes.getList().size() + 1]; +// int i = 0; +// for (Attribute attribute : eventAttributes.getList()) { +// AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord(); +// analyticsTableRecord.setColumnName(attribute.getName()); +// analyticsTableRecord.setColumnType(attribute.getType().toString().toUpperCase()); +// analyticsTableRecord.setFacet(false); +// analyticsTableRecord.setIndexed(false); +// analyticsTableRecord.setPersist(true); +// analyticsTableRecord.setPrimaryKey(false); +// analyticsTableRecord.setScoreParam(false); +// analyticsTableRecords[i] = analyticsTableRecord; +// i++; +// } +// AnalyticsTableRecord analyticsTableRecord = new AnalyticsTableRecord(); +// analyticsTableRecord.setColumnName(DEFAULT_META_DEVICE_ID_ATTRIBUTE); +// analyticsTableRecord.setColumnType(AttributeType.STRING.toString().toUpperCase()); +// analyticsTableRecord.setFacet(false); +// analyticsTableRecord.setIndexed(true); +// analyticsTableRecord.setPersist(true); +// analyticsTableRecord.setPrimaryKey(false); +// analyticsTableRecord.setScoreParam(false); +// analyticsTableRecords[i] = analyticsTableRecord; +// analyticsTable.setAnalyticsTableRecords(analyticsTableRecords); +// eventStreamPersistenceAdminServiceStub.addAnalyticsTable(analyticsTable); +// } finally { +// cleanup(eventStreamPersistenceAdminServiceStub); +// } +// } private void publishWebsocketPublisherDefinition(String streamNameWithVersion, String deviceType) throws RemoteException, UserStoreException, JWTClientException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java index b2c28d8f1e..9075dceddd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java @@ -25,14 +25,14 @@ import com.google.gson.Gson; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpStatus; -import org.wso2.carbon.analytics.api.AnalyticsDataAPI; -import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil; -import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; -import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; -import org.wso2.carbon.analytics.dataservice.commons.SortByField; -import org.wso2.carbon.analytics.dataservice.commons.SortType; -import org.wso2.carbon.analytics.datasource.commons.Record; -import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; +//import org.wso2.carbon.analytics.api.AnalyticsDataAPI; +//import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil; +//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; +//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; +//import org.wso2.carbon.analytics.dataservice.commons.SortByField; +//import org.wso2.carbon.analytics.dataservice.commons.SortType; +//import org.wso2.carbon.analytics.datasource.commons.Record; +//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; @@ -93,63 +93,63 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { private static Log log = LogFactory.getLog(GeoLocationBasedServiceImpl.class); - @Path("stats/{deviceType}/{deviceId}") - @GET - @Consumes("application/json") - @Produces("application/json") - public Response getGeoDeviceStats(@PathParam("deviceId") String deviceId, - @PathParam("deviceType") String deviceType, - @QueryParam("from") long from, @QueryParam("to") long to) { - try { - if (!DeviceManagerUtil.isPublishLocationResponseEnabled()) { - return Response.status(Response.Status.BAD_REQUEST.getStatusCode()) - .entity("Unable to retrive Geo Device stats. Geo Data publishing does not enabled.").build(); - } - } catch (DeviceManagementException e) { - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(e.getMessage()).build(); - } - String tableName = "IOT_PER_DEVICE_STREAM_GEO_FUSEDSPATIALEVENT"; - String fromDate = String.valueOf(from); - String toDate = String.valueOf(to); - String query = "id:" + deviceId + " AND type:" + deviceType; - if (from != 0 || to != 0) { - query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]"; - } - try { - if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( - new DeviceIdentifier(deviceId, deviceType), - DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) { - return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); - } - List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField("timeStamp", SortType.ASC); - sortByFields.add(sortByField); - - // this is the user who initiates the request - String authorizedUser = MultitenantUtils.getTenantAwareUsername( - CarbonContext.getThreadLocalCarbonContext().getUsername()); - - try { - String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); - int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); - AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); - List searchResults = analyticsDataAPI.search(tenantId, tableName, query, - 0, - 100, - sortByFields); - List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), - searchResults); - return Response.ok().entity(events).build(); - } catch (AnalyticsException | UserStoreException e) { - log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); - throw DeviceMgtUtil.buildBadRequestException( - Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); - } - } catch (DeviceAccessAuthorizationException e) { - log.error(e.getErrorMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build(); - } - } +// @Path("stats/{deviceType}/{deviceId}") +// @GET +// @Consumes("application/json") +// @Produces("application/json") +// public Response getGeoDeviceStats(@PathParam("deviceId") String deviceId, +// @PathParam("deviceType") String deviceType, +// @QueryParam("from") long from, @QueryParam("to") long to) { +// try { +// if (!DeviceManagerUtil.isPublishLocationResponseEnabled()) { +// return Response.status(Response.Status.BAD_REQUEST.getStatusCode()) +// .entity("Unable to retrive Geo Device stats. Geo Data publishing does not enabled.").build(); +// } +// } catch (DeviceManagementException e) { +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).entity(e.getMessage()).build(); +// } +// String tableName = "IOT_PER_DEVICE_STREAM_GEO_FUSEDSPATIALEVENT"; +// String fromDate = String.valueOf(from); +// String toDate = String.valueOf(to); +// String query = "id:" + deviceId + " AND type:" + deviceType; +// if (from != 0 || to != 0) { +// query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]"; +// } +// try { +// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( +// new DeviceIdentifier(deviceId, deviceType), +// DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) { +// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); +// } +// List sortByFields = new ArrayList<>(); +// SortByField sortByField = new SortByField("timeStamp", SortType.ASC); +// sortByFields.add(sortByField); +// +// // this is the user who initiates the request +// String authorizedUser = MultitenantUtils.getTenantAwareUsername( +// CarbonContext.getThreadLocalCarbonContext().getUsername()); +// +// try { +// String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); +// int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); +// AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); +// List searchResults = analyticsDataAPI.search(tenantId, tableName, query, +// 0, +// 100, +// sortByFields); +// List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), +// searchResults); +// return Response.ok().entity(null).build(); +// } catch (AnalyticsException| UserStoreException e) { +// log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); +// throw DeviceMgtUtil.buildBadRequestException( +// Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); +// } +// } catch (DeviceAccessAuthorizationException e) { +// log.error(e.getErrorMessage()); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build(); +// } +// } @Path("stats/device-locations") @GET @@ -471,142 +471,142 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { } } - @Path("alerts/history/{deviceType}/{deviceId}") - @GET - @Consumes("application/json") - @Produces("application/json") - public Response getGeoAlertsHistory(@PathParam("deviceId") String deviceId, - @PathParam("deviceType") String deviceType, - @QueryParam("from") long from, @QueryParam("to") long to) { - String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS"; - String fromDate = String.valueOf(from); - String toDate = String.valueOf(to); - String query = "id:" + deviceId + " AND type:" + deviceType; - if (from != 0 || to != 0) { - query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]"; - } - try { - if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( - new DeviceIdentifier(deviceId, deviceType), - DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) { - return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); - } - List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField("timeStamp", SortType.ASC); - sortByFields.add(sortByField); - - // this is the user who initiates the request - String authorizedUser = MultitenantUtils.getTenantAwareUsername( - CarbonContext.getThreadLocalCarbonContext().getUsername()); - - try { - String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); - int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); - AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); - List searchResults = analyticsDataAPI.search(tenantId, tableName, query, - 0, - 100, - sortByFields); - List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), - searchResults); - return Response.ok().entity(events).build(); - } catch (AnalyticsException | UserStoreException e) { - log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); - throw DeviceMgtUtil.buildBadRequestException( - Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); - } - } catch (DeviceAccessAuthorizationException e) { - log.error(e.getErrorMessage()); - return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build(); - } - } - - @Path("alerts/history") - @GET - @Consumes("application/json") - @Produces("application/json") - public Response getGeoAlertsHistoryForGeoClusters(@QueryParam("from") long from, @QueryParam("to") long to) { - String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS"; - String fromDate = String.valueOf(from); - String toDate = String.valueOf(to); - String query = ""; - if (from != 0 || to != 0) { - query = "timeStamp : [" + fromDate + " TO " + toDate + "]"; - } - try { - List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField("timeStamp", SortType.ASC); - sortByFields.add(sortByField); - - // this is the user who initiates the request - String authorizedUser = MultitenantUtils.getTenantAwareUsername( - CarbonContext.getThreadLocalCarbonContext().getUsername()); - - String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); - int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); - AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); - List searchResults = analyticsDataAPI.search(tenantId, tableName, query, - 0, - 100, - sortByFields); - List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), - searchResults); - return Response.ok().entity(events).build(); - - } catch (AnalyticsException | UserStoreException e) { - log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); - throw DeviceMgtUtil.buildBadRequestException( - Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); - } - } - - private List getEventBeans(AnalyticsDataAPI analyticsDataAPI, int tenantId, String tableName, - List columns, - List searchResults) throws AnalyticsException { - List ids = getIds(searchResults); - List requiredColumns = (columns == null || columns.isEmpty()) ? null : columns; - AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, requiredColumns, ids); - List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response); - Map eventBeanMap = getEventBeanKeyedWithIds(records); - return getSortedEventBeans(eventBeanMap, searchResults); - } - - private List getSortedEventBeans(Map eventBeanMap, - List searchResults) { - List sortedRecords = new ArrayList<>(); - for (SearchResultEntry entry : searchResults) { - sortedRecords.add(eventBeanMap.get(entry.getId())); - } - return sortedRecords; - } - - private Map getEventBeanKeyedWithIds(List records) { - Map eventBeanMap = new HashMap<>(); - for (Record record : records) { - Event event = getEventBean(record); - eventBeanMap.put(event.getId(), event); - } - return eventBeanMap; - } - - private List getIds(List searchResults) { - List ids = new ArrayList<>(); - if (searchResults != null) { - for (SearchResultEntry resultEntry : searchResults) { - ids.add(resultEntry.getId()); - } - } - return ids; - } - - private static Event getEventBean(Record record) { - Event eventBean = new Event(); - eventBean.setId(record.getId()); - eventBean.setTableName(record.getTableName()); - eventBean.setTimestamp(record.getTimestamp()); - eventBean.setValues(record.getValues()); - return eventBean; - } +// @Path("alerts/history/{deviceType}/{deviceId}") +// @GET +// @Consumes("application/json") +// @Produces("application/json") +// public Response getGeoAlertsHistory(@PathParam("deviceId") String deviceId, +// @PathParam("deviceType") String deviceType, +// @QueryParam("from") long from, @QueryParam("to") long to) { +// String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS"; +// String fromDate = String.valueOf(from); +// String toDate = String.valueOf(to); +// String query = "id:" + deviceId + " AND type:" + deviceType; +// if (from != 0 || to != 0) { +// query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]"; +// } +// try { +// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( +// new DeviceIdentifier(deviceId, deviceType), +// DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) { +// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); +// } +// List sortByFields = new ArrayList<>(); +// SortByField sortByField = new SortByField("timeStamp", SortType.ASC); +// sortByFields.add(sortByField); +// +// // this is the user who initiates the request +// String authorizedUser = MultitenantUtils.getTenantAwareUsername( +// CarbonContext.getThreadLocalCarbonContext().getUsername()); +// +// try { +// String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); +// int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); +// AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); +// List searchResults = analyticsDataAPI.search(tenantId, tableName, query, +// 0, +// 100, +// sortByFields); +// List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), +// searchResults); +// return Response.ok().entity(events).build(); +// } catch (AnalyticsException | UserStoreException e) { +// log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); +// throw DeviceMgtUtil.buildBadRequestException( +// Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); +// } +// } catch (DeviceAccessAuthorizationException e) { +// log.error(e.getErrorMessage()); +// return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build(); +// } +// } + +// @Path("alerts/history") +// @GET +// @Consumes("application/json") +// @Produces("application/json") +// public Response getGeoAlertsHistoryForGeoClusters(@QueryParam("from") long from, @QueryParam("to") long to) { +// String tableName = "IOT_PER_DEVICE_STREAM_GEO_ALERTNOTIFICATIONS"; +// String fromDate = String.valueOf(from); +// String toDate = String.valueOf(to); +// String query = ""; +// if (from != 0 || to != 0) { +// query = "timeStamp : [" + fromDate + " TO " + toDate + "]"; +// } +// try { +// List sortByFields = new ArrayList<>(); +// SortByField sortByField = new SortByField("timeStamp", SortType.ASC); +// sortByFields.add(sortByField); +// +// // this is the user who initiates the request +// String authorizedUser = MultitenantUtils.getTenantAwareUsername( +// CarbonContext.getThreadLocalCarbonContext().getUsername()); +// +// String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); +// int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); +// AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); +// List searchResults = analyticsDataAPI.search(tenantId, tableName, query, +// 0, +// 100, +// sortByFields); +// List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), +// searchResults); +// return Response.ok().entity(events).build(); +// +// } catch (AnalyticsException | UserStoreException e) { +// log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); +// throw DeviceMgtUtil.buildBadRequestException( +// Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); +// } +// } + +// private List getEventBeans(AnalyticsDataAPI analyticsDataAPI, int tenantId, String tableName, +// List columns, +// List searchResults) throws AnalyticsException { +// List ids = getIds(searchResults); +// List requiredColumns = (columns == null || columns.isEmpty()) ? null : columns; +// AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, requiredColumns, ids); +// List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response); +// Map eventBeanMap = getEventBeanKeyedWithIds(records); +// return getSortedEventBeans(eventBeanMap, searchResults); +// } + +// private List getSortedEventBeans(Map eventBeanMap, +// List searchResults) { +// List sortedRecords = new ArrayList<>(); +// for (SearchResultEntry entry : searchResults) { +// sortedRecords.add(eventBeanMap.get(entry.getId())); +// } +// return sortedRecords; +// } + +// private Map getEventBeanKeyedWithIds(List records) { +// Map eventBeanMap = new HashMap<>(); +// for (Record record : records) { +// Event event = getEventBean(record); +// eventBeanMap.put(event.getId(), event); +// } +// return eventBeanMap; +// } + +// private List getIds(List searchResults) { +// List ids = new ArrayList<>(); +// if (searchResults != null) { +// for (SearchResultEntry resultEntry : searchResults) { +// ids.add(resultEntry.getId()); +// } +// } +// return ids; +// } + +// private static Event getEventBean(Record record) { +// Event eventBean = new Event(); +// eventBean.setId(record.getId()); +// eventBean.setTableName(record.getTableName()); +// eventBean.setTimestamp(record.getTimestamp()); +// eventBean.setValues(record.getValues()); +// return eventBean; +// } @Path("/geo-fence") @POST diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java index d326802c2a..16d4102176 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java @@ -64,8 +64,9 @@ public class CredentialManagementResponseBuilder { username = CarbonContext.getThreadLocalCarbonContext().getUsername(); userStoreManager.updateCredential(username, credentials.getNewPassword(), credentials.getOldPassword()); - DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username, - PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()); + //todo:amalka +// DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username, +// PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()); return Response.status(Response.Status.OK).entity("UserImpl password by username: " + username + " was successfully changed.").build(); } catch (UserStoreException e) { @@ -108,8 +109,9 @@ public class CredentialManagementResponseBuilder { new ErrorResponse.ErrorResponseBuilder().setMessage(errorMsg).build()).build(); } userStoreManager.updateCredentialByAdmin(username, credentials.getNewPassword()); - DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username, - PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()); + //todo:amalka +// DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username, +// PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()); return Response.status(Response.Status.OK).entity("UserImpl password by username: " + username + " was successfully changed.").build(); } catch (UserStoreException e) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java index 6a6f5daf88..fd8b0d9f59 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java @@ -46,14 +46,14 @@ import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub; -import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; +//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.base.ServerConfiguration; import org.wso2.carbon.analytics.api.AnalyticsDataAPI; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.util.Utils; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; +//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; @@ -171,7 +171,7 @@ public class DeviceMgtAPIUtils { private static KeyStore trustStore; private static char[] keyStorePassword; - private static IntegrationClientService integrationClientService; +// private static IntegrationClientService integrationClientService; private static MetadataManagementService metadataManagementService; private static OTPManagementService otpManagementService; @@ -374,22 +374,22 @@ public class DeviceMgtAPIUtils { } - public static IntegrationClientService getIntegrationClientService() { - if (integrationClientService == null) { - synchronized (DeviceMgtAPIUtils.class) { - if (integrationClientService == null) { - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - integrationClientService = (IntegrationClientService) ctx.getOSGiService(IntegrationClientService.class, null); - if (integrationClientService == null) { - String msg = "IntegrationClientService is not initialized"; - log.error(msg); - throw new IllegalStateException(msg); - } - } - } - } - return integrationClientService; - } +// public static IntegrationClientService getIntegrationClientService() { +// if (integrationClientService == null) { +// synchronized (DeviceMgtAPIUtils.class) { +// if (integrationClientService == null) { +// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); +// integrationClientService = (IntegrationClientService) ctx.getOSGiService(IntegrationClientService.class, null); +// if (integrationClientService == null) { +// String msg = "IntegrationClientService is not initialized"; +// log.error(msg); +// throw new IllegalStateException(msg); +// } +// } +// } +// } +// return integrationClientService; +// } /** * Initializing and accessing method for OTPManagementService. @@ -626,17 +626,18 @@ public class DeviceMgtAPIUtils { return username; } - public static EventsPublisherService getEventPublisherService() { - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - EventsPublisherService eventsPublisherService = - (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null); - if (eventsPublisherService == null) { - String msg = "Event Publisher service has not initialized."; - log.error(msg); - throw new IllegalStateException(msg); - } - return eventsPublisherService; - } + // todo: amalka: commented +// public static EventsPublisherService getEventPublisherService() { +// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); +// EventsPublisherService eventsPublisherService = +// (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null); +// if (eventsPublisherService == null) { +// String msg = "Event Publisher service has not initialized."; +// log.error(msg); +// throw new IllegalStateException(msg); +// } +// return eventsPublisherService; +// } public static String getStreamDefinition(String deviceType, String tenantDomain) { return STREAM_DEFINITION_PREFIX + tenantDomain + "." + deviceType.replace(" ", "."); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml index ed2ed21624..60db8782e9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - CXF,Carbon + CXF3,Carbon diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index eca6c9a3b7..d896782b1a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -50,7 +50,7 @@ javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", com.fasterxml.jackson.annotation;version="${jackson-annotations.version}", - org.wso2.carbon.analytics.datasource.commons;version="${carbon.analytics.version.range}", + io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional, com.google.gson @@ -96,14 +96,14 @@ org.wso2.orbit.com.fasterxml.jackson.core jackson-annotations - - org.wso2.carbon.analytics - org.wso2.carbon.analytics.api - - - org.wso2.carbon.analytics - org.wso2.carbon.analytics.datasource.commons - + + + + + + + + com.google.code.gson gson diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index d9b34a770d..ae28f57c44 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -78,8 +78,8 @@ org.wso2.carbon.device.mgt.core.internal org.apache.axis2.*;version="${axis2.osgi.version.range}", - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, javax.naming, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, @@ -90,7 +90,7 @@ org.wso2.carbon.core, org.wso2.carbon.utils.*, org.wso2.carbon.device.mgt.common.*, - org.wso2.carbon.device.mgt.analytics.data.publisher.service, + org.wso2.carbon.user.api, org.wso2.carbon.user.core.*, org.wso2.carbon.registry.core.service, @@ -104,8 +104,8 @@ org.wso2.carbon.ndatasource.core, org.wso2.carbon.ntask.core.*, org.wso2.carbon.ntask.common, - org.apache.catalina, - org.apache.catalina.core, + + org.apache.commons.collections;version="${commons-collections.version.range}", org.wso2.carbon.email.sender.*, io.swagger.annotations.*;resolution:=optional, @@ -166,32 +166,32 @@ org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.common - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.analytics.data.publisher - - - org.slf4j - slf4j-api - - - javax.servlet - javax.servlet-api - - - org.wso2.carbon.registry - org.wso2.carbon.registry.indexing - - - org.wso2.carbon.identity.framework - org.wso2.carbon.user.mgt - - - commons-lang - commons-lang - - - + + + + + + + + + + + + + + + + + + + + + + + + + + org.wso2.carbon org.wso2.carbon.logging diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java index df5f030684..f29afccfcf 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java @@ -53,6 +53,8 @@ public final class DeviceManagementConstants { public static final String SCOPES_FOR_TOKEN = "perm:device:operations perm:device:publish-event perm:windows:enroll"; public static final String IOT_GATEWAY_HOST = "iot.gateway.host"; public static final String IOT_GATEWAY_HTTPS_PORT = "iot.gateway.https.port"; + public static final String IOT_CORE_HOST = "iot.core.host"; + public static final String IOT_CORE_HTTPS_PORT = "iot.core.https.port"; public static final String APPLICATION_REGISTRATION_API_ENDPOINT = "/api-application-registration/register"; public static final String AUTHORIZATION_HEADER = "authorization"; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java index b152e65a84..396df0f61f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; +//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; @@ -178,9 +178,9 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { deviceInfo.getAvailableRAMMemory(), deviceInfo.isPluggedIn() }; - DeviceManagerUtil.getEventPublisherService().publishEvent( - DEVICE_INFO_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload - ); +// DeviceManagerUtil.getEventPublisherService().publishEvent( +// DEVICE_INFO_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload +// ); } } catch (TransactionManagementException e) { throw new DeviceDetailsMgtException("Transactional error occurred while adding the device information.", e); @@ -193,8 +193,8 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { DeviceManagementDAOFactory.rollbackTransaction(); throw new DeviceDetailsMgtException("Error occurred while updating the last update timestamp of the " + "device", e); - } catch (DataPublisherConfigurationException e) { - throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e); +// } catch (DataPublisherConfigurationException e) { +// throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e); } finally { DeviceManagementDAOFactory.closeConnection(); } @@ -389,9 +389,9 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { deviceLocation.getBearing(), deviceLocation.getDistance() }; - DeviceManagerUtil.getEventPublisherService().publishEvent( - LOCATION_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload - ); +// DeviceManagerUtil.getEventPublisherService().publishEvent( +// LOCATION_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload +// ); } DeviceManagementDAOFactory.commitTransaction(); } catch (TransactionManagementException e) { @@ -403,9 +403,9 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { } catch (DeviceManagementException e) { DeviceManagementDAOFactory.rollbackTransaction(); throw new DeviceDetailsMgtException("Error occurred while getting the device information.", e); - } catch (DataPublisherConfigurationException e) { - DeviceManagementDAOFactory.rollbackTransaction(); - throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e); +// } catch (DataPublisherConfigurationException e) { +// DeviceManagementDAOFactory.rollbackTransaction(); +// throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e); } finally { DeviceManagementDAOFactory.closeConnection(); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 7456111973..52a169ef61 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -49,7 +49,7 @@ import org.apache.http.protocol.HTTP; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; +//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; import org.wso2.carbon.device.mgt.common.ActivityPaginationRequest; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceEnrollmentInfoNotification; @@ -1964,20 +1964,20 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv operation.getStatus() != null ? operation.getStatus().toString() : null, operation.getOperationResponse() }; - DeviceManagerUtil.getEventPublisherService().publishEvent( - OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload - ); +// DeviceManagerUtil.getEventPublisherService().publishEvent( +// OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload +// ); } } } catch (DeviceManagementException e) { String msg = "Error occurred while reading configs."; log.error(msg, e); throw new OperationManagementException(msg, e); - } catch (DataPublisherConfigurationException e) { - String msg = "Error occurred while publishing event."; - log.error(msg, e); - throw new OperationManagementException(msg, e); - } + } //catch (DataPublisherConfigurationException e) { +// String msg = "Error occurred while publishing event."; +// log.error(msg, e); +// throw new OperationManagementException(msg, e); +// } } @Override @@ -2006,20 +2006,20 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv operation.getStatus() != null ? operation.getStatus().toString() : null, operation.getOperationResponse() }; - DeviceManagerUtil.getEventPublisherService().publishEvent( - OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload - ); +// DeviceManagerUtil.getEventPublisherService().publishEvent( +// OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload +// ); } } } catch (DeviceManagementException e) { String msg = "Error occurred while reading configs."; log.error(msg, e); throw new OperationManagementException(msg, e); - } catch (DataPublisherConfigurationException e) { - String msg = "Error occurred while publishing event."; - log.error(msg, e); - throw new OperationManagementException(msg, e); - } + } //catch (DataPublisherConfigurationException e) { +// String msg = "Error occurred while publishing event."; +// log.error(msg, e); +// throw new OperationManagementException(msg, e); +// } } @Override diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java index 7822754208..13593baf12 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java @@ -50,7 +50,7 @@ import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.caching.impl.CacheImpl; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; +//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; import org.wso2.carbon.device.mgt.common.AppRegistrationCredentials; import org.wso2.carbon.device.mgt.common.ApplicationRegistration; import org.wso2.carbon.device.mgt.common.ApplicationRegistrationException; @@ -595,17 +595,17 @@ public final class DeviceManagerUtil { return Caching.getCacheManagerFactory().getCacheManager(DeviceManagementConstants.DM_CACHE_MANAGER); } - public static EventsPublisherService getEventPublisherService() { - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - EventsPublisherService eventsPublisherService = - (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null); - if (eventsPublisherService == null) { - String msg = "Event Publisher service has not initialized."; - log.error(msg); - throw new IllegalStateException(msg); - } - return eventsPublisherService; - } +// public static EventsPublisherService getEventPublisherService() { +// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); +// EventsPublisherService eventsPublisherService = +// (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null); +// if (eventsPublisherService == null) { +// String msg = "Event Publisher service has not initialized."; +// log.error(msg); +// throw new IllegalStateException(msg); +// } +// return eventsPublisherService; +// } /** * Retrieve EventConfigurationProviderService osgi service component diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index 43353e1468..11c9471e76 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -178,15 +178,15 @@ javax.xml.stream, javax.xml.parsers;resolution:=optional, org.apache.commons.lang, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.w3c.dom, org.wso2.carbon.ndatasource.core, org.wso2.carbon.registry.core.service, org.wso2.carbon.utils.dbcreator, org.wso2.carbon.utils.multitenancy, org.wso2.carbon.device.mgt.core.service, - com.google.gson, - org.osgi.framework + com.google.gson org.wso2.carbon.device.mgt.extensions.pull.notification, org.wso2.carbon.device.mgt.extensions.pull.notification.* diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml index b3bef7291a..744abc8ba1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml @@ -61,8 +61,8 @@ IoT Server Impl Bundle org.wso2.carbon.device.mgt.url.printer.internal - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, org.apache.axis2.*;version="${axis2.osgi.version.range}", org.wso2.carbon.core, diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 2d489faa9e..709e09d6bc 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -38,9 +38,9 @@ org.wso2.carbon.device.mgt.extensions org.wso2.carbon.device.mgt.ui org.wso2.carbon.device.mgt.api - org.wso2.carbon.device.mgt.analytics.data.publisher + org.wso2.carbon.device.mgt.url.printer - org.wso2.carbon.device.mgt.analytics.wsproxy + io.entgra.carbon.device.mgt.config.api diff --git a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml index 70cdb93216..65b62fca38 100644 --- a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml +++ b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml @@ -53,20 +53,20 @@ org.apache.axis2.*;version="${axis2.osgi.version.range}", org.apache.axiom.*; version="${axiom.osgi.version.range}", - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, org.wso2.carbon.context, org.wso2.carbon.utils.*, org.wso2.carbon.ndatasource.core, org.w3c.dom, - org.apache.velocity;version="${velocity.version}", - org.apache.velocity.app;version="${velocity.version}", - org.apache.velocity.context;version="${velocity.version}", - org.apache.velocity.exception;version="${velocity.version}", - org.apache.velocity.runtime.resource;version="${velocity.version}", - org.apache.velocity.runtime.resource.loader;version="${velocity.version}", + + + + + + org.apache.commons.io, org.apache.axis2.transport.mail, org.apache.commons.collections, @@ -149,10 +149,14 @@ org.apache.axis2.wso2 axis2 - - org.wso2.orbit.org.apache.velocity - velocity - + + + + + + + + commons-io.wso2 commons-io diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml index ae46c74805..27de8ac3a6 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml @@ -87,10 +87,11 @@ org.wso2.carbon.device.mgt.oauth.extensions.* - org.wso2.carbon.identity.oauth2.grant.jwt;version="${carbon.identity.jwt.grant.version.range}", + org.apache.commons.lang, org.apache.commons.logging, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.wso2.carbon.identity.application.common.model;version="${carbon.identity.framework.version.range}", org.wso2.carbon.identity.application.common;version="${carbon.identity.framework.version.range}", org.wso2.carbon.identity.application.mgt.*;version="${carbon.identity.framework.version.range}", @@ -113,6 +114,10 @@ org.apache.oltu.oauth2.common.validators, org.apache.commons.lang3.tuple, + + + + diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java index 1153cb0561..4cc7881344 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java @@ -21,7 +21,6 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.apimgt.keymgt.ScopesIssuer; import org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant.oauth.validator.LocalOAuthValidator; import org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant.oauth.validator.OAuthValidationResponse; import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser; @@ -58,8 +57,8 @@ public class AccessTokenGrantHandler extends AbstractAuthorizationGrantHandler { } @Override - public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) { - return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx); + public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception { + return super.validateScope(tokReqMsgCtx); } @Override diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java index 006317f179..f6560e76eb 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java @@ -20,14 +20,10 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.apimgt.keymgt.ScopesIssuer; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception; import org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler; import org.wso2.carbon.identity.oauth2.model.RequestParameter; import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext; -import org.wso2.carbon.utils.multitenancy.MultitenantUtils; /** * This sets up user with tenant aware username. @@ -38,8 +34,8 @@ public class ExtendedJWTGrantHandler extends JWTBearerGrantHandler { private static final String TENANT_DOMAIN_KEY = "tenantDomain"; @Override - public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) { - return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx); + public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception { + return super.validateScope(tokReqMsgCtx); } @Override diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java index 5caededdaf..2193d2d3ed 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java @@ -20,7 +20,6 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.apimgt.keymgt.ScopesIssuer; import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception; import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext; @@ -35,8 +34,8 @@ public class ExtendedSAML2BearerGrantHandler extends SAML2BearerGrantHandler { private static Log log = LogFactory.getLog(ExtendedSAML2BearerGrantHandler.class); @Override - public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) { - return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx); + public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception { + return super.validateScope(tokReqMsgCtx); } @Override diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml index 4adb6539ab..abcf3859a3 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml @@ -109,8 +109,8 @@ org.apache.commons.httpclient, org.apache.commons.logging, org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}", - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.wso2.carbon.core.security, org.wso2.carbon.core.services.authentication, org.wso2.carbon.utils.multitenancy, diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml index b793b016fa..7e171cd155 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml @@ -185,8 +185,8 @@ org.wso2.carbon.identity.jwt.client.extension.* - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.wso2.carbon.context, org.wso2.carbon.registry.core, org.wso2.carbon.registry.core.exceptions, diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml index e10007a1ac..de175d9dba 100644 --- a/components/identity-extensions/pom.xml +++ b/components/identity-extensions/pom.xml @@ -33,8 +33,8 @@ http://wso2.org - org.wso2.carbon.identity.authenticator.backend.oauth - org.wso2.carbon.device.mgt.oauth.extensions + + org.wso2.carbon.identity.jwt.client.extension diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml index 89a475e259..0c3d56ebc2 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml @@ -35,9 +35,9 @@ Policy Decision Point Bundle org.wso2.carbon.policy.decision.point.internal - org.wso2.carbon.context.*; - org.osgi.framework, - org.osgi.service.component, + org.wso2.carbon.context;version="${carbon.kernel.version.range}", + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, org.wso2.carbon.policy.mgt.common.*, org.wso2.carbon.policy.mgt.core.*, diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml index 20aab933b0..38acfd2d93 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml @@ -53,8 +53,8 @@ Policy Management Core Bundle org.wso2.carbon.policy.mgt.core.internal - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, javax.sql, javax.cache, diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml index dd4d6e80c8..e047aa2278 100644 --- a/components/policy-mgt/pom.xml +++ b/components/policy-mgt/pom.xml @@ -39,7 +39,7 @@ org.wso2.carbon.policy.mgt.core org.wso2.carbon.policy.information.point org.wso2.carbon.policy.decision.point - org.wso2.carbon.complex.policy.decision.point + diff --git a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml index 1888660a53..6ae1098d84 100644 --- a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml +++ b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml @@ -53,8 +53,8 @@ org.apache.axis2.*;version="${axis2.osgi.version.range}", org.apache.axiom.*; version="${axiom.osgi.version.range}", - org.osgi.framework, - org.osgi.service.component, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, org.wso2.carbon.context, diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml index d4f72461b4..edc6bfedb2 100644 --- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml +++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml @@ -87,20 +87,30 @@ - org.apache.cxf - cxf-rt-frontend-jaxws - provided - - - org.apache.cxf - cxf-rt-frontend-jaxrs + org.springframework + spring-web provided org.apache.cxf - cxf-rt-transports-http + cxf-bundle-jaxrs provided + + + + + + + + + + + + + + + javax.servlet javax.servlet-api diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/webapp/META-INF/webapp-classloading.xml index d0d7a01621..c0925583a3 100644 --- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - CXF,Carbon + CXF3,Carbon diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml index d00ef252ad..783643a999 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml @@ -99,20 +99,35 @@ - org.apache.cxf - cxf-rt-frontend-jaxws + org.wso2.carbon.devicemgt + org.wso2.carbon.apimgt.application.extension provided - org.apache.cxf - cxf-rt-frontend-jaxrs + org.springframework + spring-web provided org.apache.cxf - cxf-rt-transports-http + cxf-bundle-jaxrs provided + + + + + + + + + + + + + + + javax.servlet javax.servlet-api diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java index 49e0489de3..7bf0861f72 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java @@ -73,6 +73,7 @@ public class InvokerHandler extends HttpServlet { private static final long serialVersionUID = -6508020875358160165L; private static AuthData authData; private static String apiEndpoint; + private static String iotsCoreUrl; @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) { @@ -368,8 +369,14 @@ public class InvokerHandler extends HttpServlet { if (log.isDebugEnabled()) { log.debug("refreshing the token"); } + String iotsCorePort = System.getProperty("iot.core.https.port"); + if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { + iotsCorePort = System.getProperty("iot.core.http.port"); + } + iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") + + HandlerConstants.COLON + iotsCorePort; HttpPost tokenEndpoint = new HttpPost( - apiEndpoint + HandlerConstants.API_COMMON_CONTEXT + HandlerConstants.TOKEN_ENDPOINT); + iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); HttpSession session = req.getSession(false); if (session == null) { log.error("Couldn't find a session, hence it is required to login and proceed."); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java index 133681355b..5a664552b8 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java @@ -35,7 +35,16 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.protocol.HTTP; +import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; +import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl; +import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants; +import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; +import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; +import org.wso2.carbon.authenticator.stub.AuthenticationAdmin; +import org.wso2.carbon.authenticator.stub.Login; +import org.wso2.carbon.context.PrivilegedCarbonContext; import io.entgra.ui.request.interceptor.beans.ProxyResponse; +import org.wso2.carbon.utils.multitenancy.MultitenantUtils; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; @@ -44,7 +53,9 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; +import java.util.ArrayList; import java.util.Base64; +import java.util.List; @MultipartConfig @WebServlet("/login") @@ -56,6 +67,7 @@ public class LoginHandler extends HttpServlet { private static String password; private static String gatewayUrl; private static String uiConfigUrl; + private static String keyManagerUrl; @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) { @@ -68,26 +80,37 @@ public class LoginHandler extends HttpServlet { httpSession = req.getSession(true); //setting session to expiry in 5 minutes httpSession.setMaxInactiveInterval(Math.toIntExact(HandlerConstants.TIMEOUT)); - + //todo: amalka do we need this remote call? JsonObject uiConfigJsonObject = HandlerUtil.getUIConfigAndPersistInSession(uiConfigUrl, gatewayUrl, httpSession, resp); JsonArray tags = uiConfigJsonObject.get("appRegistration").getAsJsonObject().get("tags").getAsJsonArray(); JsonArray scopes = uiConfigJsonObject.get("scopes").getAsJsonArray(); - HttpPost apiRegEndpoint = new HttpPost(gatewayUrl + HandlerConstants.APP_REG_ENDPOINT); - apiRegEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + Base64.getEncoder() - .encodeToString((username + HandlerConstants.COLON + password).getBytes())); - apiRegEndpoint.setHeader(HTTP.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()); - apiRegEndpoint.setEntity(HandlerUtil.constructAppRegPayload(tags, HandlerConstants.PUBLISHER_APPLICATION_NAME, username, password)); + List list = new ArrayList(); + for(int i=0; i < tags.size(); i++) { + list.add(tags.get(i).getAsString()); + } - ProxyResponse clientAppResponse = HandlerUtil.execute(apiRegEndpoint); + String[] tagsAsStringArray = list.toArray(new String[list.size()]); - if (clientAppResponse.getCode() == HttpStatus.SC_UNAUTHORIZED) { - HandlerUtil.handleError(resp, clientAppResponse); - return; + String scopeString = HandlerUtil.getScopeString(scopes); + + if (scopeString != null) { + scopeString = scopeString.trim(); + } else { + scopeString = "default"; } - if (clientAppResponse.getCode() == HttpStatus.SC_CREATED && getTokenAndPersistInSession(req, resp, - clientAppResponse.getData(), scopes)) { + + APIManagementProviderService apiManagementProviderService = new APIManagementProviderServiceImpl(); + ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys( + HandlerConstants.PUBLISHER_APPLICATION_NAME, + tagsAsStringArray, HandlerConstants.PRODUCTION_KEY, username, false, + ApiApplicationConstants.DEFAULT_VALIDITY_PERIOD, scopeString); + + if (apiApplicationKey != null && getTokenAndPersistInSession(apiApplicationKey.getConsumerKey(), + apiApplicationKey.getConsumerSecret(), req, resp, scopes)) { + log.info("tenantDomain : " + PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()); + log.info("username : " + PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername()); ProxyResponse proxyResponse = new ProxyResponse(); proxyResponse.setCode(HttpStatus.SC_OK); HandlerUtil.handleSuccess(resp, proxyResponse); @@ -100,6 +123,8 @@ public class LoginHandler extends HttpServlet { log.error("Error occurred while parsing the response. ", e); } catch (LoginException e) { log.error("Error occurred while getting token data. ", e); + } catch (APIManagerException e) { + log.error("Error occurred while creating application. ", e); } } @@ -107,19 +132,19 @@ public class LoginHandler extends HttpServlet { * Generates token from token endpoint and persists them inside the session * * @param req - {@link HttpServletRequest} - * @param clientAppResult - clientAppResult +// * @param clientAppResult - clientAppResult * @param scopes - scopes defied in the application-mgt.xml * @throws LoginException - login exception throws when getting token result */ - private boolean getTokenAndPersistInSession(HttpServletRequest req, HttpServletResponse resp, - String clientAppResult, JsonArray scopes) throws LoginException { + private boolean getTokenAndPersistInSession(String clientId, String clientSecret, HttpServletRequest req, + HttpServletResponse resp, JsonArray scopes) throws LoginException { JsonParser jsonParser = new JsonParser(); try { - JsonElement jClientAppResult = jsonParser.parse(clientAppResult); - if (jClientAppResult.isJsonObject()) { - JsonObject jClientAppResultAsJsonObject = jClientAppResult.getAsJsonObject(); - String clientId = jClientAppResultAsJsonObject.get("client_id").getAsString(); - String clientSecret = jClientAppResultAsJsonObject.get("client_secret").getAsString(); +// JsonElement jClientAppResult = jsonParser.parse(clientAppResult); + if (clientId != null && clientSecret != null) { +// JsonObject jClientAppResultAsJsonObject = jClientAppResult.getAsJsonObject(); +// String clientId = jClientAppResultAsJsonObject.get("client_id").getAsString(); +// String clientSecret = jClientAppResultAsJsonObject.get("client_secret").getAsString(); String encodedClientApp = Base64.getEncoder() .encodeToString((clientId + HandlerConstants.COLON + clientSecret).getBytes()); @@ -171,12 +196,18 @@ public class LoginHandler extends HttpServlet { if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { iotsCorePort = System.getProperty("iot.core.http.port"); } + + String keyManagerPort = System.getProperty("iot.keymanager.https.port"); + username = req.getParameter("username"); password = req.getParameter("password"); gatewayUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.gateway.host") + HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme()); uiConfigUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") + HandlerConstants.COLON + iotsCorePort + HandlerConstants.UI_CONFIG_ENDPOINT; + keyManagerUrl = HandlerConstants.HTTPS_PROTOCOL + HandlerConstants.SCHEME_SEPARATOR + + System.getProperty("iot.keymanager.host") + HandlerConstants.COLON + keyManagerPort; + if (username == null || password == null) { String msg = "Invalid login request. Username or Password is not received for login request."; log.error(msg); @@ -193,7 +224,7 @@ public class LoginHandler extends HttpServlet { * @throws IOException IO exception throws if an error occurred when invoking token endpoint */ private ProxyResponse getTokenResult(String encodedClientApp, JsonArray scopes) throws IOException { - HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(keyManagerUrl + HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + encodedClientApp); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); String scopeString = HandlerUtil.getScopeString(scopes); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java index 8ee6ec776b..641aa6d990 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java @@ -61,7 +61,7 @@ public class SsoLoginCallbackHandler extends HttpServlet { String iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") + HandlerConstants.COLON + iotsCorePort; - HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + session.getAttribute("encodedClientApp")); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java index 1ade046d43..23e76b81ae 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java @@ -101,7 +101,7 @@ public class SsoLoginHandler extends HttpServlet { */ private void dynamicClientRegistration(HttpServletRequest req, HttpServletResponse resp) { try { - File userMgtConf = new File("conf/user-mgt.xml"); + File userMgtConf = new File("repository/conf/user-mgt.xml"); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(userMgtConf); @@ -136,7 +136,7 @@ public class SsoLoginHandler extends HttpServlet { JsonArray scopes = uiConfigJsonObject.get("scopes").getAsJsonArray(); // Register the client application - HttpPost apiRegEndpoint = new HttpPost(gatewayUrl + HandlerConstants.APP_REG_ENDPOINT); + HttpPost apiRegEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.APP_REG_ENDPOINT); encodedAdminCredentials = Base64.getEncoder() .encodeToString((adminUsername + HandlerConstants.COLON + adminPassword).getBytes()); apiRegEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + @@ -262,7 +262,7 @@ public class SsoLoginHandler extends HttpServlet { * @throws IOException IO exception throws if an error occurred when invoking token endpoint */ private ProxyResponse getTokenResult(String encodedClientApp) throws IOException { - HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + encodedClientApp); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java index 9686979d53..67b2834516 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java @@ -41,6 +41,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; +import java.util.Base64; @MultipartConfig @WebServlet("/user") @@ -52,8 +53,8 @@ public class UserHandler extends HttpServlet { protected void doPost(HttpServletRequest req, HttpServletResponse resp) { try { String serverUrl = - req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.gateway.host") - + HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme()); + req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") + + HandlerConstants.COLON + HandlerUtil.getCorePort(req.getScheme()); HttpSession httpSession = req.getSession(false); if (httpSession == null) { HandlerUtil.sendUnAuthorizeResponse(resp); @@ -68,26 +69,32 @@ public class UserHandler extends HttpServlet { String accessToken = authData.getAccessToken(); - HttpPost tokenEndpoint = new HttpPost(serverUrl + HandlerConstants.INTROSPECT_ENDPOINT); - tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); - StringEntity tokenEPPayload = new StringEntity("token=" + accessToken, + HttpPost introspectionEndpoint = new HttpPost(serverUrl + HandlerConstants.INTROSPECT_ENDPOINT); + introspectionEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, + ContentType.APPLICATION_FORM_URLENCODED.toString()); + //todo:amalka + String username = "admin"; + String password = "admin"; + introspectionEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + Base64.getEncoder() + .encodeToString((username + HandlerConstants.COLON + password).getBytes())); + StringEntity introspectionPayload = new StringEntity("token=" + accessToken, ContentType.APPLICATION_FORM_URLENCODED); - tokenEndpoint.setEntity(tokenEPPayload); - ProxyResponse tokenStatus = HandlerUtil.execute(tokenEndpoint); + introspectionEndpoint.setEntity(introspectionPayload); + ProxyResponse introspectionStatus = HandlerUtil.execute(introspectionEndpoint); - if (tokenStatus.getExecutorResponse().contains(HandlerConstants.EXECUTOR_EXCEPTION_PREFIX)) { + if (introspectionStatus.getExecutorResponse().contains(HandlerConstants.EXECUTOR_EXCEPTION_PREFIX)) { log.error("Error occurred while invoking the API to get token status."); - HandlerUtil.handleError(resp, tokenStatus); + HandlerUtil.handleError(resp, introspectionStatus); return; } - String tokenData = tokenStatus.getData(); - if (tokenData == null) { + String introspectionData = introspectionStatus.getData(); + if (introspectionData == null) { log.error("Invalid token data is received."); - HandlerUtil.handleError(resp, tokenStatus); + HandlerUtil.handleError(resp, introspectionStatus); return; } JsonParser jsonParser = new JsonParser(); - JsonElement jTokenResult = jsonParser.parse(tokenData); + JsonElement jTokenResult = jsonParser.parse(introspectionData); if (jTokenResult.isJsonObject()) { JsonObject jTokenResultAsJsonObject = jTokenResult.getAsJsonObject(); if (!jTokenResultAsJsonObject.get("active").getAsBoolean()) { diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java index 3d4255c0aa..bedf62385c 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java @@ -22,7 +22,7 @@ public class HandlerConstants { public static final String PUBLISHER_APPLICATION_NAME = "application-mgt-publisher"; public static final String APP_REG_ENDPOINT = "/api-application-registration/register"; public static final String UI_CONFIG_ENDPOINT = "/api/device-mgt-config/v1.0/configurations/ui-config"; - public static final String TOKEN_ENDPOINT = "/token"; + public static final String TOKEN_ENDPOINT = "/oauth2/token"; public static final String INTROSPECT_ENDPOINT = "/oauth2/introspect"; public static final String AUTHORIZATION_ENDPOINT = "/oauth2/authorize"; public static final String APIM_APPLICATIONS_ENDPOINT = "/api/am/store/v0.12/applications/"; @@ -59,6 +59,7 @@ public class HandlerConstants { public static final String SCHEME_SEPARATOR = "://"; public static final String COLON = ":"; public static final String HTTP_PROTOCOL = "http"; + public static final String HTTPS_PROTOCOL = "https"; public static final String UNDERSCORE = "_"; public static final int INTERNAL_ERROR_CODE = 500; diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java index 4582468a0c..bc864c03ee 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java @@ -23,6 +23,8 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; +import com.sun.org.apache.xml.internal.serialize.OutputFormat; +import com.sun.org.apache.xml.internal.serialize.XMLSerializer; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -36,12 +38,12 @@ import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; -import org.apache.xml.serialize.OutputFormat; -import org.apache.xml.serialize.XMLSerializer; import org.json.JSONException; import org.json.JSONObject; import org.w3c.dom.Document; import io.entgra.ui.request.interceptor.beans.ProxyResponse; +import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; +import org.wso2.carbon.context.PrivilegedCarbonContext; import org.xml.sax.SAXException; import javax.servlet.http.HttpServletRequest; @@ -80,6 +82,7 @@ public class HandlerUtil { HandlerConstants.INTERNAL_ERROR_CODE)); return proxyResponse; } else { + int statusCode = response.getStatusLine().getStatusCode(); try (BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()))) { StringBuilder result = new StringBuilder(); @@ -400,4 +403,16 @@ public class HandlerUtil { return stringOutput; } + + public static APIManagementProviderService getAPIManagementProviderService() { + PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + APIManagementProviderService apiManagementProviderService = + (APIManagementProviderService) ctx.getOSGiService(APIManagementProviderService.class, null); + if (apiManagementProviderService == null) { + String msg = "API management provider service has not initialized."; + log.error(msg); + throw new IllegalStateException(msg); + } + return apiManagementProviderService; + } } diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/webapp/META-INF/webapp-classloading.xml b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/webapp/META-INF/webapp-classloading.xml index cc5b3c66d7..9f50930c4f 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/webapp/META-INF/webapp-classloading.xml +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/webapp/META-INF/webapp-classloading.xml @@ -31,5 +31,5 @@ Tomcat environment is the default and every webapps gets it even if they didn't specify it. e.g. If a webapps requires CXF, they will get both Tomcat and CXF. --> - Carbon + CXF3,Carbon diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 2d3df3e061..64e71e342d 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -63,15 +63,15 @@ javax.xml.bind.annotation, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, javax.xml.validation, - org.apache.catalina, - org.apache.catalina.connector, - org.apache.catalina.util, + + + org.apache.commons.logging, - org.apache.coyote, - org.apache.tomcat.util.buf, - org.apache.tomcat.util.http, - org.osgi.service.component, - org.osgi.framework, + + + + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.w3c.dom, org.wso2.carbon.context, org.wso2.carbon.core.util, @@ -79,7 +79,7 @@ org.wso2.carbon.identity.core.util; version="${carbon.identity.imp.pkg.version}", org.wso2.carbon.identity.oauth2.*; version="${carbon.identity-inbound-auth-oauth.imp.pkg.version}", - org.wso2.carbon.tomcat.ext.valves, + org.wso2.carbon.user.api, org.wso2.carbon.user.core.service, org.wso2.carbon.user.core.tenant, @@ -106,8 +106,8 @@ org.apache.commons.pool.impl, org.apache.http.conn, org.apache.http.impl.conn, - javax.xml.soap; version="${javax.xml.soap.imp.pkg.version}", - javax.xml.stream, + + org.apache.axiom.*; version="${axiom.osgi.version.range}", org.wso2.carbon.registry.core.*, org.wso2.carbon.registry.common.*;version="${carbon.registry.imp.pkg.version.range}", diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml index a934c7dc4c..401ad66f4e 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml @@ -107,9 +107,9 @@ org.wso2.carbon.devicemgt:org.wso2.carbon.apimgt.integration.client:${project.version} - - org.wso2.carbon.devicemgt:org.wso2.carbon.apimgt.integration.generated.client:${project.version} - + + + diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml index 067a6af7f8..ff54fb9cb8 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml @@ -24,7 +24,7 @@ - https://${iot.core.host}:${iot.core.https.port} + https://localhost:9443 true diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml index 201296d7d7..956fdf8d49 100644 --- a/features/apimgt-extensions/pom.xml +++ b/features/apimgt-extensions/pom.xml @@ -35,10 +35,10 @@ http://wso2.org - org.wso2.carbon.apimgt.integration.client.feature + org.wso2.carbon.apimgt.webapp.publisher.feature org.wso2.carbon.apimgt.application.extension.feature - org.wso2.carbon.apimgt.handler.server.feature + diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml index ddeeaa5005..9e91286a79 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml @@ -30,7 +30,7 @@ - jdbc:h2:repository/database/WSO2DM_APPM_DB;DB_CLOSE_ON_EXIT=FALSE + jdbc:h2:./repository/database/WSO2DM_APPM_DB;DB_CLOSE_ON_EXIT=FALSE wso2carbon wso2carbon org.h2.Driver diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml index bce727f0f2..29ce4363df 100644 --- a/features/certificate-mgt/pom.xml +++ b/features/certificate-mgt/pom.xml @@ -27,7 +27,6 @@ 4.0.0 - org.wso2.carbon.devicemgt certificate-mgt-feature 4.1.16-SNAPSHOT pom diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml index 055fcd0a57..845938c469 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml @@ -43,34 +43,34 @@ org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.common - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.analytics.data.publisher - - - org.wso2.carbon.registry - org.wso2.carbon.registry.indexing - - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.receiver.stub - - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.stream.stub - - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.publisher.stub - - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.stream.persistence.stub - - - org.wso2.orbit.org.scannotation - scannotation - + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -127,27 +127,27 @@ org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version} - - org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.analytics.data.publisher:${carbon.device.mgt.version} - - - org.wso2.carbon.analytics-common:org.wso2.carbon.event.receiver.stub:${carbon.analytics.common.version} - - - org.wso2.carbon.analytics-common:org.wso2.carbon.event.stream.stub:${carbon.analytics.common.version} - - - org.wso2.carbon.analytics-common:org.wso2.carbon.event.publisher.stub:${carbon.analytics.common.version} - - - org.wso2.carbon.analytics-common:org.wso2.carbon.event.stream.persistence.stub:${carbon.analytics.common.version} - - - org.wso2.orbit.com.fasterxml.jackson.core:jackson-annotations:${jackson-annotations.version} - - - org.wso2.orbit.org.scannotation:scannotation:${scannotation.version} - + + + + + + + + + + + + + + + + + + + + + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml index 9e7e2fd601..23c74aaedb 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml @@ -20,7 +20,7 @@ - + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml index 5b8ee2f562..7d26b7b857 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml @@ -20,7 +20,7 @@ - + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml index a0ba89e8b7..5bbf9e040b 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml @@ -19,7 +19,7 @@ true - true + false application_management diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml index 3c4216dfb9..0222243bf9 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml @@ -87,8 +87,8 @@ org.wso2.carbon.core.server:${carbon.kernel.version} - org.wso2.carbon.governance.metadata.server:${carbon.governance.version} - + + diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index 28f576bf2e..1c4c45ab71 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -39,7 +39,7 @@ org.wso2.carbon.device.mgt.api.feature org.wso2.carbon.device.mgt.feature org.wso2.carbon.device.mgt.extensions.feature - org.wso2.carbon.device.mgt.analytics.feature + diff --git a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml index db6da06d04..6d17103c21 100644 --- a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml +++ b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml @@ -73,14 +73,14 @@ org.codehaus.woodstox wstx-asl - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.analytics.data.publisher - - - org.wso2.carbon.analytics - org.wso2.carbon.analytics.api - + + + + + + + + diff --git a/pom.xml b/pom.xml index 39f8ff4e85..bfa525b9df 100644 --- a/pom.xml +++ b/pom.xml @@ -27,7 +27,6 @@ WSO2 Carbon - Device Management - Parent http://wso2.org WSO2 Connected Device Manager Components - org.wso2 wso2 @@ -43,21 +42,23 @@ components/application-mgt components/policy-mgt components/certificate-mgt - components/webapp-authenticator-framework components/ui-request-interceptor components/transport-mgt features/device-mgt features/apimgt-extensions features/application-mgt features/policy-mgt - features/webapp-authenticator-framework features/certificate-mgt - features/oauth-extensions features/heartbeat-management features/ui-request-interceptor features/jwt-client features/device-mgt-extensions features/transport-mgt + + + + + @@ -245,16 +246,16 @@ org.wso2.carbon.apimgt.webapp.publisher ${carbon.device.mgt.version} - - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.integration.client - ${carbon.device.mgt.version} - - - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.integration.generated.client - ${carbon.device.mgt.version} - + + + + + + + + + + org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations @@ -286,11 +287,11 @@ org.wso2.carbon.device.mgt.analytics.data.publisher ${carbon.device.mgt.version} - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.analytics.wsproxy - ${carbon.device.mgt.version} - + + + + + org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.server.feature @@ -331,11 +332,11 @@ ${carbon.device.mgt.version} - - org.wso2.carbon.devicemgt - org.wso2.carbon.apimgt.handlers - ${carbon.device.mgt.version} - + + + + + org.wso2.carbon.devicemgt org.wso2.carbon.device.application.mgt.server.feature @@ -832,7 +833,7 @@ org.wso2.carbon org.wso2.carbon.logging - ${carbon.kernel.version} + 4.4.9 org.wso2.carbon @@ -1153,17 +1154,17 @@ - - org.apache.cxf - cxf-rt-bindings-http - ${cxf.bindings.version} - - - org.codehaus.jra - jra - - - + + + + + + + + + + + org.apache.cxf cxf-rt-rs-extension-providers @@ -1347,11 +1348,21 @@ gson ${google.gson.version} + + org.wso2.orbit.com.squareup.okhttp + okhttp + ${okhttp.wso2.version} + com.squareup.okhttp3 okhttp ${squareup.okhttp3.version} + + org.wso2.orbit.com.squareup.okio + okio + ${okio.wso2.version} + com.squareup.okio okio @@ -1794,6 +1805,16 @@ commons-validator ${apache.validator.version} + + org.springframework + spring-web + ${spring-web.version} + + + org.apache.cxf + cxf-bundle-jaxrs + ${cxf-bundle-package.version} + @@ -2054,9 +2075,9 @@ 2.2.1 6.1.1 - 4.4.26 - [4.4.0, 5.0.0) - 1.5.4 + 4.6.1 + [4.6.0, 5.0.0) + 5.1.2 1.3 3.1.3 @@ -2097,16 +2118,16 @@ 4.7.15 - 5.11.148 - [5.2.0, 6.0.0) - 5.6.63 + 5.18.187 + [5.2.0, 7.0.0) + 6.4.111 5.4.6 - 1.0.10 - [1.0.10, 2.0.0) + 1.0.31 + [1.0.31, 2.0.0) [5.7.0, 6.0.0) - [5.2.0, 6.0.0) - [5.1.0, 6.0.0) + [5.2.0, 7.0.0) + [5.1.0, 7.0.0) 4.6.11 @@ -2131,8 +2152,8 @@ [2.6.0,3.0.0) - 6.2.201 - (6.0.0,7.0.0] + 9.0.5 + (6.0.0,10.0.0] 5.1.37 @@ -2142,20 +2163,20 @@ 2.1.23 - 4.6.28 - 4.6.8 - [4.4.8, 5.0.0) + 4.7.38 + ${carbon.registry.version} + [4.7.0, 5.0.0) - 3.2.0 - 2.5.11 + 3.3.6 + 1.1.wso2v1 1.9.0 - 1.52.0.wso2v1 - 1.52.0.wso2v2 - [1.52.0,1.60.0) + 1.60.0.wso2v1 + 1.60.0.wso2v1 + [1.52.0,1.70.0) 2.3.0.wso2v2 @@ -2166,7 +2187,9 @@ 3.0.0.wso2v1 1.3 2.3.1 - 3.8.1 + 4.6.0 + 4.2.0.wso2v1 + 2.4.0.wso2v1 1.13.0 9.3.1 1.1.1 @@ -2282,6 +2305,12 @@ 7.0.85 1.0 1.13.1 + + 5.1.2.RELEASE + 2.7.18 + + [1.6.0, 2.0.0) + [1.2.0,1.3.0) From 3ea79ecf77d59a2a48abf9202d67bc1508249072 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 10:51:19 +0530 Subject: [PATCH 02/54] cleaned up components/apimgt-extensions --- .../pom.xml | 32 - ...ApiApplicationRegistrationServiceImpl.java | 2 - .../pom.xml | 52 +- .../APIManagementProviderService.java | 5 +- .../APIManagementProviderServiceImpl.java | 66 +- ...ApplicationManagerExtensionDataHolder.java | 11 - ...ationManagerExtensionServiceComponent.java | 12 - .../pom.xml | 166 +- .../client/publisher/PublisherClient.java | 89 +- .../integration/client/store/StoreClient.java | 124 +- .../pom.xml | 268 +- .../src/main/resources/publisher-api.yaml | 14193 ++++------------ .../pom.xml | 220 +- .../publisher/APIPublisherServiceImpl.java | 8 - .../internal/APIPublisherDataHolder.java | 11 - .../APIPublisherServiceComponent.java | 12 - components/apimgt-extensions/pom.xml | 3 - pom.xml | 10 + 18 files changed, 3503 insertions(+), 11781 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index 9ec68e7315..c99c9d1988 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -48,42 +48,10 @@ cxf-bundle-jaxrs provided - - - - - - - - - - - - - - - - - - - - - - org.codehaus.jackson jackson-jaxrs - - - - - - - - - - commons-httpclient.wso2 commons-httpclient diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java index 96d3c8e059..702db64527 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java @@ -27,8 +27,6 @@ import org.wso2.carbon.apimgt.application.extension.api.util.RegistrationProfile import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants; import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; -//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor; -//import org.wso2.carbon.apimgt.integration.client.store.StoreClient; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index 9e70ed3009..3f0f92602b 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -51,23 +51,13 @@ org.wso2.carbon org.wso2.carbon.logging - - - - - - - - org.wso2.carbon.apimgt org.wso2.carbon.apimgt.api - 9.0.5 org.wso2.carbon.apimgt org.wso2.carbon.apimgt.impl - 9.0.5 provided @@ -117,24 +107,30 @@ API Management Application Bundle org.wso2.carbon.apimgt.application.extension.internal - org.apache.commons.lang;version="[2.6,3)",org.apache.c - ommons.logging;version="[1.2,2)",org.json.simple,org.osgi.framework;v - ersion="${imp.package.version.osgi.framework}",org.osgi.service.component;version="${imp.package.version.osgi.service}",org.wso - 2.carbon.apimgt.api;version="[9.0,10)",org.wso2.carbon.apimgt.api.dto - ;version="[9.0,10)",org.wso2.carbon.apimgt.api.model;version="[9.0,10 - )",org.wso2.carbon.apimgt.application.extension.bean,org.wso2.carbon. - apimgt.application.extension.dto,org.wso2.carbon.apimgt.application.e - xtension.exception,org.wso2.carbon.apimgt.impl;version="[9.0,10)",org - .wso2.carbon.apimgt.impl.utils;version="[9.0,10)",org.wso2.carbon.con - text;version="[4.6,5)",org.wso2.carbon.device.mgt.core.config.ui;vers - ion="[4.1,5)",org.wso2.carbon.identity.jwt.client.extension,org.wso2. - carbon.identity.jwt.client.extension.dto,org.wso2.carbon.identity.jwt - .client.extension.exception,org.wso2.carbon.identity.jwt.client.exten - sion.service,org.wso2.carbon.registry.core.exceptions;version="[1.0,2 - )",org.wso2.carbon.registry.core.service;version="[1.0,2)",org.wso2.c - arbon.registry.indexing.service;version="[4.7,5)",org.wso2.carbon.use - r.api;version="[1.0,2)",org.wso2.carbon.user.core.service;version="[4 - .6,5)",org.wso2.carbon.user.core.tenant;version="[4.6,5)" + org.apache.commons.lang;version="[2.6,3)", + org.apache.commons.logging;version="[1.2,2)", + org.json.simple,org.osgi.framework;version="${imp.package.version.osgi.framework}", + org.osgi.service.component;version="${imp.package.version.osgi.service}", + org.wso2.carbon.apimgt.api;version="[9.0,10)", + org.wso2.carbon.apimgt.api.dto;version="[9.0,10)", + org.wso2.carbon.apimgt.api.model;version="[9.0,10)", + org.wso2.carbon.apimgt.application.extension.bean, + org.wso2.carbon.apimgt.application.extension.dto, + org.wso2.carbon.apimgt.application.extension.exception, + org.wso2.carbon.apimgt.impl;version="[9.0,10)", + org.wso2.carbon.apimgt.impl.utils;version="[9.0,10)", + org.wso2.carbon.context;version="[4.6,5)", + org.wso2.carbon.device.mgt.core.config.ui;version="[4.1,5)", + org.wso2.carbon.identity.jwt.client.extension, + org.wso2.carbon.identity.jwt.client.extension.dto, + org.wso2.carbon.identity.jwt.client.extension.exception, + org.wso2.carbon.identity.jwt.client.extension.service, + org.wso2.carbon.registry.core.exceptions;version="[1.0,2)", + org.wso2.carbon.registry.core.service;version="[1.0,2)", + org.wso2.carbon.registry.indexing.service;version="[4.7,5)", + org.wso2.carbon.user.api;version="[1.0,2)", + org.wso2.carbon.user.core.service;version="[4.6,5)", + org.wso2.carbon.user.core.tenant;version="[4.6,5)" !org.wso2.carbon.apimgt.application.extension.internal, diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java index 67fe9e2583..d1bc3911b6 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java @@ -21,8 +21,6 @@ package org.wso2.carbon.apimgt.application.extension; import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; -//import org.wso2.carbon.apimgt.integration.client.store.StoreClient; -//import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; /** * This comprise on operation that is been done with api manager from CDMF. This service needs to be implemented in APIM. @@ -62,11 +60,10 @@ public interface APIManagementProviderService { * @param username to whom the application is created * @param isAllowedAllDomains application is allowed to all the tenants * @param validityTime validity period of the application -// * @param storeClient Specified store client + * @param scopes scopes * @return consumerkey and secrete of the created application. * @throws APIManagerException */ - ApiApplicationKey generateAndRetrieveApplicationKeys(String apiApplicationName, String tags[], String keyType, diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java index cc385dff44..3b46ace15f 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java @@ -18,20 +18,17 @@ package org.wso2.carbon.apimgt.application.extension; -//import feign.FeignException; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.api.APIAdmin; import org.wso2.carbon.apimgt.api.APIConsumer; import org.wso2.carbon.apimgt.api.APIManagementException; -import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.api.dto.KeyManagerConfigurationDTO; import org.wso2.carbon.apimgt.api.model.API; import org.wso2.carbon.apimgt.api.model.APIKey; import org.wso2.carbon.apimgt.api.model.ApiTypeWrapper; import org.wso2.carbon.apimgt.api.model.Application; -import org.wso2.carbon.apimgt.api.model.KeyManagerConfiguration; import org.wso2.carbon.apimgt.api.model.SubscribedAPI; import org.wso2.carbon.apimgt.api.model.Subscriber; import org.wso2.carbon.apimgt.application.extension.bean.APIRegistrationProfile; @@ -43,17 +40,6 @@ import org.wso2.carbon.apimgt.application.extension.util.APIManagerUtil; import org.wso2.carbon.apimgt.impl.APIAdminImpl; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.APIManagerFactory; -//import org.wso2.carbon.apimgt.integration.client.OAuthRequestInterceptor; -//import org.wso2.carbon.apimgt.integration.client.store.StoreClient; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIInfo; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.APIList; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Application; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationInfo; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKey; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationKeyGenerateRequest; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.ApplicationList; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.Subscription; -//import org.wso2.carbon.apimgt.integration.generated.client.store.model.SubscriptionList; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.core.config.ui.UIConfiguration; @@ -66,7 +52,6 @@ import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; import java.util.ArrayList; -import java.util.HashMap; import java.util.HashSet; import java.util.List; import java.util.Map; @@ -78,66 +63,34 @@ import java.util.Set; public class APIManagementProviderServiceImpl implements APIManagementProviderService { private static final Log log = LogFactory.getLog(APIManagementProviderServiceImpl.class); - private static final String CONTENT_TYPE = "application/json"; - private static final int MAX_API_PER_TAG = 200; - private static final String APP_TIER_TYPE = "application"; public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance(); @Override public boolean isTierLoaded() { -// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() -// .getStoreClient(); - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext() - .getTenantDomain(); -// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); -// try { + + String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); + try { APIUtil.getTiers(APIConstants.TIER_APPLICATION_TYPE, tenantDomain); + return true; } catch (APIManagementException e) { log.error("APIs not ready", e); } - // storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, -// APP_TIER_TYPE, -// tenantDomain, CONTENT_TYPE, null, null); - return true; -// } catch (FeignException e) { -// log.error("Feign Exception", e); -// if (e.status() == 401) { -// OAuthRequestInterceptor oAuthRequestInterceptor = new OAuthRequestInterceptor(); -// String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); -// oAuthRequestInterceptor.removeToken(username, tenantDomain); -// try { -// storeClient.getIndividualTier().tiersTierLevelTierNameGet(ApiApplicationConstants.DEFAULT_TIER, -// APP_TIER_TYPE, tenantDomain, CONTENT_TYPE, null, null); -// } catch (FeignException ex) { -// log.error("Invalid Attempt : " + ex); -// } -// } -// } catch (Exception e) { -// log.error("APIs not ready", e); -// } -// return false; + + return false; } @Override public void removeAPIApplication(String applicationName, String username) throws APIManagerException { -// StoreClient storeClient = APIApplicationManagerExtensionDataHolder.getInstance().getIntegrationClientService() -// .getStoreClient(); -// ApplicationList applicationList = storeClient.getApplications() -// .applicationsGet("", applicationName, 1, 0, CONTENT_TYPE, null); try { APIConsumer apiConsumer = API_MANAGER_FACTORY.getAPIConsumer(username); Application application = apiConsumer.getApplicationsByName(username, applicationName, ""); if (application != null) { -// ApplicationInfo applicationInfo = applicationList.getList().get(0); -// storeClient.getIndividualApplication().applicationsApplicationIdDelete(applicationInfo.getApplicationId(), -// null, null); apiConsumer.removeApplication(application, username); } } catch (APIManagementException e) { - //todo:amalka - e.printStackTrace(); + throw new APIManagerException("Failed to remove api application : " + applicationName, e); } @@ -148,9 +101,8 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe */ @Override public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[], - String keyType, String username, - boolean isAllowedAllDomains, - String validityTime, String scopes) throws APIManagerException { + String keyType, String username, boolean isAllowedAllDomains, String validityTime, String scopes) + throws APIManagerException { String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); if (StringUtils.isEmpty(username)) { diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java index 368fda3a3b..26f0320974 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionDataHolder.java @@ -18,7 +18,6 @@ package org.wso2.carbon.apimgt.application.extension.internal; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; -//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; @@ -35,7 +34,6 @@ public class APIApplicationManagerExtensionDataHolder { private TenantManager tenantManager; private TenantRegistryLoader tenantRegistryLoader; private TenantIndexingLoader indexLoader; -// private IntegrationClientService integrationClientService; private JWTClientManagerService jwtClientManagerService; private APIApplicationManagerExtensionDataHolder() { @@ -94,15 +92,6 @@ public class APIApplicationManagerExtensionDataHolder { return indexLoader; } -// public IntegrationClientService getIntegrationClientService() { -// return integrationClientService; -// } -// -// public void setIntegrationClientService( -// IntegrationClientService integrationClientService) { -// this.integrationClientService = integrationClientService; -// } - public JWTClientManagerService getJwtClientManagerService() { if (jwtClientManagerService == null) { PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java index 4d98527956..d2c675c253 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/internal/APIApplicationManagerExtensionServiceComponent.java @@ -23,7 +23,6 @@ import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext;; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl; -//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.registry.core.service.TenantRegistryLoader; import org.wso2.carbon.registry.indexing.service.TenantIndexingLoader; import org.wso2.carbon.user.core.service.RealmService; @@ -91,17 +90,6 @@ public class APIApplicationManagerExtensionServiceComponent { APIApplicationManagerExtensionDataHolder.getInstance().setIndexLoaderService(null); } -// protected void setIntegrationClientService(IntegrationClientService integrationClientService) { -// if (integrationClientService != null && log.isDebugEnabled()) { -// log.debug("integrationClientService initialized"); -// } -// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(integrationClientService); -// } -// -// protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) { -// APIApplicationManagerExtensionDataHolder.getInstance().setIntegrationClientService(null); -// } - /** * Sets Realm Service. * diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index 0784f282aa..eeddf628a5 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -47,39 +47,46 @@ org.wso2.carbon.apimgt.integration.client.*, !org.wso2.carbon.apimgt.integration.client.internal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + org.osgi.framework, + org.osgi.service.component, + feign, + feign.codec, + feign.auth, + feign.gson, + feign.slf4j, + org.wso2.carbon.apimgt.integration.generated.client.publisher.api, + org.wso2.carbon.apimgt.integration.generated.client.store.api, + javax.xml.bind, + javax.xml.bind.annotation, + javax.xml.parsers;resolution:=optional, + org.apache.commons.logging, + org.w3c.dom, + org.wso2.carbon.context, + org.wso2.carbon.identity.jwt.client.*, + org.wso2.carbon.user.api, + org.wso2.carbon.utils, + com.fasterxml.jackson.annotation, + io.swagger.annotations, + org.wso2.carbon.core.util, + javax.xml, + org.wso2.carbon.base, + javax.net.ssl, + org.apache.commons.lang, + android.util;resolution:=optional, + javax.annotation;resolution:=optional, + javax.net;resolution:=optional, + javax.security.auth.x500;resolution:=optional, + javax.crypto;resolution:=optional, + javax.crypto.spec;resolution:=optional + + + jsr311-api, + feign-jaxrs, + feign-okhttp, + okhttp, + okio + @@ -113,60 +120,55 @@ - - - - - - - - + + com.squareup.okhttp3 + okhttp + + + com.squareup.okio + okio + io.github.openfeign feign-okhttp - - io.github.openfeign - feign-slf4j - 10.7.2 - - - - - - - - - - - - - - - - - - - - - + + org.wso2.carbon + org.wso2.carbon.logging + + + org.eclipse.osgi + org.eclipse.osgi + + + org.eclipse.osgi + org.eclipse.osgi.services + + + com.google.code.gson + gson + + + javax.ws.rs + jsr311-api + - - - - - - - - + + io.swagger + swagger-annotations + + + junit + junit + io.github.openfeign feign-core - - - - + + io.github.openfeign + feign-jackson + io.github.openfeign feign-jaxrs @@ -176,10 +178,10 @@ feign-gson - - - - + + org.testng + testng + org.wso2.carbon.devicemgt org.wso2.carbon.identity.jwt.client.extension diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java index 73a4234a91..3887d59c66 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java @@ -27,8 +27,7 @@ import feign.slf4j.Slf4jLogger; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader; -import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApIsApi; -import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.ApiLifecycleApi; +import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.*; import org.wso2.carbon.core.util.Utils; /** @@ -37,15 +36,13 @@ import org.wso2.carbon.core.util.Utils; public class PublisherClient { private static final Log log = LogFactory.getLog(PublisherClient.class); - private ApIsApi apIsApi = null; - private ApiLifecycleApi apiLifecycleApi = null; -// private APIIndividualApi api = null; -// private APICollectionApi apis = null; -// private DocumentIndividualApi document = null; -// private ApplicationIndividualApi application = null; -// private EnvironmentCollectionApi environments = null; -// private SubscriptionApi subscriptions = null; -// private ThrottlingTierCollectionApi tiers = null; + private APIIndividualApi api = null; + private APICollectionApi apis = null; + private DocumentIndividualApi document = null; + private ApplicationIndividualApi application = null; + private EnvironmentCollectionApi environments = null; + private SubscriptionCollectionApi subscriptions = null; + private ThrottlingTierCollectionApi tiers = null; /** @@ -60,50 +57,40 @@ public class PublisherClient { .requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder()); String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getPublisherEndpoint()); - apIsApi = builder.target(ApIsApi.class, basePath); - apiLifecycleApi = builder.target(ApiLifecycleApi.class, basePath); -// api = builder.target(APIIndividualApi.class, basePath); -// apis = builder.target(APICollectionApi.class, basePath); -// document = builder.target(DocumentIndividualApi.class, basePath); -// application = builder.target(ApplicationIndividualApi.class, basePath); -// environments = builder.target(EnvironmentCollectionApi.class, basePath); -// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); -// tiers = builder.target(ThrottlingTierCollectionApi.class, basePath); + api = builder.target(APIIndividualApi.class, basePath); + apis = builder.target(APICollectionApi.class, basePath); + document = builder.target(DocumentIndividualApi.class, basePath); + application = builder.target(ApplicationIndividualApi.class, basePath); + environments = builder.target(EnvironmentCollectionApi.class, basePath); + subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); + tiers = builder.target(ThrottlingTierCollectionApi.class, basePath); } - public ApIsApi getApIsApi() { - return apIsApi; + public APIIndividualApi getApi() { + return api; } - public ApiLifecycleApi getApiLifecycleApi() { - return apiLifecycleApi; + public APICollectionApi getApis() { + return apis; } - // public APIIndividualApi getApi() { -// return api; -// } -// -// public APICollectionApi getApis() { -// return apis; -// } -// -// public DocumentIndividualApi getDocument() { -// return document; -// } -// -// public ApplicationIndividualApi getApplication() { -// return application; -// } -// -// public EnvironmentCollectionApi getEnvironments() { -// return environments; -// } -// -// public SubscriptionCollectionApi getSubscriptions() { -// return subscriptions; -// } -// -// public ThrottlingTierCollectionApi getTiers() { -// return tiers; -// } + public DocumentIndividualApi getDocument() { + return document; + } + + public ApplicationIndividualApi getApplication() { + return application; + } + + public EnvironmentCollectionApi getEnvironments() { + return environments; + } + + public SubscriptionCollectionApi getSubscriptions() { + return subscriptions; + } + + public ThrottlingTierCollectionApi getTiers() { + return tiers; + } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java index 5d8a46d586..db751f204e 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java @@ -39,17 +39,16 @@ import java.util.concurrent.TimeUnit; public class StoreClient { private static final org.apache.commons.logging.Log log = LogFactory.getLog(StoreClient.class); - private ApplicationsApi applicationsApi = null; -// private APICollectionApi apis = null; -// private ApIsApi individualApi = null; -// private ApplicationsApi applications = null; -// private ApplicationIndividualApi individualApplication = null; -// private SubscriptionCollectionApi subscriptions = null; -// private SubscriptionIndividualApi individualSubscription = null; -// private SubscriptionMultitpleApi subscriptionMultitpleApi = null; -// private ThrottlingTierIndividualApi individualTier = null; -// private TagsApi tags = null; -// private ThrottlingTierCollectionApi tiers = null; + private APICollectionApi apis = null; + private APIIndividualApi individualApi = null; + private ApplicationCollectionApi applications = null; + private ApplicationIndividualApi individualApplication = null; + private SubscriptionCollectionApi subscriptions = null; + private SubscriptionIndividualApi individualSubscription = null; + private SubscriptionMultitpleApi subscriptionMultitpleApi = null; + private ThrottlingTierIndividualApi individualTier = null; + private TagCollectionApi tags = null; + private ThrottlingTierCollectionApi tiers = null; public StoreClient(RequestInterceptor requestInterceptor) { @@ -61,59 +60,58 @@ public class StoreClient { .requestInterceptor(requestInterceptor).encoder(new GsonEncoder()).decoder(new GsonDecoder()); String basePath = Utils.replaceSystemProperty(APIMConfigReader.getInstance().getConfig().getStoreEndpoint()); - applicationsApi = builder.target(ApplicationsApi.class, basePath); -// apis = builder.target(APICollectionApi.class, basePath); -// individualApi = builder.target(ApIsApi.class, basePath); -// applications = builder.target(ApplicationCollectionApi.class, basePath); -// individualApplication = builder.target(ApplicationIndividualApi.class, basePath); -// subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); -// individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath); -// subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath); -// tags = builder.target(TagCollectionApi.class, basePath); -// individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath); -// tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1)) -// .options(new Request.Options(10000, 5000)) -// .target(ThrottlingTierCollectionApi.class, basePath); + apis = builder.target(APICollectionApi.class, basePath); + individualApi = builder.target(APIIndividualApi.class, basePath); + applications = builder.target(ApplicationCollectionApi.class, basePath); + individualApplication = builder.target(ApplicationIndividualApi.class, basePath); + subscriptions = builder.target(SubscriptionCollectionApi.class, basePath); + individualSubscription = builder.target(SubscriptionIndividualApi.class, basePath); + subscriptionMultitpleApi = builder.target(SubscriptionMultitpleApi.class, basePath); + tags = builder.target(TagCollectionApi.class, basePath); + individualTier = builder.target(ThrottlingTierIndividualApi.class, basePath); + tiers = builder.retryer(new Retryer.Default(100L, TimeUnit.SECONDS.toMillis(1L), 1)) + .options(new Request.Options(10000, 5000)) + .target(ThrottlingTierCollectionApi.class, basePath); } -// public APICollectionApi getApis() { -// return apis; -// } -// -// public APIIndividualApi getIndividualApi() { -// return individualApi; -// } -// -// public ApplicationCollectionApi getApplications() { -// return applications; -// } -// -// public ApplicationIndividualApi getIndividualApplication() { -// return individualApplication; -// } -// -// public SubscriptionCollectionApi getSubscriptions() { -// return subscriptions; -// } -// -// public SubscriptionIndividualApi getIndividualSubscription() { -// return individualSubscription; -// } -// -// public ThrottlingTierIndividualApi getIndividualTier() { -// return individualTier; -// } -// -// public TagCollectionApi getTags() { -// return tags; -// } -// -// public ThrottlingTierCollectionApi getTiers() { -// return tiers; -// } -// -// public SubscriptionMultitpleApi getSubscriptionMultitpleApi() { -// return subscriptionMultitpleApi; -// } + public APICollectionApi getApis() { + return apis; + } + + public APIIndividualApi getIndividualApi() { + return individualApi; + } + + public ApplicationCollectionApi getApplications() { + return applications; + } + + public ApplicationIndividualApi getIndividualApplication() { + return individualApplication; + } + + public SubscriptionCollectionApi getSubscriptions() { + return subscriptions; + } + + public SubscriptionIndividualApi getIndividualSubscription() { + return individualSubscription; + } + + public ThrottlingTierIndividualApi getIndividualTier() { + return individualTier; + } + + public TagCollectionApi getTags() { + return tags; + } + + public ThrottlingTierCollectionApi getTiers() { + return tiers; + } + + public SubscriptionMultitpleApi getSubscriptionMultitpleApi() { + return subscriptionMultitpleApi; + } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index cc300b8014..22c399e5b7 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -26,59 +26,61 @@ http://wso2.org - - - org.openapitools - openapi-generator-maven-plugin - 5.0.0 - - - process-resources - publisher - - generate - - - ${project.basedir}/src/main/resources/publisher-api.yaml - java - - ${project.artifactId}.publisher.api - ${project.artifactId}.publisher.model - - - - - process-resources - store - - generate - - - ${project.basedir}/src/main/resources/devportal-api.yaml - java - - ${project.artifactId}.store.api - ${project.artifactId}.store.model - - - - - + + + io.swagger + swagger-codegen-maven-plugin + 2.2.1 + + + process-resources + publisher + + generate + + + ${project.basedir}/src/main/resources/publisher-api.yaml + java + + ${project.artifactId}.publisher.api + ${project.artifactId}.publisher.model + + feign + + + + process-resources + store + + generate + + + ${project.basedir}/src/main/resources/store-api.yaml + java + + ${project.artifactId}.store.api + ${project.artifactId}.store.model + + feign + + + + com.google.code.maven-replacer-plugin replacer 1.5.2 - + process-resources - replace-for-openapi-genenerated-code-publisher + replace-for-swagger-genenerated-code-publisher replace - ${project.basedir}/target/generated-sources/openapi/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java + ${project.basedir}/target/generated-sources/swagger/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java CURRENT_TENANT @@ -113,33 +115,28 @@ org.wso2.carbon.apimgt.integration.generated.client.store.api.*, org.wso2.carbon.apimgt.integration.generated.client.store.model.* - - com.google.gson;version="[2.8,3)", - com.google.gson.annotations;version="[2.8,3)", - com.google.gson.internal.bind.util, - com.google.gson.reflect;version="[2.8,3)", - com.google.gson.stream;version="[2.8,3)", - io.gsonfire;version="[1.8,2)", - io.swagger.annotations;version="[1.5,2)", - javax.annotation;version="[3.0,4)", - javax.net.ssl, - okhttp3, - okhttp3.internal.http, - okhttp3.internal.tls, - okhttp3.logging, - okio, - org.apache.oltu.oauth2.client;version="[1.0,2)", - org.apache.oltu.oauth2.client.request;version="[1.0,2)", - org.apache.oltu.oauth2.client.response;version="[1.0,2)", - org.apache.oltu.oauth2.common.exception;version="[1.0,2)", - org.apache.oltu.oauth2.common.message.types;version="[1.0,2)", - org.threeten.bp;version="[1.5,2)", - org.threeten.bp.format;version="[1.5,2)", - org.threeten.bp.temporal;version="[1.5,2)", - org.wso2.carbon.apimgt.integration.generated.client.publisher.model, - org.wso2.carbon.apimgt.integration.generated.client.store.model - - + + feign;version="${io.github.openfeign.version.range}", + feign.jackson;version="${io.github.openfeign.version.range}", + feign.codec;version="${io.github.openfeign.version.range}", + feign.auth;version="${io.github.openfeign.version.range}", + feign.gson;version="${io.github.openfeign.version.range}", + feign.slf4j;version="${io.github.openfeign.version.range}", + com.google.gson, + com.fasterxml.jackson.core;resolution:=optional, + com.fasterxml.jackson.annotation, + com.fasterxml.jackson.databind;resolution:=optional, + io.swagger.annotations, + javax.net.ssl, + com.fasterxml.jackson.datatype.joda;resolution:=optional, + org.apache.oltu.oauth2.client.*;resolution:=optional, + org.apache.oltu.oauth2.common.*;resolution:=optional, + org.junit;resolution:=optional, + + + jsr311-api, + feign-jaxrs + @@ -148,105 +145,60 @@ - - - io.swagger.core.v3 - swagger-annotations - 2.1.7 - - - com.google.code.gson gson - 2.8.5 - - - - + + javax.ws.rs + jsr311-api + io.swagger swagger-annotations - - com.squareup.okhttp3 - okhttp - 4.9.1 - - - - org.apache.oltu.oauth2 - org.apache.oltu.oauth2.client - 1.0.1 - - - - com.squareup.okhttp3 - logging-interceptor - 4.9.1 - - - - org.threeten - threetenbp - 1.5.0 - - - - io.gsonfire - gson-fire - 1.8.5 - - - io.swagger.parser.v3 - swagger-parser - 2.0.25 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + junit + junit + + + io.github.openfeign + feign-core + + + io.github.openfeign + feign-jackson + + + io.github.openfeign + feign-jaxrs + + + io.github.openfeign + feign-gson + + + org.testng + testng + + + org.apache.oltu.oauth2 + org.apache.oltu.oauth2.client + + + io.github.openfeign + feign-slf4j + + + org.wso2.orbit.com.fasterxml.jackson.core + jackson-databind + ${jackson-databind.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-joda + true diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml index 76fdb6f92d..b2068857a7 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml @@ -1,122 +1,115 @@ -# Copyright (c) 2020, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. -# -# Licensed under the Apache License, Version 2.0 (the "License"); -# you may not use this file except in compliance with the License. -# You may obtain a copy of the License at -# -# http://www.apache.org/licenses/LICENSE-2.0 -# -# Unless required by applicable law or agreed to in writing, software -# distributed under the License is distributed on an "AS IS" BASIS, -# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. -# See the License for the specific language governing permissions and -# limitations under the License. -################################################################################ -openapi: 3.0.1 + +swagger: '2.0' +###################################################### +# Prolog +###################################################### info: - title: WSO2 API Manager - Publisher API + version: "0.12.0" + title: "WSO2 API Manager - Publisher API" description: | - This document specifies a **RESTful API** for WSO2 **API Manager** - **Publisher**. - - # Authentication - Our REST APIs are protected using OAuth2 and access control is achieved through scopes. Before you start invoking - the the API you need to obtain an access token with the required scopes. This guide will walk you through the steps - that you will need to follow to obtain an access token. - First you need to obtain the consumer key/secret key pair by calling the dynamic client registration (DCR) endpoint. You can add your preferred grant types - in the payload. A Sample payload is shown below. - ``` - { - "callbackUrl":"www.google.lk", - "clientName":"rest_api_publisher", - "owner":"admin", - "grantType":"client_credentials password refresh_token", - "saasApp":true - } - ``` - Create a file (payload.json) with the above sample payload, and use the cURL shown bellow to invoke the DCR endpoint. Authorization header of this should contain the - base64 encoded admin username and password. - **Format of the request** - ``` - curl -X POST -H "Authorization: Basic Base64(admin_username:admin_password)" -H "Content-Type: application/json" - \ -d @payload.json https://:/client-registration/v0.17/register - ``` - **Sample request** - ``` - curl -X POST -H "Authorization: Basic YWRtaW46YWRtaW4=" -H "Content-Type: application/json" - \ -d @payload.json https://localhost:9443/client-registration/v0.17/register - ``` - Following is a sample response after invoking the above curl. - ``` - { - "clientId": "fOCi4vNJ59PpHucC2CAYfYuADdMa", - "clientName": "rest_api_publisher", - "callBackURL": "www.google.lk", - "clientSecret": "a4FwHlq0iCIKVs2MPIIDnepZnYMa", - "isSaasApplication": true, - "appOwner": "admin", - "jsonString": "{\"grant_types\":\"client_credentials password refresh_token\",\"redirect_uris\":\"www.google.lk\",\"client_name\":\"rest_api123\"}", - "jsonAppAttribute": "{}", - "tokenType": null - } - ``` - Next you must use the above client id and secret to obtain the access token. - We will be using the password grant type for this, you can use any grant type you desire. - You also need to add the proper **scope** when getting the access token. All possible scopes for publisher REST API can be viewed in **OAuth2 Security** section - of this document and scope for each resource is given in **authorization** section of resource documentation. - Following is the format of the request if you are using the password grant type. - ``` - curl -k -d "grant_type=password&username=&password=" - \ -H "Authorization: Basic base64(cliet_id:client_secret)" - \ https://:/token - ``` - **Sample request** - ``` - curl https://localhost:8243/token -k \ - -H "Authorization: Basic Zk9DaTR2Tko1OVBwSHVjQzJDQVlmWXVBRGRNYTphNEZ3SGxxMGlDSUtWczJNUElJRG5lcFpuWU1h" \ - -d "grant_type=password&username=admin&password=admin&scope=apim:api_view apim:api_create" - ``` - Shown below is a sample response to the above request. - ``` - { - "access_token": "e79bda48-3406-3178-acce-f6e4dbdcbb12", - "refresh_token": "a757795d-e69f-38b8-bd85-9aded677a97c", - "scope": "apim:api_create apim:api_view", - "token_type": "Bearer", - "expires_in": 3600 - } - ``` - Now you have a valid access token, which you can use to invoke an API. - Navigate through the API descriptions to find the required API, obtain an access token as described above and invoke the API with the authentication header. - If you use a different authentication mechanism, this process may change. - - # Try out in Postman - If you want to try-out the embedded postman collection with "Run in Postman" option, please follow the guidelines listed below. - * All of the OAuth2 secured endpoints have been configured with an Authorization Bearer header with a parameterized access token. Before invoking any REST API resource make sure you run the `Register DCR Application` and `Generate Access Token` requests to fetch an access token with all required scopes. - * Make sure you have an API Manager instance up and running. - * Update the `basepath` parameter to match the hostname and port of the APIM instance. - - [![Run in Postman](https://run.pstmn.io/button.svg)](https://app.getpostman.com/run-collection/a09044034b5c3c1b01a9) + This specifies a **RESTful API** for WSO2 **API Manager** - Publisher. + + Please see [full swagger definition](https://raw.githubusercontent.com/wso2/carbon-apimgt/v6.1.66/components/apimgt/org.wso2.carbon.apimgt.rest.api.publisher/src/main/resources/publisher-api.yaml) of the API which is written using [swagger 2.0](http://swagger.io/) specification. contact: - name: WSO2 - url: http://wso2.com/products/api-manager/ - email: architecture@wso2.com + name: "WSO2" + url: "http://wso2.com/products/api-manager/" + email: "architecture@wso2.com" license: - name: Apache 2.0 - url: http://www.apache.org/licenses/LICENSE-2.0.html - version: v2 -servers: - - url: https://apis.wso2.com/api/am/publisher/v2 -security: - - OAuth2Security: - - apim:api_view + name: "Apache 2.0" + url: "http://www.apache.org/licenses/LICENSE-2.0.html" + +###################################################### +# The fixed parts of the URLs of the API +###################################################### + +# The schemes supported by the API +schemes: + - https + +# The domain of the API. +# This is configured by the customer during deployment. +# The given host is just an example. +host: apis.wso2.com + +# The base path of the API. +# Will be prefixed to all paths. +basePath: /api/am/publisher/v0.12 + +# The following media types can be passed as input in message bodies of the API. +# The actual media type must be specified in the Content-Type header field of the request. +# The default is json, i.e. the Content-Type header is not needed to +# be set, but supporting it serves extensibility. +consumes: + - application/json + +# The following media types may be passed as output in message bodies of the API. +# The media type(s) consumable by the requestor is specified in the Accept header field +# of the corresponding request. +# The actual media type returned will be specfied in the Content-Type header field +# of the of the response. +# The default of the Accept header is json, i.e. there is not needed to +# set the value, but supporting it serves extensibility. +produces: + - application/json + + +x-wso2-security: + apim: + x-wso2-scopes: + - description: "" + roles: admin + name: apim:api_view + key: apim:api_view + - description: "" + roles: admin + name: apim:api_create + key: apim:api_create + - description: "" + roles: admin + name: apim:api_publish + key: apim:api_publish + - description: "" + roles: admin + name: apim:tier_view + key: apim:tier_view + - description: "" + roles: admin + name: apim:tier_manage + key: apim:tier_manage + - description: "" + roles: admin + name: apim:subscription_view + key: apim:subscription_view + - description: "" + roles: admin + name: apim:subscription_block + key: apim:subscription_block + - description: "" + roles: admin + name: apim:mediation_policy_view + key: apim:mediation_policy_view + - description: "" + roles: admin + name: apim:api_workflow + key: apim:api_workflow + + +###################################################### +# The "API Collection" resource APIs +###################################################### paths: - ###################################################### - # The "API Collection" resource APIs - ###################################################### /apis: + +#----------------------------------------------------- +# Retrieving the list of all APIs qualifying under a given search condition +#----------------------------------------------------- get: - tags: - - APIs + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"provider\": \"admin\",\n \"version\": \"1.0.0\",\n \"description\": \"This sample API provides Account Status Validation\",\n \"name\": \"AccountVal\",\n \"context\": \"/account\",\n \"id\": \"2e81f147-c8a8-4f68-b4f0-69e0e7510b01\",\n \"status\": \"PUBLISHED\"\n },\n {\n \"provider\": \"admin\",\n \"version\": \"1.0.0\",\n \"description\": null,\n \"name\": \"api1\",\n \"context\": \"/api1\",\n \"id\": \"3e22d2fb-277a-4e9e-8c7e-1c0f7f73960e\",\n \"status\": \"PUBLISHED\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}" summary: | Retrieve/Search APIs description: | @@ -124,10 +117,9 @@ paths: Each retrieved API is represented with a minimal amount of attributes. If you want to get complete details of an API, you need to use **Get details of an API** operation. parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/requestedTenant' - - name: query + - $ref : '#/parameters/limit' + - $ref : '#/parameters/offset' + - name : query in: query description: | **Search condition**. @@ -135,11542 +127,3565 @@ paths: You can search in attributes by using an **":"** modifier. Eg. - "provider:wso2" will match an API if the provider of the API contains "wso2". - "provider:"wso2"" will match an API if the provider of the API is exactly "wso2". - "status:PUBLISHED" will match an API if the API is in PUBLISHED state. - "label:external" will match an API if it contains a Microgateway label called "external". + "provider:wso2" will match an API if the provider of the API is exactly "wso2". + + Additionally you can use wildcards. - Also you can use combined modifiers Eg. - name:pizzashack version:v1 will match an API if the name of the API is pizzashack and version is v1. + "provider:wso2*" will match an API if the provider of the API starts with "wso2". - Supported attribute modifiers are [**version, context, name, status, - description, subcontext, doc, provider, label**] + Supported attribute modifiers are [**version, context, status, + description, subcontext, doc, provider**] If no advanced attribute modifier has been specified, the API names containing the search term will be returned as a result. - Please note that you need to use encoded URL (URL encoding) if you are using a client which does not support URL encoding (such as curl) - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' - - $ref: '#/components/parameters/expand' - - $ref: '#/components/parameters/Accept' + type: string + - $ref : "#/parameters/Accept" + - $ref : "#/parameters/If-None-Match" + tags: + - API (Collection) responses: 200: description: | OK. List of qualifying APIs is returned. + schema: + $ref: '#/definitions/APIList' headers: + Content-Type: + description: The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIList' + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis"' - x-examples: - $ref: docs/examples/apis/apis_get.yaml - operationId: getAllAPIs + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Create a new API -API (Individual) +#----------------------------------------------------- post: - tags: - - APIs - summary: Create a New API + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"PUBLISHED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": false,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\": \"in\"},{\"name\":\"log_out_message\",\"type\": \"out\"}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"integer\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\":\"in\",\"id\":\"142ece76-b208-4aab-b29a-f382045ed066\",\"shared\":false},{\"name\":\"log_out_message\",\"type\":\"out\",\"id\":\"b3527be8-95e6-41e0-8097-3276987b7d4b\",\"shared\":false}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + summary: Create a new API description: | This operation can be used to create a new API specifying the details of the API in the payload. The new API will be in `CREATED` state. There is a special capability for a user who has `APIM Admin` permission such that he can create APIs on behalf of other users. For that he can to specify `"provider" : "some_other_user"` in the payload so that the API's creator will be shown as `some_other_user` in the UI. parameters: - - name: openAPIVersion - in: query - description: Open api version + - in: body + name: body + description: | + API object that needs to be added + required: true schema: - type: string - default: v3 - enum: - - v2 - - v3 - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/API' - required: true + $ref: '#/definitions/API' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/Authorization' + tags: + - API (Individual) responses: 201: description: | Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity. + schema: + $ref: '#/definitions/API' headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string Location: description: | The URL of the newly created resource. - schema: - type: string + type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' + type: string + Authorization: + description: | + The brearer token. + type: string + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string 400: - $ref: '#/components/responses/BadRequest' + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis"' - x-examples: - $ref: docs/examples/apis/apis_post.yaml - operationId: createAPI - - ###################################################### - # The "Individual API" resource APIs - ###################################################### + description: | + Unsupported Media Type. + The entity of the request was in a not supported format. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Individual API" resource APIs +###################################################### /apis/{apiId}: + +#----------------------------------------------------- +# Retrieve the details of an API definition +#----------------------------------------------------- get: - tags: - - APIs - summary: Get Details of an API + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 5000,\r\n \"production\": 1000\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + summary: Get details of an API description: | Using this operation, you can retrieve complete details of a single API. You need to provide the Id of the API to retrive it. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/requestedTenant' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Requested API is returned headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' + type: string + schema: + $ref: '#/definitions/API' 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:api_import_export - - apim:api_product_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"' - x-examples: - $ref: docs/examples/apis/apis_id_get.yaml - operationId: getAPI + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Update the definition of an API +#----------------------------------------------------- put: - tags: - - APIs + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X PUT -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f" + x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/7a2298c4-c905-403f-8fac-38c73301631f\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"integer\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\",\"chicken\"],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\": \"in\"},{\"name\":\"log_out_message\",\"type\": \"out\"}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n \"id\": \"7a2298c4-c905-403f-8fac-38c73301631f\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"1.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created.\\\"}}}},\\\"/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"headers\\\":{},\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#/definitions/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http://www.apache.org/licenses/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http://www.pizzashack.com\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\"https\"],\r\n \"tags\": [\r\n \"chicken\",\r\n \"pizza\"\r\n ],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [{\"name\":\"json_validator\",\"type\":\"in\",\"id\":\"142ece76-b208-4aab-b29a-f382045ed066\",\"shared\":false},{\"name\":\"log_out_message\",\"type\":\"out\",\"id\":\"b3527be8-95e6-41e0-8097-3276987b7d4b\",\"shared\":false}],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" summary: Update an API description: | This operation can be used to update an existing API. But the properties `name`, `version`, `context`, `provider`, `state` will not be changed by this operation. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/API' - required: true + - $ref: '#/parameters/apiId' + - in: body + name: body + description: | + API object that needs to be added + required: true + schema: + $ref: '#/definitions/API' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Successful response with updated API object + schema: + $ref: '#/definitions/API' headers: + Location: + description: | + The URL of the newly created resource. + type: string + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' + type: string 400: - $ref: '#/components/responses/BadRequest' + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 403: - $ref: '#/components/responses/Forbidden' + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"' - operationId: updateAPI + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Delete the definition of an API +#----------------------------------------------------- delete: - tags: - - APIs + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/6fb74674-4ab8-4b52-9886-f9a376985060" + x-wso2-request: | + DELETE https://localhost:9443/api/am/publisher/v0.12/apis/6fb74674-4ab8-4b52-9886-f9a376985060 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK" summary: Delete an API description: | This operation can be used to delete an existing API proving the Id of the API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Resource successfully deleted. - content: {} 403: - $ref: '#/components/responses/Forbidden' + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' + description: | + Not Found. + Resource to be deleted does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_delete - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f"' - operationId: deleteAPI - - /apis/{apiId}/topics: - put: - tags: - - APIs - summary: Update Topics - description: This operation can be used to update topics of an existing API. - operationId: updateTopics - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/TopicList' - required: true - responses: - 200: description: | - OK. - Successful response with updated API object - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' - /apis/{apiId}/reimport-service: - put: - tags: - - APIs - summary: Update the Service that is used to create the API - description: This operation can be used to re-import the Service used to create the API - operationId: reimportServiceFromCatalog - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Successful response with updated API object - headers: - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' +################################################################ +# The swagger resource of "Individual API" resource APIs +################################################################ /apis/{apiId}/swagger: - get: - tags: - - APIs - summary: Get Swagger Definition +#----------------------------------------------------- +# Retrieve the API swagger definition +#----------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/swagger + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\nContent-Length: 329\n\n{\n \"paths\": {\"/*\": {\"get\": {\n \"x-auth-type\": \"Application\",\n \"x-throttling-tier\": \"Unlimited\",\n \"responses\": {\"200\": {\"description\": \"OK\"}}\n }}},\n \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n \"swagger\": \"2.0\",\n \"info\": {\n \"title\": \"PhoneVerification\",\n \"description\": \"Verify a phone number\",\n \"contact\": {\n \"email\": \"xx@ee.com\",\n \"name\": \"xx\"\n },\n \"version\": \"1.0.0\"\n }\n}" + summary: Get swagger definition description: | This operation can be used to retrieve the swagger definition of an API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Requested swagger document of the API is returned headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: "" + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/swagger"' - operationId: getAPISwagger + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Update the API swagger definition +#----------------------------------------------------- put: - tags: - - APIs - summary: Update Swagger Definition + consumes: + - multipart/form-data + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -F apiDefinition=\"{\\\"paths\\\":{\\\"\\/*\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"responses\\\":{\\\"200\\\":{\\\"description\\\":\\\"OK\\\"}}}}},\\\"x-wso2-security\\\":{\\\"apim\\\":{\\\"x-wso2-scopes\\\":[]}},\\\"swagger\\\":\\\"2.0\\\",\\\"info\\\":{\\\"title\\\":\\\"PhoneVerification\\\",\\\"description\\\":\\\"Verify a phone number\\\",\\\"contact\\\":{\\\"email\\\":\\\"xx@ee.com\\\",\\\"name\\\":\\\"xx\\\"},\\\"version\\\":\\\"1.0.0\\\"}}\" -X PUT \"https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger\"" + x-wso2-request: | + PUT https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/swagger + Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013 + Content-Length: 477 + Content-Type: multipart/form-data; boundary=------------------------4f51e636c0003d99 + + --------------------------4f51e636c0003d99 + Content-Disposition: form-data; name="apiDefinition" + + {"paths":{"\/*":{"get":{"x-auth-type":"Application","x-throttling-tier":"Unlimited","responses":{"200":{"description":"OK"}}}}},"x-wso2-security":{"apim":{"x-wso2-scopes":[]}},"swagger":"2.0","info":{"title":"PhoneVerification","description":"Verify a phone number","contact":{"email":"xx@ee.com","name":"xx"},"version":"1.0.0"}} + --------------------------4f51e636c0003d99-- + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"paths\": {\"/*\": {\"get\": {\n \"x-auth-type\": \"Application\",\n \"x-throttling-tier\": \"Unlimited\",\n \"responses\": {\"200\": {\"description\": \"OK\"}}\n }}},\n \"x-wso2-security\": {\"apim\": {\"x-wso2-scopes\": []}},\n \"swagger\": \"2.0\",\n \"info\": {\n \"title\": \"PhoneVerification\",\n \"description\": \"Verify a phone number\",\n \"contact\": {\n \"email\": \"xx@ee.com\",\n \"name\": \"xx\"\n },\n \"version\": \"1.0.0\"\n }\n}" + summary: Update swagger definition description: | This operation can be used to update the swagger definition of an existing API. Swagger definition to be updated is passed as a form data parameter `apiDefinition`. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - apiDefinition: - type: string - description: Swagger definition of the API - url: - type: string - description: Swagger definition URL of the API - file: - type: string - description: Swagger definitio as a file - format: binary + - $ref: '#/parameters/apiId' + - in: formData + name: apiDefinition + description: Swagger definition of the API + type: string + required: true + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. Successful response with updated Swagger definition headers: + Location: + description: | + The URL of the newly created resource. + type: string + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: "" + type: string 400: - $ref: '#/components/responses/BadRequest' + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 403: - $ref: '#/components/responses/Forbidden' + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F apiDefinition=@swagger.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/swagger"' - operationId: updateAPISwagger - - /apis/{apiId}/generate-mock-scripts: - post: - tags: - - APIs - summary: Generate Mock Response Payloads + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +################################################################ +# The thumbnail resource of "Individual API" resource APIs +################################################################ + + /apis/{apiId}/thumbnail: +#------------------------------------------------------------------------------------------------- +# Downloads a thumbnail image of an API +#------------------------------------------------------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail > image.jpg" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail + Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9 + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: image/jpeg\r\n\r\n[image content]" + summary: Get thumbnail image description: | - This operation can be used to generate mock responses from examples of swagger definition of an API. - operationId: generateMockScripts + This operation can be used to download a thumbnail image of an API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - API (Individual) responses: 200: description: | OK. - Requested swagger document of the API is returned with example responses + Thumbnail image returned headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: "" + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested Document does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/generate-mock-scripts"' - - /apis/{apiId}/generated-mock-scripts: - get: - tags: - - APIs - summary: Get Generated Mock Response Payloads + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +#---------------------------------------------------------------------------- +# Upload a thumbnail image to a certain API +#---------------------------------------------------------------------------- + post: + consumes: + - multipart/form-data + x-scope: apim:api_create + x-wso2-curl: "curl -X POST -H \"Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9\" https://localhost:9443/api/am/publisher/v0.12/apis/29c9ec3d-f590-467e-83e6-96d43517080f/thumbnail -F file=@image.jpg" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail + Authorization: Bearer d34baf74-3f02-3929-814e-88b27f750ba9 + Content-Type: multipart/form-data; boundary=------------------------5e542e0e5b50e1e4 + Content-Length: 18333 + + --------------------------5e542e0e5b50e1e4 + Content-Disposition: form-data; name="file"; filename="image.jpg" + Content-Type: image/jpeg + + [image content] + + --------------------------5e542e0e5b50e1e4-- + x-wso2-response: "HTTP/1.1 201 Created\r\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\r\nContent-Type: application/json\r\n\r\n{\r\n \"relativePath\": \"/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/thumbnail\",\r\n \"mediaType\": \"image/jpeg\"\r\n}" + summary: Upload a thumbnail image description: | - This operation can be used to get generated mock responses from examples of swagger definition of an API. - operationId: getGeneratedMockScriptsOfAPI + This operation can be used to upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - in: formData + name: file + description: Image to upload + type: file + required: true + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. - Requested swagger document of the API is returned with example responses + Image updated + schema: + $ref : '#/definitions/FileInfo' headers: - ETag: + Location: description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + The URL of the uploaded thumbnail image of the API. + type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/MockResponsePayloadList' - 304: + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/7a2298c4-c905-403f-8fac-38c73301631f/generated-mock-scripts"' - - /apis/{apiId}/resource-policies: - get: - tags: - - API Resource Policies - summary: Get the Resource Policy(inflow/outflow) Definitions + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Copy API" Processing Function resource API +###################################################### + /apis/copy-api: + +#----------------------------------------------------- +# Create a new API based on an already existing one +#----------------------------------------------------- + post: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/apis/copy-api?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&newVersion=2.0.0 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/25a84fc9-38c0-4578-95e8-29fb6b1c4771\nContent-Type: application/json\n\n{\r\n \"id\": \"25a84fc9-38c0-4578-95e8-29fb6b1c4771\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"context\": \"/pizzashack\",\r\n \"version\": \"2.0.0\",\r\n \"provider\": \"admin\",\r\n \"apiDefinition\": \"{\\\"paths\\\":{\\\"\\\\/order\\\":{\\\"post\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Create a new Order\\\",\\\"parameters\\\":[{\\\"schema\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/Order\\\"},\\\"description\\\":\\\"Order object that needs to be added\\\",\\\"name\\\":\\\"body\\\",\\\"required\\\":true,\\\"in\\\":\\\"body\\\"}],\\\"responses\\\":{\\\"201\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/Order\\\"},\\\"headers\\\":{\\\"Location\\\":{\\\"description\\\":\\\"The URL of the newly created resource.\\\",\\\"type\\\":\\\"string\\\"}},\\\"description\\\":\\\"Created.\\\"}}}},\\\"\\\\/menu\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Return a list of available menu items\\\",\\\"parameters\\\":[],\\\"responses\\\":{\\\"200\\\":{\\\"schema\\\":{\\\"title\\\":\\\"Menu\\\",\\\"properties\\\":{\\\"list\\\":{\\\"items\\\":{\\\"$ref\\\":\\\"#\\\\/definitions\\\\/MenuItem\\\"},\\\"type\\\":\\\"array\\\"}},\\\"type\\\":\\\"object\\\"},\\\"headers\\\":{},\\\"description\\\":\\\"OK.\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application\\\\/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"MenuItem\\\":{\\\"title\\\":\\\"Pizza menu Item\\\",\\\"properties\\\":{\\\"price\\\":{\\\"type\\\":\\\"string\\\"},\\\"description\\\":{\\\"type\\\":\\\"string\\\"},\\\"name\\\":{\\\"type\\\":\\\"string\\\"},\\\"image\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"name\\\"]},\\\"Order\\\":{\\\"title\\\":\\\"Pizza Order\\\",\\\"properties\\\":{\\\"customerName\\\":{\\\"type\\\":\\\"string\\\"},\\\"delivered\\\":{\\\"type\\\":\\\"boolean\\\"},\\\"pizzaType\\\":{\\\"type\\\":\\\"string\\\"},\\\"address\\\":{\\\"type\\\":\\\"string\\\"},\\\"creditCardNumber\\\":{\\\"type\\\":\\\"string\\\"},\\\"quantity\\\":{\\\"type\\\":\\\"number\\\"},\\\"orderId\\\":{\\\"type\\\":\\\"string\\\"}},\\\"required\\\":[\\\"orderId\\\"]}},\\\"consumes\\\":[\\\"application\\\\/json\\\"],\\\"info\\\":{\\\"title\\\":\\\"PizzaShackAPI\\\",\\\"description\\\":\\\"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\\\n\\\",\\\"license\\\":{\\\"name\\\":\\\"Apache 2.0\\\",\\\"url\\\":\\\"http:\\\\/\\\\/www.apache.org\\\\/licenses\\\\/LICENSE-2.0.html\\\"},\\\"contact\\\":{\\\"email\\\":\\\"architecture@pizzashack.com\\\",\\\"name\\\":\\\"John Doe\\\",\\\"url\\\":\\\"http:\\\\/\\\\/www.pizzashack.com\\\"},\\\"version\\\":\\\"2.0.0\\\"}}\",\r\n \"wsdlUri\": null,\r\n \"status\": \"CREATED\",\r\n \"responseCaching\": \"Disabled\",\r\n \"cacheTimeout\": 300,\r\n \"destinationStatsEnabled\": null,\r\n \"isDefaultVersion\": false,\r\n \"type\": \"HTTP\",\r\n \"transport\": [\"https\"],\r\n \"tags\": [\r\n \"chicken\",\r\n \"pizza\"\r\n ],\r\n \"tiers\": [\"Unlimited\"],\r\n \"maxTps\": {\r\n \"sandbox\": 500,\r\n \"production\": 100\r\n },\r\n \"thumbnailUri\": null,\r\n \"visibility\": \"PUBLIC\",\r\n \"visibleRoles\": [],\\r\n \"endpointConfig\": \"{\\\"production_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"sandbox_endpoints\\\":{\\\"url\\\":\\\"https://localhost:9443/am/sample/pizzashack/v1/api/\\\",\\\"config\\\":null},\\\"endpoint_type\\\":\\\"http\\\"}\",\r\n \"endpointSecurity\": {\r\n \"username\": \"user\",\r\n \"type\": \"basic\",\r\n \"password\": \"pass\"\r\n },\r\n \"gatewayEnvironments\": \"Production and Sandbox\",\r\n \"sequences\": [],\r\n \"subscriptionAvailability\": null,\r\n \"subscriptionAvailableTenants\": [],\r\n \"businessInformation\": {\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"technicalOwner\": \"John Doe\",\r\n \"businessOwner\": \"Jane Roe\"\r\n },\r\n \"corsConfiguration\": {\r\n \"accessControlAllowOrigins\": [\"*\"],\r\n \"accessControlAllowHeaders\": [\r\n \"authorization\",\r\n \"Access-Control-Allow-Origin\",\r\n \"Content-Type\",\r\n \"SOAPAction\"\r\n ],\r\n \"accessControlAllowMethods\": [\r\n \"GET\",\r\n \"PUT\",\r\n \"POST\",\r\n \"DELETE\",\r\n \"PATCH\",\r\n \"OPTIONS\"\r\n ],\r\n \"accessControlAllowCredentials\": false,\r\n \"corsConfigurationEnabled\": false\r\n }\r\n}" + summary: Create a new API version description: | - This operation can be used to retrieve conversion policy resource definitions of an API. + This operation can be used to create a new version of an existing API. The new version is specified as `newVersion` query parameter. New API will be in `CREATED` state. parameters: - - $ref: '#/components/parameters/apiId' - - name: resourcePath + - name: newVersion + description: Version of the new API. + type: string in: query - description: Resource path of the resource policy definition + required: true + - $ref: '#/parameters/apiId-Q' + tags: + - API (Individual) + responses: + 201: + description: | + Created. + Successful response with the newly created API as entity in the body. Location header contains URL of newly created API. + headers: + Location: + description: | + The URL of the newly created API. + type: string + 400: + description: | + Bad Request. + Invalid request or validation error schema: - type: string - - name: verb - in: query - description: HTTP verb of the resource path of the resource policy definition + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + API to copy does not exist. + 401: + description: | + Unauthenticated request. schema: - type: string - - name: sequenceType + $ref: '#/definitions/Error' + +###################################################### +# The "Change Lifecycle" Processing Function resource API +###################################################### + /apis/change-lifecycle: + +#----------------------------------------------------- +# Change the lifecycle of an API +#----------------------------------------------------- + post: + x-scope: apim:api_publish + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK" + summary: Change API Status + description: | + This operation is used to change the lifecycle of an API. Eg: Publish an API which is in `CREATED` state. In order to change the lifecycle, we need to provide the lifecycle `action` as a query parameter. + + For example, to Publish an API, `action` should be `Publish`. Note that the `Re-publish` action is available only after calling `Block`. + + Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information. + parameters: + - name: action + description: | + The action to demote or promote the state of the API. + + Supported actions are [ **Publish, Deploy as a Prototype, Demote to Created, Demote to Prototyped, Block, Deprecate, Re-Publish, Retire **] + in: query - description: sequence type of the resource policy resource definition + type: string required: true - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' + enum: + - Publish + - Deploy as a Prototype + - Demote to Created + - Demote to Prototyped + - Block + - Deprecate + - Re-Publish + - Retire + - name: lifecycleChecklist + description: | + + Supported checklist items are as follows. + 1. **Deprecate Old Versions**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. + 2. **Require Re-Subscription**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. + + You can specify additional checklist items by using an **"attribute:"** modifier. + + Eg: "Deprecate Old Versions:true" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in "attribute1:true, attribute2:false" format. + + **Sample CURL :** curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/v0.12/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate Old Versions:true,Require Re-Subscription:true" + + type: string + in: query + - $ref: '#/parameters/apiId-Q' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - API (Individual) responses: 200: description: | OK. - List of resource policy definitions of the API is returned + Lifecycle changed successfully. headers: ETag: description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + Entity Tag of the changed API. Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | - Date and time the resource has been modifed the last time. + Date and time the API lifecycle has been modified the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ResourcePolicyList' - 304: + type: string + 400: description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies?resourcePath=checkPhoneNumber&verb=post&sequenceType=in"' - operationId: getAPIResourcePolicies - - /apis/{apiId}/resource-policies/{resourcePolicyId}: + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Document Collection" resource APIs +###################################################### + /apis/{apiId}/documents: + +#----------------------------------------------------- +# Retrieve the documents associated with an API that qualify under a search condition +#----------------------------------------------------- get: - tags: - - API Resource Policies - summary: Get the Resource Policy(inflow/outflow) Definition for a Given Resource - Identifier. + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n },\n {\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"URL\",\n \"sourceUrl\": \"http://wiki.cdyne.com/index.php/Phone_Verification\",\n \"otherTypeName\": null,\n \"documentId\": \"4145df31-04f1-440c-8d08-68952874622c\",\n \"summary\": \"This is the URL for online documentation\",\n \"name\": \"Online Documentation\",\n \"type\": \"SAMPLES\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}" + summary: Get a list of documents of an API description: | - This operation can be used to retrieve conversion policy resource definitions of an API given the resource identifier. + This operation can be used to retrive a list of documents belonging to an API by providing the id of the API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/resourcePolicyId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/limit' + - $ref: '#/parameters/offset' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + tags: + - Document (Collection) responses: 200: description: | OK. - Requested resource policy definition of the API is returned for the given resource identifier. + Document list is returned. + schema: + $ref: '#/definitions/DocumentList' headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ResourcePolicyInfo' + type: string + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 400: - $ref: '#/components/responses/BadRequest' 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies/8efc32a4-c7f1-4bee-b860-b7566e2bc0d5"' - operationId: getAPIResourcePoliciesByPolicyId + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' - put: - tags: - - API Resource Policies - summary: Update the Resource Policy(inflow/outflow) Definition for the Given - Resource Identifier +#----------------------------------------------------- +# Add a document to a certain API +#----------------------------------------------------- + post: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"summary\": \"This is a sample documentation\",\n \"name\": \"Introduction to PhoneVerification API\",\n \"type\": \"HOWTO\"\n}" + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058\",\n \"summary\": \"This is a sample documentation\",\n \"name\": \"Introduction to PhoneVerification API\",\n \"type\": \"HOWTO\"\n}" + summary: Add a new document to an API description: | - This operation can be used to update the resource policy(inflow/outflow) definition for the given resource identifier of an existing API. resource policy definition to be updated is passed as a body parameter `content`. + This operation can be used to add a new documentation to an API. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API document ** API once we obtain a document Id by this operation. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/resourcePolicyId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: Content of the resource policy definition that needs to be updated - content: - application/json: - schema: - $ref: '#/components/schemas/ResourcePolicyInfo' - required: true + - $ref: '#/parameters/apiId' + - in: body + name: body + description: | + Document object that needs to be added + required: true + schema: + $ref: '#/definitions/Document' + - $ref: '#/parameters/Content-Type' + tags: + - Document (Collection) responses: - 200: + 201: description: | - OK. - Successful response with updated the resource policy definition + Created. + Successful response with the newly created Document object as entity in the body. + Location header contains URL of newly added document. + schema: + $ref: '#/definitions/Document' headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string Location: description: | - The URL of the newly created resource. - schema: - type: string + Location to the newly created Document. + type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ResourcePolicyInfo' + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string 400: - $ref: '#/components/responses/BadRequest' - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/resource-policies/8efc32a4-c7f1-4bee-b860-b7566e2bc0d5"' - operationId: updateAPIResourcePoliciesByPolicyId + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' + 415: + description: | + Unsupported media type. + The entity of the request was in a not supported format. - /apis/{apiId}/thumbnail: +###################################################### +# The "Individual Document" resource APIs +###################################################### + '/apis/{apiId}/documents/{documentId}': + +#----------------------------------------------------- +# Retrieve a particular document of a certain API +#----------------------------------------------------- get: - tags: - - APIs - summary: Get Thumbnail Image + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" + summary: Get a document of an API description: | - This operation can be used to download a thumbnail image of an API. + This operation can be used to retrieve a particular document's metadata associated with an API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Document (Individual) responses: 200: description: | OK. - Thumbnail image returned + Document returned. + schema: + $ref: '#/definitions/Document' headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested Document does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/thumbnail"' - operationId: getAPIThumbnail + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Update a particular document of a certain API +#----------------------------------------------------- put: - tags: - - APIs - summary: Upload a Thumbnail Image + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" -H \"Content-Type: application/json\" -X PUT -d data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\"" + x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\nAuthorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"visibility\": \"API_LEVEL\",\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"0bcb7f05-599d-4e1a-adce-5cb89bfe58d5\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" + summary: Update a document of an API description: | - This operation can be used to upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`. - operationId: updateAPIThumbnail + This operation can be used to update metadata of an API's document. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - required: - - file - properties: - file: - type: string - description: Image to upload - format: binary - required: true + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - in: body + name: body + description: | + Document object that needs to be added + required: true + schema: + $ref: '#/definitions/Document' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Document (Individual) responses: 200: description: | OK. - Image updated + Document updated + schema: + $ref: '#/definitions/Document' headers: + Location: + description: | + The URL of the updated document. + type: string + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the uploaded thumbnail image of the API. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/FileInfo' + type: string 400: - $ref: '#/components/responses/BadRequest' + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=image.jpeg "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/thumbnail"' - - /apis/{apiId}/subscription-policies: - get: - tags: - - APIs - summary: | - Get Details of the Subscription Throttling Policies of an API - description: | - This operation can be used to retrieve details of the subscription throttling policy of an API by specifying the API Id. - - `X-WSO2-Tenant` header can be used to retrive API subscription throttling policies that belongs to a different tenant domain. If not specified super tenant will be used. If Authorization header is present in the request, the user's tenant associated with the access token will be used. + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Delete a particular document of a certain API +#----------------------------------------------------- + delete: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058" + x-wso2-request: | + DELETE https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/ffd5790d-b7a9-4cb6-b76a-f8b83ecdd058 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK" + summary: Delete a document of an API + description: | + This operation can be used to delete a document associated with an API. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Document (Individual) + responses: + 200: + description: | + OK. + Resource successfully deleted. + 404: + description: | + Not Found. + Resource to be deleted does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +################################################################ +# The content resource of "Individual Document" resource APIs +################################################################ + + '/apis/{apiId}/documents/{documentId}/content': + + #------------------------------------------------------------------------------------------------- + # Downloads a FILE type document/get the inline content or source url of a certain document + #------------------------------------------------------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a\" \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\" > sample.pdf" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content + Authorization:Bearer b0982cd2aacd463ff5f63cd5ebe58f4a + x-wso2-response: "HTTP/1.1 200 OK\nContent-Disposition: attachment; filename=\"sample.pdf\"\nContent-Type: application/octet-stream\nContent-Length: 7802\n\n%PDF-1.4\n%äüöß\n2 0 obj\n<>\nstream\n..\n>>\nstartxref\n7279\n%%EOF" + summary: Get the content of an API document + description: | + This operation can be used to retrive the content of an API's document. + + The document can be of 3 types. In each cases responses are different. + + 1. **Inline type**: + The content of the document will be retrieved in `text/plain` content type + + _Sample cURL_ : `curl -k -H "Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51" -F inlineContent=@"docs.txt" -X POST "https://localhost:9443/api/am/publisher/v0.12/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` + 2. **FILE type**: + The file will be downloaded with the related content type (eg. `application/pdf`) + 3. **URL type**: + The client will recieve the URL of the document as the Location header with the response with - `303 See Other` + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Document (Individual) + responses: + 200: + description: | + OK. + File or inline content returned. + headers: + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 303: + description: | + See Other. + Source can be retrived from the URL specified at the Location header. + headers: + Location: + description: | + The Source URL of the document. + type: string + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + 404: + description: | + Not Found. + Requested Document does not exist. + schema: + $ref: '#/definitions/Error' + 406: + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + + #---------------------------------------------------------------------------- + # Upload a file or add inline content to a document of a certain API + #---------------------------------------------------------------------------- + post: + consumes: + - multipart/form-data + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -F file=@\"sample.pdf\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/daf732d3-bda2-46da-b381-2c39d901ea61/content\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content + Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + Content-Length: 8004 + Content-Type: multipart/form-data; boundary=------------------------7b9a53f1ffa452b9 + + --------------------------7b9a53f1ffa452b9 + Content-Disposition: form-data; name="file"; filename="sample.pdf" + Content-Type: application/octet-stream + + [file content] + + --------------------------7b9a53f1ffa452b9-- + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/apis/8848faaa-7fd1-478a-baa2-48a4ebb92c98/documents/b3a79270-02bb-4e39-9ac1-90ce8f6c84af/content\nContent-Type: application/json\n\n{\n \"visibility\":\"API_LEVEL\",\n \"sourceType\":\"FILE\",\n \"sourceUrl\":null,\n \"otherTypeName\":null,\n \"documentId\":\"daf732d3-bda2-46da-b381-2c39d901ea61\",\n \"summary\":\"This is a sample documentation pdf\",\n \"name\":\"Introduction to PhoneVerification API PDF\",\n \"type\":\"HOWTO\"\n}" + summary: Upload the content of an API document + description: | + Thid operation can be used to upload a file or add inline content to an API document. + + **IMPORTANT:** + * Either **file** or **inlineContent** form data parameters should be specified at one time. + * Document's source type should be **FILE** in order to upload a file to the document using **file** parameter. + * Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/documentId' + - in: formData + name: file + description: Document to upload + type: file + required: false + - in: formData + name: inlineContent + description: Inline content of the document + type: string + required: false + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Document (Individual) + responses: + 200: + description: | + OK. + Document updated + schema: + $ref: '#/definitions/Document' + headers: + Location: + description: | + The URL of the updated content of the document. + type: string + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + + ##pp +###################################################### +# The "specific mediation policy" resource APIs +###################################################### + '/apis/{apiId}/policies/mediation': + + #----------------------------------------------------------------------------------------- + # Retrieving the list of all API specific mediation sequences under a given search condition + #----------------------------------------------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc\" https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation" + x-wso2-request: "GET https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\r\nAuthorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc" + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"count\": 1,\r\n \"next\": null,\r\n \"previous\": null,\r\n \"list\": [ {\r\n \"name\": \"add_custom_header_fault\",\r\n \"id\": \"6460d7e6-4272-4e3a-9879-437228d83123\",\r\n \"type\": \"fault\"\r\n }]\r\n}" + summary: | + Get all mediation policies of an API + description: | + This operation provides you a list of available mediation policies of an API. + parameters: + - $ref: '#/parameters/apiId' + - $ref : '#/parameters/limit' + - $ref : '#/parameters/offset' + - name : query + in: query + description: "-Not supported yet-" + type: string + - $ref : "#/parameters/Accept" + - $ref : "#/parameters/If-None-Match" + tags: + - Mediation Policy (Collection) + responses: + 200: + description: | + OK. + List of qualifying APIs is returned. + schema: + $ref: '#/definitions/mediationList' + headers: + Content-Type: + description: The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + 406: + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +#---------------------------------------------------------------------------- +# Upload an API specific mediation policy +#---------------------------------------------------------------------------- + post: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer 6cea3696-0151-3282-bf79-a0c4db6f308a\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation\r\nContent-Type: application/json\r\nAuthorization: Bearer 6cea3696-0151-3282-bf79-a0c4db6f308a\r\n\r\n{\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" + x-wso2-response: "HTTP/1.1 201 Created\r\nLocation: https://localhost:9443/api/am/publisher/v0.12/registry/resource/_system/governance/apimgt/applicationdata/provider/admin/hello/1.0.0/fault/add_custom_header_fault.xml\r\nContent-Type: application/json\r\n\r\n{ \r\n \"id\":\"624b9f7d-bfaf-484b-94cc-e84491f5d725\",\r\n \"name\":\"add_custom_header_fault\",\r\n \"type\":\"fault\",\r\n \"config\":\"\\n \\n\\n\"\r\n}" + summary: Add an API specific mediation policy + description: | + This operation can be used to add an API specifc mediation policy. + parameters: + - in: body + name: body + description: mediation policy to upload + required: true + schema: + $ref: '#/definitions/Mediation' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Mediation Policy (Collection) + responses: + 200: + description: | + OK. + mediation policy uploaded + schema: + $ref : '#/definitions/Mediation' + headers: + Location: + description: | + The URL of the uploaded thumbnail image of the API. + type: string + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Individual API specific mediation sequence" resource +###################################################### + /apis/{apiId}/policies/mediation/{mediationPolicyId}: + +#----------------------------------------------------- +# Retrieve a particular API specific mediation squence +#----------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer 5aa0acc0-0ce3-3a0b-8cc8-db5ef696ee23\" https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/624b9f7d-bfaf-484b-94cc-e84491f5d725" + x-wso2-request: "GET https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/624b9f7d-bfaf-484b-94cc-e84491f5d725\r\nAuthorization: Bearer 5aa0acc0-0ce3-3a0b-8cc8-db5ef696ee23" + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"id\": \"624b9f7d-bfaf-484b-94cc-e84491f5d725\",\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" + summary: Get an API specific mediation policy + description: | + This operation can be used to retrieve a particular API specific mediation policy. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/mediationPolicyId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Mediation Policy (Individual) + responses: + 200: + description: | + OK. + Mediation policy returned. + schema: + $ref: '#/definitions/Mediation' + headers: + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + 404: + description: | + Not Found. + Requested Document does not exist. + schema: + $ref: '#/definitions/Error' + 406: + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Delete the mediation policy +#----------------------------------------------------- + delete: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc\" -X DELETE https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/60f5146d-1774-405d-86b3-9b040ac266d5" + x-wso2-request: "DELETE https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/60f5146d-1774-405d-86b3-9b040ac266d5\r\nAuthorization: Bearer fb2a0784-f60c-3276-8fde-5b0f70e61ecc" + x-wso2-response: "HTTP/1.1 200 OK" + summary: Delete an API specific mediation policy + description: | + This operation can be used to delete an existing API specific mediation policy providing the Id of the API and the Id of the mediation policy. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/mediationPolicyId' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Mediation Policy (Individual) + responses: + 200: + description: | + OK. + Resource successfully deleted. + 403: + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + Resource to be deleted does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Update the a mediation policy +#----------------------------------------------------- + put: + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer 9e41fae2-3ada-3dd1-8f12-2077202f4285\" -H \"Content-Type: application/json\" -X PUT -d @data.json https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/820fdcf7-7258-42b5-809e-674b893644d1" + x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/apis/40082986-6488-4b86-801a-b0b069d4588c/policies/mediation/820fdcf7-7258-42b5-809e-674b893644d1\r\nContent-Type: application/json\r\nAuthorization: Bearer 9e41fae2-3ada-3dd1-8f12-2077202f4285\r\n\r\n{\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"id\": \"a7365481-5b3f-463c-a646-a498895ac210\",\r\n \"name\": \"add_custom_header_fault\",\r\n \"type\": \"fault\",\r\n \"config\": \"\\n \\n<\\/sequence>\\n\"\r\n}" + summary: Update an API specific mediation policy + description: | + This operation can be used to update an existing mediation policy of an API. + parameters: + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/mediationPolicyId' + - in: body + name: body + description: | + Mediation policy object that needs to be updated + required: true + schema: + $ref: '#/definitions/Mediation' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Mediation Policy (Individual) + responses: + 200: + description: | + OK. + Successful response with updated API object + schema: + $ref: '#/definitions/Mediation' + headers: + Location: + description: | + The URL of the newly created resource. + type: string + Content-Type: + description: | + The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' + 403: + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' + 404: + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The wsdl Resource +###################################################### + /apis/{apiId}/wsdl: + +#----------------------------------------------------- +# Retrieve the details about a certain wsdl +#----------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/apis/7f82f6b0-2667-441e-af23-c0fc44cf3a17/wsdl\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/apis/7f82f6b0-2667-441e-af23-c0fc44cf3a17/wsdl + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"name\": \"admin--hello1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n \\n <\\/output>\\n <\\/operation>\\n <\\/portType>\\n \\n \\n \\n \\n \\n \\n <\\/input>\\n \\n \\n <\\/output>\\n <\\/operation>\\n <\\/binding>\\n \\nWSDL File for HelloService<\\/documentation>\\n \\n \\n <\\/port>\\n <\\/service>\\n<\\/definitions>\"\r\n}" + summary: Get the WSDL of an API + description: | + This operation can be used to retrieve the WSDL definition of an API. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/requestedTenant' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Wsdl (Individual) responses: 200: description: | OK. - Throttling Policy returned + Requested WSDL DTO object belongs to the API + schema: + $ref: '#/definitions/Wsdl' headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests. - schema: - type: string + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ThrottlingPolicy' + Used by caches, or in conditional requests (Will be supported in future). + type: string + 304: description: | Not Modified. - Empty body because the client has already the latest version of the requested resource. - content: {} + Empty body because the client has already the latest version of the requested resource (Will be supported in future). 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/2fd14eb8-b828-4013-b448-0739d2e76bf7/subscription-policies"' - operationId: getAPISubscriptionPolicies - - /apis/copy-api: - post: - tags: - - APIs - summary: Create a New API Version - description: | - This operation can be used to create a new version of an existing API. The new version is specified as `newVersion` query parameter. New API will be in `CREATED` state. - parameters: - - name: newVersion - in: query - description: Version of the new API. - required: true - schema: - maxLength: 30 - type: string - - name: defaultVersion - in: query - description: Specifies whether new API should be added as default version. - schema: - type: boolean - default: false - - name: serviceVersion - in: query - description: Version of the Service that will used in creating new version - schema: - type: string - required: false - - $ref: '#/components/parameters/apiId-Q' - responses: - 201: description: | - Created. - Successful response with the newly created API as entity in the body. Location header contains URL of newly created API. - headers: - Location: - description: | - The URL of the newly created API. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/copy-api?newVersion=2.0&defaultVersion=false&apiId=2fd14eb8-b828-4013-b448-0739d2e76bf7"' - x-examples: - $ref: docs/examples/apis/apis_copyapi.yaml#/post - operationId: createNewAPIVersion - - /apis/change-lifecycle: + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Add a wsdl to the registry +#----------------------------------------------------- post: - tags: - - API Lifecycle - summary: Change API Status + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization:Bearer 5311eca3-8ac8-354e-ab36-7e2fdd6a4013\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/apis/af3f96da-9ccf-463f-8cee-13ec8530a9cd/wsdl\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/apis/af3f96da-9ccf-463f-8cee-13ec8530a9cd/wsdl\r\nContent-Type: application/json\r\nAuthorization: Bearer 7d237cab-7011-3f81-b384-24d03e750873\r\n\r\n{\r\n \"name\": \"admin--PizzaShackAPI1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n \\n <\\/output>\\n <\\/operation>\\n <\\/portType>\\n \\n \\n \\n \\n \\n \\n <\\/input>\\n \\n \\n <\\/output>\\n <\\/operation>\\n <\\/binding>\\n \\nWSDL File for HelloService<\\/documentation>\\n \\n \\n <\\/port>\\n <\\/service>\\n<\\/definitions>\"\r\n}" + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"name\": \"admin--PizzaShackAPI1.0.0.wsdl\",\r\n \"wsdlDefinition\": \"\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n <\\/part>\\n <\\/message>\\n \\n \\n \\n <\\/input>\\n \\n <\\/output>\\n <\\/operation>\\n <\\/portType>\\n \\n \\n \\n \\n \\n \\n <\\/input>\\n \\n \\n <\\/output>\\n <\\/operation>\\n <\\/binding>\\n \\nWSDL File for HelloService<\\/documentation>\\n \\n \\n <\\/port>\\n <\\/service>\\n<\\/definitions>\"\r\n}" + summary: Add a WSDL to an API description: | - This operation is used to change the lifecycle of an API. Eg: Publish an API which is in `CREATED` state. In order to change the lifecycle, we need to provide the lifecycle `action` as a query parameter. - - For example, to Publish an API, `action` should be `Publish`. Note that the `Re-publish` action is available only after calling `Block`. - - Some actions supports providing additional paramters which should be provided as `lifecycleChecklist` parameter. Please see parameters table for more information. + This operation can be used to add a WSDL definition to an existing API. parameters: - - name: action - in: query + - $ref: '#/parameters/apiId' + - in: body + name: body description: | - The action to demote or promote the state of the API. - - Supported actions are [ **Publish**, **Deploy as a Prototype**, **Demote to Created**, **Block**, **Deprecate**, **Re-Publish**, **Retire** ] + JSON payload including WSDL definition that needs to be added required: true schema: - type: string - enum: - - Publish - - Deploy as a Prototype - - Demote to Created - - Block - - Deprecate - - Re-Publish - - Retire - - name: lifecycleChecklist - in: query - description: |2 - - Supported checklist items are as follows. - 1. **Deprecate old versions after publishing the API**: Setting this to true will deprecate older versions of a particular API when it is promoted to Published state from Created state. - 2. **Requires re-subscription when publishing the API**: If you set this to true, users need to re subscribe to the API although they may have subscribed to an older version. - You can specify additional checklist items by using an **"attribute:"** modifier. - Eg: "Deprecate old versions after publishing the API:true" will deprecate older versions of a particular API when it is promoted to Published state from Created state. Multiple checklist items can be given in "attribute1:true, attribute2:false" format. - **Sample CURL :** curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -X POST "https://localhost:9443/api/am/publisher/v2/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish&lifecycleChecklist=Deprecate%20old%20versions%20after%20publishing%20the%20API%3Atrue,Requires%20re-subscription%20when%20publishing%20the%20API%3Afalse" - schema: - type: string - - $ref: '#/components/parameters/apiId-Q' - - $ref: '#/components/parameters/If-Match' + $ref: '#/definitions/Wsdl' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Wsdl (Individual) responses: 200: description: | OK. - Lifecycle changed successfully. + Successful response with updated wsdl definition headers: + Location: + description: | + The URL of the newly created resource. + type: string + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | - Entity Tag of the changed API. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | - Date and time the API lifecycle has been modified the last time. + Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowResponse' - 202: - description: | - Accepted. - The request has been accepted. - content: - application/json: - schema: - $ref: '#/components/schemas/WorkflowResponse' + type: string 400: - $ref: '#/components/responses/BadRequest' + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' + 403: + description: | + Forbidden. + The request must be conditional but no condition has been specified. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/change-lifecycle?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b&action=Publish"' - operationId: changeAPILifecycle - - /apis/{apiId}/lifecycle-history: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + + +###################################################### +# The "Individual Application" resource APIs +###################################################### + '/applications/{applicationId}': + +#----------------------------------------------------- +# Retrieve the details about a certain application +#----------------------------------------------------- get: - tags: - - API Lifecycle - summary: Get Lifecycle State Change History of the API. + x-scope: apim:api_create + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"groupId\": \"\",\n \"subscriber\": \"admin\",\n \"throttlingTier\": \"Unlimited\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"description\": null,\n \"name\": \"DefaultApplication\"\n}" + summary: Get details of an application description: | - This operation can be used to retrieve Lifecycle state change history of the API. + This operation can be used to retrieve details of an individual application specifying the application id in the URI. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/applicationId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Application (Individual) responses: 200: description: | OK. - Lifecycle state change history returned successfully. + Application returned. + schema: + $ref: '#/definitions/Application' headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/LifecycleHistory' + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-history"' - operationId: getAPILifecycleHistory - - /apis/{apiId}/lifecycle-state: + description: | + Not Found. + Requested application does not exist. + schema: + $ref: '#/definitions/Error' + 406: + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Subscription Collection" resource APIs +###################################################### + /subscriptions: + +#----------------------------------------------------- +# Retrieve all subscriptions of a certain API +#----------------------------------------------------- get: - tags: - - API Lifecycle - summary: Get Lifecycle State Data of the API. + x-scope: apim:subscription_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/subscriptions?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/subscriptions?apiId=890a4f4d-09eb-4877-a323-57f6ce2ed79b + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n \n{\n \"previous\": \"\",\n \"list\": [\n {\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n },\n {\n \"subscriptionId\": \"7ac22c34-8745-4cfe-91e0-262c50b2f2e3\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"367a2361-8db5-4140-8133-c6c8dc7fa0c4\",\n \"status\": \"UNBLOCKED\"\n }\n ],\n \"next\": \"\",\n \"count\": 2\n}" + summary: Get all Subscriptions description: | - This operation can be used to retrieve Lifecycle state data of the API. + This operation can be used to retrieve a list of subscriptions of the user associated with the provided access token. This operation is capable of + + 1. Retrieving all subscriptions for the user's APIs. + `GET https://localhost:9443/api/am/publisher/v0.12/subscriptions` + + 2. Retrieving subscriptions for a specific API. + `GET https://localhost:9443/api/am/publisher/v0.12/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed` parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' + - $ref: '#/parameters/apiId-Q' + - $ref: '#/parameters/limit' + - $ref: '#/parameters/offset' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + tags: + - Subscription (Collection) responses: 200: description: | OK. - Lifecycle state data returned successfully. + Subscription list returned. + schema: + $ref: '#/definitions/SubscriptionList' headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/LifecycleState' + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-state"' - operationId: getAPILifecycleState - - /apis/{apiId}/lifecycle-state/pending-tasks: - delete: - tags: - - API Lifecycle - summary: Delete Pending Lifecycle State Change Tasks + 406: + description: | + Not Acceptable. The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Individual Subscription" resource APIs +###################################################### + '/subscriptions/{subscriptionId}': + +#----------------------------------------------------- +# Retrieve a certain subscription +#----------------------------------------------------- + get: + x-scope: apim:subscription_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n}" + summary: Get details of a subscription description: | - This operation can be used to remove pending lifecycle state change requests that are in pending state + This operation can be used to get details of a single subscription. parameters: - - $ref: '#/components/parameters/apiId' + - $ref: '#/parameters/subscriptionId' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Subscription (Individual) responses: 200: description: | OK. - Lifecycle state change pending task removed successfully. - content: {} - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/lifecycle-state/pending-tasks"' - operationId: deleteAPILifecycleStatePendingTasks - - ###################################################### - # The "API Revisions" resource API - ###################################################### - /apis/{apiId}/revisions: - - #-------------------------------------------- - # List available revisions of an API - #-------------------------------------------- - get: - tags: - - API Revisions - summary: List available revisions of an API + Subscription returned + schema: + $ref: '#/definitions/ExtendedSubscription' + headers: + Content-Type: + description: The content type of the body. + type: string + ETag: + description: 'Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future).' + type: string + Last-Modified: + description: 'Date and time the resource has been modifed the last time. Used by caches, or in conditional requests (Will be supported in future).' + type: string + '304': + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + '404': + description: | + Not Found. + Requested Subscription does not exist. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Block Subscription" Processing Function resource API +###################################################### + /subscriptions/block-subscription: + +#----------------------------------------------------- +# Block a certain subscription +#----------------------------------------------------- + post: + x-scope: apim:subscription_block + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n \n{\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"PROD_ONLY_BLOCKED\"\n}" + summary: Block a subscription description: | - List available revisions of an API - operationId: getAPIRevisions + This operation can be used to block a subscription. Along with the request, `blockState` must be specified as a query parameter. + + 1. `BLOCKED` : Subscription is completely blocked for both Production and Sandbox environments. + 2. `PROD_ONLY_BLOCKED` : Subscription is blocked for Production environment only. parameters: - - $ref: '#/components/parameters/apiId' - - name: query + - $ref: '#/parameters/subscriptionId-Q' + - name: blockState in: query - schema: - type: string + description: | + Subscription block state. + type: string + required: true + enum: + - BLOCKED + - PROD_ONLY_BLOCKED + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Subscription (Individual) responses: 200: description: | OK. - List of API revisions are returned. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevisionList' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"' - - #-------------------------------------------- - # Create a new API revision - #-------------------------------------------- - post: - tags: - - API Revisions - summary: Create a new API revision - description: | - Create a new API revision - operationId: createAPIRevision - parameters: - - $ref: '#/components/parameters/apiId' - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevision' - responses: - 201: + Subscription was blocked successfully. + headers: + ETag: + description: | + Entity Tag of the blocked subscription. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the subscription has been blocked. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: description: | - Created. - Successful response with the newly created APIRevision object as the entity in the body. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevision' + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested subscription does not exist. + schema: + $ref: '#/definitions/Error' 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"' - - ###################################################### - # The "API Revisions" individual resource API - ###################################################### - /apis/{apiId}/revisions/{revisionId}: - - #-------------------------------------------- - # Get a revision - #-------------------------------------------- - get: - tags: - - API Revisions - summary: Retrieve a revision of an API - description: | - Retrieve a revision of an API - operationId: getAPIRevision - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/revisionId' - responses: - 200: description: | - OK. - An API revision is returned. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevision' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' - - #-------------------------------------------- - # Delete a revision - #-------------------------------------------- - delete: - tags: - - API Revisions - summary: Delete a revision of an API - description: | - Delete a revision of an API - operationId: deleteAPIRevision + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Unblock Subscription" Processing Function resource API +###################################################### + /subscriptions/unblock-subscription: + +#----------------------------------------------------- +# Unblock a certain subscription +#----------------------------------------------------- + post: + x-scope: apim:subscription_block + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X POST \"https://localhost:9443/api/am/publisher/v0.12/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809\"" + x-wso2-request: | + POST https://localhost:9443/api/am/publisher/v0.12/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809 + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8` + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"subscriptionId\": \"64eca60b-2e55-4c38-8603-e9e6bad7d809\",\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"admin-PhoneVerification-1.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n} " + summary: Unblock a Subscription parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/revisionId' + - $ref: '#/parameters/subscriptionId-Q' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + description: | + This operation can be used to unblock a subscription specifying the subscription Id. The subscription will be fully unblocked after performing this operation. + tags: + - Subscription (Individual) responses: 200: description: | OK. - List of remaining API revisions are returned. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevisionList' - 204: - description: | - No Content. - Successfully deleted the revision + Subscription was unblocked successfully. + headers: + ETag: + description: | + Entity Tag of the unblocked subscription. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: + description: | + Date and time the subscription has been unblocked. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /apis/{apiId}/deploy-revision: - - #-------------------------------------------- - # List available deployed revision deployment details of an API - #-------------------------------------------- + description: | + Not Found. + Requested subscription does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Tier Collection" resource APIs +###################################################### + '/tiers/{tierLevel}': + +#----------------------------------------------------- +# Retrieve the list of all available tiers +#----------------------------------------------------- get: - tags: - - API Revisions - summary: List available deployed revision deployment details of an API + x-scope: apim:tier_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/tiers/api" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/tiers/api + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 1,\n \"description\": \"Allows 1 request(s) per minute.\",\n \"name\": \"Bronze\",\n \"attributes\": {}\n },\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 20,\n \"description\": \"Allows 20 request(s) per minute.\",\n \"name\": \"Gold\",\n \"attributes\": {}\n },\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 5,\n \"description\": \"Allows 5 request(s) per minute.\",\n \"name\": \"Silver\",\n \"attributes\": {}\n },\n {\n \"unitTime\": 0,\n \"tierPlan\": null,\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 0,\n \"description\": \"Allows unlimited requests\",\n \"name\": \"Unlimited\",\n \"attributes\": {}\n }\n ],\n \"next\": \"\",\n \"count\": 4\n}" + summary: Get all tiers description: | - List available deployed revision deployment details of an API - operationId: getAPIRevisionDeployments + This operation can be used to list the available tiers for a given tier level. Tier level should be specified as a path parameter and should be one of `api`, `application` and `resource`. parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - List of deployed revision deployment details are returned. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevisionDeploymentList' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"' - - #-------------------------------------------- - # Deploy a revision - #-------------------------------------------- - post: + - $ref: '#/parameters/limit' + - $ref: '#/parameters/offset' + - $ref: '#/parameters/tierLevel' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' tags: - - API Revisions - summary: Deploy a revision - description: | - Deploy a revision - operationId: deployAPIRevision - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/revisionId-Q' - requestBody: - description: Deployment object that needs to be added - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' + - Throttling Tier (Collection) responses: 200: description: | OK. - 201: - description: | - Created. - Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /apis/{apiId}/undeploy-revision: - #-------------------------------------------- - # Un-Deploy a revision from deployed gateway - #-------------------------------------------- - post: - tags: - - API Revisions - summary: Un-Deploy a revision - description: | - Un-Deploy a revision - operationId: undeployAPIRevision - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/revisionId-Q' - - $ref: '#/components/parameters/revisionNum-Q' - - name: allEnvironments - in: query + List of tiers returned. schema: - type: boolean - default: false - requestBody: - description: Deployment object that needs to be added - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - responses: - 200: + $ref: '#/definitions/TierList' + headers: + Content-Type: + description: The content type of the body. + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 304: description: | - OK. - 201: + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). + 406: description: | - Created. - Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /apis/{apiId}/restore-revision: - - #-------------------------------------------------------- - # Restore a revision to the working copy of the API - #-------------------------------------------------------- + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Create a new tier +#----------------------------------------------------- post: - tags: - - API Revisions - summary: Restore a revision + x-scope: apim:tier_manage + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/tiers/api\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/tiers/api\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 5,\n \"description\": \"Allows 5 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"a\":10,\n \"b\":30\n }\n}" + x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/publisher/v0.12/tiers/Low\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 5,\n \"description\": \"Allows 5 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"b\": \"30\",\n \"a\": \"10\"\n }\n}" + summary: Create a Tier description: | - Restore a revision to the working copy of the API - operationId: restoreAPIRevision + This operation can be used to create a new throttling tier. The only supported tier level is `api` tiers. + `POST https://localhost:9443/api/am/publisher/v0.12/tiers/api` + + **IMPORTANT:** + * This is only effective when Advanced Throttling is disabled in the Server. If enabled, we need to use Admin REST API for throttling tiers modification related operations. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/revisionId-Q' - responses: - 201: + - in: body + name: body description: | - Restored. - Successful response with the newly restored API object as the entity in the body. - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v1/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /apis/import-service: - post: - tags: - - APIs - summary: Import a Service from Service Catalog - description: This operation can be used to create an API from a Service from Service Catalog - operationId: importServiceFromCatalog - parameters: - - name: serviceKey - in: query + Tier object that should to be added required: true schema: - type: string - description: ID of service that should be imported from Service Catalog - requestBody: - content: - application/json: - schema: - '$ref': '#/components/schemas/API' + $ref: '#/definitions/Tier' + - $ref: '#/parameters/tierLevel-A' + - $ref: '#/parameters/Content-Type' + tags: + - Throttling Tier (Collection) responses: 201: description: | Created. Successful response with the newly created object as entity in the body. - Location header contains the URL of the newly created entity. + Location header contains URL of newly created entity. + schema: + $ref: '#/definitions/Tier' headers: Location: description: | - The URL of the newly created resource. - schema: - type: string + Location of the newly created tier. + type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - - /apis/{apiId}/comments: - get: - tags: - - Comments - summary: Retrieve API Comments - description: | - Get a list of Comments that are already added to APIs - operationId: getAllCommentsOfAPI - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/requestedTenant' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/includeCommenterInfo' - responses: - 200: - description: | - OK. - Comments list is returned. - content: - application/json: - schema: - $ref: '#/components/schemas/CommentList' - 401: - $ref: '#/components/responses/Unauthorized' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: [] - x-code-samples: - - lang: Curl - source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments" - - post: - tags: - - Comments - summary: Add an API Comment - operationId: addCommentToAPI - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/parentCommentID' - requestBody: - description: | - Comment object that should to be added - content: - application/json: - schema: - title: Post request body - type: object - properties: - content: - type: string - description: | - Content of the comment - example: This is a comment - category: - type: string - description: | - Category of the comment - example: general - required: - - content - required: true - responses: - 201: - description: | - Created. - Successful response with the newly created object as entity in the body. - Location header contains URL of newly created entity. - headers: + type: string ETag: description: | - Entity Tag of the response resource. Used by caches, or in conditional request. - schema: - type: string - Location: - description: | - Location to the newly created Comment. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Comment' + Entity Tag of the response resource. + Used by caches, or in conditional request' + type: string 400: - $ref: '#/components/responses/BadRequest' - 401: - $ref: '#/components/responses/Unauthorized' + description: | + Bad Request. + Invalid request or validation error + schema: + $ref: '#/definitions/Error' 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments"' - - /apis/{apiId}/comments/{commentId}: + description: | + Unsupported media type. + The entity of the request was in a not supported format. + +###################################################### +# The "Individual Tier" resource APIs +###################################################### + '/tiers/{tierLevel}/{tierName}': + +#----------------------------------------------------- +# Retrieve a certain tier +#----------------------------------------------------- get: - tags: - - Comments - summary: Get Details of an API Comment + x-scope: apim:tier_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/tiers/api/Bronze" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/tiers/api/Bronze + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 1,\n \"description\": \"Allows 1 request(s) per minute.\",\n \"name\": \"Bronze\",\n \"attributes\": {}\n}" + summary: Get details of a tier description: | - Get the individual comment given by a username for a certain API. - operationId: getCommentOfAPI + This operation can be used to retrieve details of a single tier by specifying the tier level and tier name. + Note that the scope of the API is mandatory while retreiving the access token with the following cURL command : `curl -k -d \"grant_type=password&username=username&password=password&scope=apim:tier_view\" -H \"Authorization: Basic \" https://localhost:8243/token`. + You will receive the access token as the response, for example `"access_token":"8644c013-7ff1-3217-b150-d7b92cae6be7"`. parameters: - - $ref: '#/components/parameters/commentId' - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/requestedTenant' - - $ref: '#/components/parameters/If-None-Match' - - $ref: '#/components/parameters/includeCommenterInfo' - - $ref: '#/components/parameters/replyLimit' - - $ref: '#/components/parameters/replyOffset' + - $ref: '#/parameters/tierName' + - $ref: '#/parameters/tierLevel' + - $ref: '#/parameters/Accept' + - $ref: '#/parameters/If-None-Match' + - $ref: '#/parameters/If-Modified-Since' + tags: + - Throttling Tier (Individual) responses: 200: description: | OK. - Comment returned. + Tier returned + schema: + $ref: '#/definitions/Tier' headers: + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. - Used by caches, or in conditional requests. - schema: - type: string + Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Comment' + Used by caches, or in conditional requests (Will be supported in future). + type: string 304: description: | Not Modified. - Empty body because the client has already the latest version of the requested resource. - content: {} - 401: - $ref: '#/components/responses/Unauthorized' + Empty body because the client has already the latest version of the requested resource (Will be supported in future). 404: - $ref: '#/components/responses/NotFound' + description: | + Not Found. + Requested Tier does not exist. + schema: + $ref: '#/definitions/Error' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: [] - x-code-samples: - - lang: Curl - source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4" - - patch: - tags: - - Comments - summary: Edit a comment + description: | + Not Acceptable. + The requested media type is not supported. + schema: + $ref: '#/definitions/Error' + +#----------------------------------------------------- +# Update a certain tier +#----------------------------------------------------- + put: + x-scope: apim:tier_manage + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X PUT -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low\"" + x-wso2-request: "PUT https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 10,\n \"description\": \"Allows 10 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"a\": \"30\",\n \"b\": \"10\",\n \"c\": \"20\"\n }\n}\n" + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"tierLevel\": \"api\",\n \"stopOnQuotaReach\": true,\n \"requestCount\": 10,\n \"description\": \"Allows 10 request(s) per minute.\",\n \"name\": \"Low\",\n \"attributes\": {\n \"b\": \"10\",\n \"c\": \"20\",\n \"a\": \"30\"\n }\n}" + summary: Update a Tier description: | - Edit the individual comment - operationId: editCommentOfAPI + This operation can be used to update an existing tier. The only supported tier level is `api` tiers. + `PUT https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low` + + **IMPORTANT:** + * This is only effective when Advanced Throttling is disabled in the Server. If enabled, we need to use Admin REST API for throttling tiers modification related operations. parameters: - - $ref: '#/components/parameters/commentId' - - $ref: '#/components/parameters/apiId' - requestBody: - description: | - Comment object that should to be updated - content: - application/json: - schema: - title: Patch request body - type: object - properties: - content: - type: string - description: | - Content of the comment - example: This is a comment - category: - type: string - description: | - Category of the comment - example: general - required: true + - $ref: '#/parameters/tierName' + - in: body + name: body + description: | + Tier object that needs to be modified + required: true + schema: + $ref: '#/definitions/Tier' + - $ref: '#/parameters/tierLevel-A' + - $ref: '#/parameters/Content-Type' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Throttling Tier (Individual) responses: 200: description: | OK. - Comment updated. + Subscription updated. + schema: + $ref: '#/definitions/Tier' headers: + Location: + description: | + The URL of the newly created resource. + type: string + Content-Type: + description: | + The content type of the body. + type: string ETag: description: | - Entity Tag of the response resource. Used by caches, or in conditional request. - schema: - type: string - Location: #??? + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + Last-Modified: description: | - Location to the newly created Comment. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Comment' + Date and time the resource has been modifed the last time. + Used by caches, or in conditional requests (Will be supported in future). + type: string 400: - $ref: '#/components/responses/BadRequest' - 401: - $ref: '#/components/responses/Unauthorized' + description: | + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4"' + description: | + Not Found. + The resource to be updated does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' +#----------------------------------------------------- +# Delete a certain tier +#----------------------------------------------------- delete: - tags: - - Comments - summary: Delete an API Comment + x-scope: apim:tier_manage + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE \"https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low\"" + x-wso2-request: | + DELETE https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK" + summary: Delete a Tier description: | - Remove a Comment - operationId: deleteComment + This operation can be used to delete an existing tier. The only supported tier level is `api` tiers. + `DELETE https://localhost:9443/api/am/publisher/v0.12/tiers/api/Low` + + **IMPORTANT:** + * This is only effective when Advanced Throttling is disabled in the Server. If enabled, we need to use Admin REST API for throttling tiers modification related operations. parameters: - - $ref: '#/components/parameters/commentId' - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' + - $ref: '#/parameters/tierName' + - $ref: '#/parameters/tierLevel-A' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + tags: + - Throttling Tier (Individual) responses: 200: description: | OK. Resource successfully deleted. - content: {} - 401: - $ref: '#/components/responses/Unauthorized' 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: curl -k -X DELETE -H "Authorization:Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4" - - /apis/{apiId}/comments/{commentId}/replies: - get: - tags: - - Comments - summary: Get replies of a comment + description: | + Not Found. + Resource to be deleted does not exist. + schema: + $ref: '#/definitions/Error' + 412: + description: | + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' + +###################################################### +# The "Update Permission" Processing Function resource API +###################################################### + '/tiers/update-permission': + +#----------------------------------------------------- +# Update the permission of a certain tier +#----------------------------------------------------- + post: + x-scope: apim:tier_manage + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/tiers/update-permission?tierName=Bronze&tierLevel=api\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/tiers/update-permission?tierName=Bronze&tierLevel=api\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"permissionType\":\"deny\",\n \"roles\": [\"Internal/everyone\",\"admin\"]\n}" + x-wso2-response: "HTTP/1.1 200 OK" + summary: Update tier permission description: | - Get replies of a comment - operationId: getRepliesOfComment + This operation can be used to update tier permissions which controls access for the particular tier based on the subscribers' roles. parameters: - - $ref: '#/components/parameters/commentId' - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/requestedTenant' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/If-None-Match' - - $ref: '#/components/parameters/includeCommenterInfo' + - $ref: '#/parameters/tierName-Q' + - $ref: '#/parameters/tierLevel-Q' + - $ref: '#/parameters/If-Match' + - $ref: '#/parameters/If-Unmodified-Since' + - in: body + name: permissions + schema: + $ref: '#/definitions/TierPermission' + tags: + - Throttling Tier (Individual) responses: 200: description: | OK. - Comment returned. + Successfully updated tier permissions + schema: + type: array + items: + $ref: '#/definitions/Tier' headers: ETag: description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests. - schema: - type: string + Entity Tag of the modified tier. + Used by caches, or in conditional requests (Will be supported in future). + type: string Last-Modified: description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CommentList' - 304: + Date and time the tier has been modified. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 400: description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource. - content: {} - 401: - $ref: '#/components/responses/Unauthorized' - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: [] - x-code-samples: - - lang: Curl - source: curl -k "https://localhost:9443/api/am/publisher/v1/apis/e93fb282-b456-48fc-8981-003fb89086ae/comments/d4cf1704-5d09-491c-bc48-4d19ce6ea9b4" - - /apis/import-openapi: - post: - tags: - - APIs - summary: Import an OpenAPI Definition - description: | - This operation can be used to create an API from an OpenAPI definition. Provide either `url` or `file` - to specify the definition. - - Specify additionalProperties with **at least** API's name, version, context and endpointConfig. - operationId: importOpenAPIDefinition - requestBody: - content: - multipart/form-data: - schema: - properties: - file: - type: string - description: Definition to upload as a file - format: binary - url: - type: string - description: Definition url - additionalProperties: - type: string - description: Additional attributes specified as a stringified JSON with API's schema - responses: - 201: - description: | - Created. - Successful response with the newly created object as entity in the body. - Location header contains URL of newly created entity. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 400: - $ref: '#/components/responses/BadRequest' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@openapi.json -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-openapi"' - x-examples: - $ref: docs/examples/apis/import_openapi_post.yaml - - /apis/import-wsdl: - post: - tags: - - APIs - summary: Import a WSDL Definition - description: | - This operation can be used to create an API using a WSDL definition. Provide either `url` or `file` - to specify the definition. - - WSDL can be speficied as a single file or a ZIP archive with WSDLs and reference XSDs etc. - Specify additionalProperties with **at least** API's name, version, context and endpointConfig. - operationId: importWSDLDefinition - requestBody: - content: - multipart/form-data: - schema: - properties: - file: - type: string - description: | - WSDL definition as a file or archive - - **Sample cURL to Upload WSDL File** - - curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -F file=@api.wsdl -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-wsdl" - - **Sample cURL to Upload WSDL Archive** - - curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" -F file="@wsdl.zip;type=application/zip" -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-wsdl" - format: binary - url: - type: string - description: WSDL Definition url - additionalProperties: - type: string - description: Additional attributes specified as a stringified JSON - with API's schema - implementationType: - type: string - description: | - If 'SOAP' is specified, the API will be created with only one resource 'POST /*' which is to be used for SOAP - operations. - - If 'HTTP_BINDING' is specified, the API will be created with resources using HTTP binding operations - which are extracted from the WSDL. - default: SOAP - enum: - - SOAPTOREST - - SOAP - responses: - 201: - description: | - Created. - Successful response with the newly created object as entity in the body. - Location header contains URL of newly created entity. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 400: - $ref: '#/components/responses/BadRequest' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@api.wsdl -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-wsdl"' - x-examples: - $ref: docs/examples/apis/wsdl/import_wsdl_post.yaml - - /apis/import-graphql-schema: - post: - tags: - - APIs - summary: Import API Definition - description: | - This operation can be used to create api from api definition.APIMgtDAOTest - - API definition is GraphQL Schema - parameters: - - name: If-Match - in: header - description: | - Validator for conditional requests; based on ETag. + Bad Request. + Invalid request or validation error. schema: - type: string - requestBody: - content: - multipart/form-data: - schema: - properties: - type: - type: string - description: Definition type to upload - file: - type: string - description: Definition to uploads a file - format: binary - additionalProperties: - type: string - description: Additional attributes specified as a stringified JSON - with API's schema - responses: - 201: - description: | - Created. - Successful response with the newly created object as entity in the body. - Location header contains URL of newly created entity. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 400: - $ref: '#/components/responses/BadRequest' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@schema.graphql -F additionalProperties=@data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/import-graphql-schema"' - operationId: importGraphQLSchema - - /apis/validate-openapi: - post: - tags: - - Validation - summary: Validate an OpenAPI Definition - description: | - This operation can be used to validate an OpenAPI definition and retrieve a summary. Provide either `url` - or `file` to specify the definition. - operationId: validateOpenAPIDefinition - parameters: - - name: returnContent - in: query + $ref: '#/definitions/Error' + 403: description: | - Specify whether to return the full content of the OpenAPI definition in the response. This is only - applicable when using url based validation + Forbidden. + The request must be conditional but no condition has been specified. schema: - type: boolean - default: false - requestBody: - content: - multipart/form-data: - schema: - properties: - url: - type: string - description: OpenAPI definition url - file: - type: string - description: OpenAPI definition as a file - format: binary - responses: - 200: - description: | - OK. - API definition validation information is returned - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/OpenAPIDefinitionValidationResponse' - 400: - $ref: '#/components/responses/BadRequest' + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@openapi.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-openapi"' - x-examples: - $ref: docs/examples/apis/validate_openapi_post.yaml - - /apis/validate-endpoint: - post: - tags: - - Validation - summary: Check Whether Given Endpoint URL is Valid - description: | - Using this operation, it is possible check whether the given API endpoint url is a valid url - operationId: validateEndpoint - parameters: - - name: endpointUrl - in: query - description: API endpoint url - required: true - schema: - type: string - - name: apiId - in: query - schema: - type: string - responses: - 200: description: | - OK. - API definition validation information is returned - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ApiEndpointValidationResponse' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-endpoint?apiId=e0824883-3e86-403a-aec1-22bbc454eb7c&endpointUrl=https%3A%2F%2Flocalhost%3A9443%2Fam%2Fsample%2Fpizzashack%2Fv1%2Fapi%2F"' - - /apis/validate: - post: - tags: - - Validation - summary: Check Given API Context Name already Exists - description: | - Using this operation, you can check a given API context is already used. You need to provide the context name you want to check. - operationId: validateAPI - parameters: - - name: query - in: query + Not Found. + Requested tier does not exist. + schema: + $ref: '#/definitions/Error' + 412: description: | - **Search condition**. - - You can search in attributes by using an **":"** modifier. + Precondition Failed. + The request has not been performed because one of the preconditions is not met. + schema: + $ref: '#/definitions/Error' - Eg. - "name:wso2" will match an API if the provider of the API is exactly "wso2". - Supported attribute modifiers are [** version, context, name **] +###################################################### +# The "Environment Collection" resource API +###################################################### + /environments: - If no advanced attribute modifier has been specified, search will match the - given query string against API Name. - required: true - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - API definition validation information is returned - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate?query=name%3Awso2"' - x-examples: - $ref: docs/examples/apis/apis_validate.yaml - - /apis/validate-wsdl: - post: - tags: - - Validation - summary: Validate a WSDL Definition +#----------------------------------------------------- +# Retrieve the list of environments configured for a certain API +#----------------------------------------------------- + get: + x-scope: apim:api_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/publisher/v0.12/environments\"" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/environments + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"list\": [ {\n \"showInApiConsole\": true,\n \"serverUrl\": \"https://localhost:9443/services/\",\n \"endpoints\": {\n \"http\": \"http://localhost:8280\",\n \"https\": \"https://localhost:8243\"\n },\n \"name\": \"Production and Sandbox\",\n \"type\": \"hybrid\"\n }],\n \"count\": 1\n}" + summary: Get all gateway environments description: | - This operation can be used to validate a WSDL definition and retrieve a summary. Provide either `url` - or `file` to specify the definition. - operationId: validateWSDLDefinition - requestBody: - content: - multipart/form-data: - schema: - properties: - url: - type: string - description: Definition url - file: - type: string - description: Definition to upload as a file - format: binary - responses: - 200: - description: | - OK. - API definition validation information is returned - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/WSDLValidationResponse' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@api.wsdl "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-wsdl"' - x-examples: - $ref: docs/examples/apis/wsdl/validate_wsdl_post.yaml - - /apis/validate-graphql-schema: - post: + This operation can be used to retrieve the list of gateway environments available. + parameters: + - $ref: '#/parameters/apiId-Q' tags: - - Validation - summary: Validate GraphQL API Definition and Retrieve a Summary - description: | - This operation can be used to validate a graphQL definition and retrieve a summary. - requestBody: - content: - multipart/form-data: - schema: - required: - - file - properties: - file: - type: string - description: Definition to upload as a file - format: binary - required: true + - Environment (Collection) responses: 200: description: | OK. - API definition validation information is returned + Environment list is returned. + schema: + $ref: '#/definitions/EnvironmentList' headers: Content-Type: description: | The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/GraphQLValidationResponse' - 400: - $ref: '#/components/responses/BadRequest' + type: string + ETag: + description: | + Entity Tag of the response resource. + Used by caches, or in conditional requests (Will be supported in future). + type: string + 304: + description: | + Not Modified. + Empty body because the client has already the latest version of the requested resource (Will be supported in future). 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@schema.graphql "https://127.0.0.1:9443/api/am/publisher/v2/apis/validate-graphql-schema"' - operationId: validateGraphQLSchema - - /apis/{apiId}/graphql-schema: + description: | + Not Found. + Requested API does not exist. + schema: + $ref: '#/definitions/Error' + /policies/mediation: + +#----------------------------------------------------------------------------------------- +# Retrieving the list of all global mediation sequences under a given search condition +#----------------------------------------------------------------------------------------- get: - tags: - - GraphQL Schema (Individual) - summary: Get the Schema of a GraphQL API + x-scope: apim:mediation_policy_view + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" https://localhost:9443/api/am/publisher/v0.12/policies/mediation" + x-wso2-request: | + GET https://localhost:9443/api/am/publisher/v0.12/policies/mediation + Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 + x-wso2-response: "HTTP/1.1 200 OK\r\nContent-Type: application/json\r\n\r\n{\r\n \"count\": 10,\r\n \"next\": null,\r\n \"previous\": null,\r\n \"list\": [\r\n {\r\n \"name\": \"debug_json_fault\",\r\n \"id\": \"563de8f3-dd1d-4ec7-afc2-d158c663ed34\",\r\n \"type\": \"fault\"\r\n },\r\n {\r\n \"name\": \"json_fault\",\r\n \"id\": \"f9c36f4d-a2b6-41e7-b311-d358a47916be\",\r\n \"type\": \"fault\"\r\n },\r\n {\r\n \"name\": \"json_to_xml_in_message\",\r\n \"id\": \"3921225b-7918-4b95-a851-22c4e4e3e911\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"debug_in_flow\",\r\n \"id\": \"2bc15f93-4455-4763-89b8-83600fb9d731\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"log_in_message\",\r\n \"id\": \"4d287cca-76ab-44ca-b22e-919fc27c50e3\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"preserve_accept_header\",\r\n \"id\": \"3776b215-b3bc-40b6-bdcb-06efa7de64be\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"xml_to_json_in_message\",\r\n \"id\": \"50ac2002-769e-4f90-8549-6d0248dff7d2\",\r\n \"type\": \"in\"\r\n },\r\n {\r\n \"name\": \"xml_to_json_out_message\",\r\n \"id\": \"2af75853-ed75-4d25-81aa-0ebbeca691ea\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"json_to_xml_out_message\",\r\n \"id\": \"d9fa3ffc-f6b6-4171-ab97-eb44196cb66e\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"debug_out_flow\",\r\n \"id\": \"260b7701-4071-46bd-9b66-900ac6fffed6\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"apply_accept_header\",\r\n \"id\": \"15c17c2f-33e3-4c37-a262-04dfa49983a4\",\r\n \"type\": \"out\"\r\n },\r\n {\r\n \"name\": \"log_out_message\",\r\n \"id\": \"d37dca41-c048-492a-82cf-9a2292c6fff0\",\r\n \"type\": \"out\"\r\n }\r\n ]\r\n}" + summary: | + Get all global level mediation policies description: | - This operation can be used to retrieve the Schema definition of a GraphQL API. + This operation provides you a list of available all global level mediation policies. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' + - $ref : '#/parameters/limit' + - $ref : '#/parameters/offset' + - name : query + in: query + description: "-Not supported yet-" + type: string + - $ref : "#/parameters/Accept" + - $ref : "#/parameters/If-None-Match" + tags: + - Mediation Policy (Collection) responses: 200: description: | OK. - Requested GraphQL Schema DTO object belongs to the API + List of mediation policies is returned. + schema: + $ref: '#/definitions/mediationList' headers: + Content-Type: + description: The content type of the body. + type: string ETag: description: | Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/GraphQLSchema' + type: string 304: description: | Not Modified. Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/e0824883-3e86-403a-aec1-22bbc454eb7c/graphql-schema"' - operationId: getAPIGraphQLSchema + description: | + Not Acceptable. + The requested media type is not supported + schema: + $ref: '#/definitions/Error' - put: - tags: - - GraphQL Schema - summary: Add a Schema to a GraphQL API + + +###################################################### +# The "Workflow approval" resource API +###################################################### + /workflows/update-workflow-status: + +#------------------------------------------------------------------- +# Resume the workflow by approving or rejecting the workflow request +#------------------------------------------------------------------- + post: + x-scope: apim:api_workflow + x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -H \"Content-Type: application/json\" -X POST -d @data.json \"https://localhost:9443/api/am/publisher/v0.12/workflows/update-workflow-status?workflowReferenceId=56e3a170-a7a7-45f8-b051-7e43a58a67e1\"" + x-wso2-request: "POST https://localhost:9443/api/am/publisher/v0.12/workflows/update-workflow-status?workflowReferenceId=56e3a170-a7a7-45f8-b051-7e43a58a67e1\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\nContent-Type: application/json\n\n{\n \"status\" : \"APPROVED\",\n \"attributes\" : {\n \"apiCurrentState\": \"Created\",\n \"apiLCAction\": \"Publish\",\n \"apiName\":\"APIname\",\n \"apiVersion\" : \"1.0.0\",\n \"apiProvider\" : \"admin\",\n \"invoker\": \"admin\"\n }\n}" + x-wso2-response: "HTTP/1.1 200 OK" + summary: Update workflow status description: | - This operation can be used to add a GraphQL Schema definition to an existing GraphQL API. + This operation can be used to approve or reject a workflow task. parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - required: - - schemaDefinition - properties: - schemaDefinition: - type: string - description: schema definition of the GraphQL API - required: true + - $ref: '#/parameters/workflowReferenceId-Q' + - in: body + name: body + description: | + Workflow event that need to be updated + required: true + schema: + $ref: '#/definitions/Workflow' + tags: + - Workflows (Individual) responses: 200: description: | OK. - Successful response with updated schema definition + Workflow request information is returned. + schema: + $ref: '#/definitions/Workflow' headers: - ETag: - description: | - Entity Tag of the response resource. Used by cache, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string Content-Type: description: | The content type of the body. - schema: - type: string - content: {} + type: string 400: - $ref: '#/components/responses/BadRequest' - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F schemaDefinition=@schema.graphql "https://127.0.0.1:9443/api/am/publisher/v2/apis/e0824883-3e86-403a-aec1-22bbc454eb7c/graphql-schema"' - operationId: updateAPIGraphQLSchema - - /apis/{apiId}/amznResourceNames: - get: - tags: - - AWS Lambda (Individual) - summary: Retrieve the ARNs of AWS Lambda Functions - description: | - This operation can be use to retrieve ARNs of AWS Lambda function for a given AWS credentials. - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: description: | - OK. - Requested ARN List of the API is returned - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: |- - { - "count": "2", - "list": [ - "arn:aws:lambda:us-west-2:123456789012:function:my-function1", - "arn:aws:lambda:us-west-2:123456789012:function:my-function2" - ] - } + Bad Request. + Invalid request or validation error. + schema: + $ref: '#/definitions/Error' 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/e0824883-3e86-403a-aec1-22bbc454eb7c/amznResourceNames"' - x-examples: - $ref: docs/examples/apis/apis_id_amznresourcenames_get.yaml - operationId: getAmazonResourceNamesOfAPI - - /apis/{apiId}/monetize: - post: - tags: - - API Monetization - summary: Configure Monetization for a Given API - description: | - This operation can be used to configure monetization for a given API. - parameters: - - $ref: '#/components/parameters/apiId' - requestBody: - description: Monetization data object - content: - application/json: - schema: - $ref: '#/components/schemas/APIMonetizationInfo' - required: true - responses: - 201: - description: | - OK. - Monetization status changed successfully. - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/monetize' - operationId: addAPIMonetization - - /apis/{apiId}/monetization: - get: - tags: - - API Monetization - summary: Get Monetization Status for each Tier in a Given API - description: | - This operation can be used to get monetization status for each tier in a given API - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Monetization status for each tier returned successfully. - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/monetize"' - operationId: getAPIMonetization - - /apis/{apiId}/revenue: - get: - tags: - - API Monetization - summary: Get Total Revenue Details of a Given Monetized API with Meterd Billing - description: | - This operation can be used to get details of total revenue details of a given monetized API with meterd billing. - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Details of a total revenue returned. - headers: - ETag: - description: Entity Tag of the response resource. Used by caches, or - in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: Date and time the resource has been modified the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevenue' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/revenue"' - operationId: getAPIRevenue - - /apis/{apiId}/documents: - get: - tags: - - API Documents - summary: Get a List of Documents of an API - description: | - This operation can be used to retrieve a list of documents belonging to an API by providing the id of the API. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Document list is returned. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/DocumentList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/e0824883-3e86-403a-aec1-22bbc454eb7c/documents"' - operationId: getAPIDocuments - - post: - tags: - - API Documents - summary: Add a New Document to an API - description: | - This operation can be used to add a new documentation to an API. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API document ** API once we obtain a document Id by this operation. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: Document object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - required: true - responses: - 201: - description: | - Created. - Successful response with the newly created Document object as entity in the body. - Location header contains URL of newly added document. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - Location to the newly created Document. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - 400: - $ref: '#/components/responses/BadRequest' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_create - - apim:document_create - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents"' - operationId: addAPIDocument - - /apis/{apiId}/documents/{documentId}: - get: - tags: - - API Documents - summary: Get a Document of an API - description: | - This operation can be used to retrieve a particular document's metadata associated with an API. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Document returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"' - operationId: getAPIDocumentByDocumentId - - put: - tags: - - API Documents - summary: Update a Document of an API - description: | - This operation can be used to update metadata of an API's document. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: Document object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - required: true - responses: - 200: - description: | - OK. - Document updated - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the updated document. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:document_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @doc.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"' - operationId: updateAPIDocument - - delete: - tags: - - API Documents - summary: Delete a Document of an API - description: | - This operation can be used to delete a document associated with an API. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Resource successfully deleted. - content: {} - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:document_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5"' - operationId: deleteAPIDocument - - /apis/{apiId}/documents/{documentId}/content: - get: - tags: - - API Documents - summary: Get the Content of an API Document - description: | - This operation can be used to retrive the content of an API's document. - - The document can be of 3 types. In each cases responses are different. - - 1. **Inline type**: - The content of the document will be retrieved in `text/plain` content type - - _Sample cURL_ : `curl -k -H "Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51" -F inlineContent=@"docs.txt" -X POST "https://localhost:9443/api/am/publisher/v2/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` - 2. **FILE type**: - The file will be downloaded with the related content type (eg. `application/pdf`) - 3. **URL type**: - The client will recieve the URL of the document as the Location header with the response with - `303 See Other` - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - File or inline content returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/octet-stream: - schema: - type: string - 303: - description: | - See Other. - Source can be retrived from the URL specified at the Location header. - headers: - Location: - description: | - The Source URL of the document. - schema: - type: string - content: {} - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5/content"' - operationId: getAPIDocumentContentByDocumentId - - post: - tags: - - API Documents - summary: Upload the Content of an API Document - description: | - Thid operation can be used to upload a file or add inline content to an API document. - - **IMPORTANT:** - * Either **file** or **inlineContent** form data parameters should be specified at one time. - * Document's source type should be **FILE** in order to upload a file to the document using **file** parameter. - * Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - file: - type: string - description: Document to upload - format: binary - inlineContent: - type: string - description: Inline content of the document - responses: - 200: - description: | - OK. - Document updated - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the updated content of the document. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:document_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@sample.pdf "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5/content"' - operationId: addAPIDocumentContent - - /apis/{apiId}/documents/validate: - post: - tags: - - API Documents - summary: Check Whether a Document with the Provided Name Exist - description: | - This operation can be used to verify the document name exists or not. - operationId: validateDocument - parameters: - - $ref: '#/components/parameters/apiId' - - name: name - in: query - description: | - The name of the document which needs to be checked for the existance. - required: true - schema: - type: string - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Successful response if the document name exists. - 400: - $ref: '#/components/responses/BadRequest' - 404: - description: | - Not Found. - The specified resource does not exist. - security: - - OAuth2Security: - - apim:api_create - - apim:document_create - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/documents/validate?name=CalculatorDoc"' - x-examples: - $ref: docs/examples/apis/apis_id_document_validate.yaml - - /apis/{apiId}/mediation-policies: - get: - tags: - - API Mediation Policies - summary: | - Get All Mediation Policies of an API - description: | - This operation provides you a list of available mediation policies of an API. - operationId: getAllAPIMediationPolicies - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: query - in: query - description: -Not supported yet- - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of qualifying APIs is returned. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/MediationList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:mediation_policy_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_get.yaml - - post: - tags: - - API Mediation Policies - summary: Add an API Specific Mediation Policy - description: | - This operation can be used to add an API specifc mediation policy. - operationId: addAPIMediationPolicy - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - required: - - type - properties: - mediationPolicyFile: - type: string - description: Mediation Policy to upload - format: binary - inlineContent: - type: string - description: Inline content of the Mediation Policy - type: - type: string - description: Type of the mediation sequence - required: true - responses: - 201: - description: | - OK. - mediation policy uploaded - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the uploaded mediation policy of the API. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Mediation' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:mediation_policy_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F mediationPolicyFile=@TokenExchange.xml - -F type=in "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_post.yaml - - /apis/{apiId}/mediation-policies/{mediationPolicyId}: - get: - tags: - - API Mediation Policy - summary: Get an API Specific Mediation Policy - description: | - This operation can be used to retrieve a particular API specific mediation policy. - operationId: getAPIMediationPolicyByPolicyId - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Mediation policy returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Mediation' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:mediation_policy_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_get.yaml - - delete: - tags: - - API Mediation Policy - summary: Delete an API Specific Mediation Policy - description: | - This operation can be used to delete an existing API specific mediation policy providing the Id of the API and the Id of the mediation policy. - operationId: deleteAPIMediationPolicyByPolicyId - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Resource successfully deleted. - content: {} - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:mediation_policy_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_delete.yaml - - /apis/{apiId}/mediation-policies/{mediationPolicyId}/content: - get: - tags: - - API Mediation Policy - summary: Download an API Specific Mediation Policy - description: | - This operation can be used to download a particular API specific mediation policy. - operationId: getAPIMediationPolicyContentByPolicyId - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Mediation policy returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_view - - apim:mediation_policy_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a/content"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_content_get.yaml - - put: - tags: - - API Mediation Policy - summary: Update an API Specific Mediation Policy - description: | - This operation can be used to update an existing mediation policy of an API. - operationId: updateAPIMediationPolicyContentByPolicyId - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - required: - - type - properties: - file: - type: string - description: Mediation Policy to upload - format: binary - inlineContent: - type: string - description: Inline content of the Mediation Policy - type: - type: string - description: Type of the mediation sequence(in/out/fault) - required: true - responses: - 200: - description: | - OK. - Successful response with updated API object - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Mediation' - 400: - $ref: '#/components/responses/BadRequest' - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - - apim:mediation_policy_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@TokenExchange.xml -F type=@type.txt "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/mediation-policies/f56eb8b4-128c-45aa-ad35-9c87a546261a/content"' - x-examples: - $ref: docs/examples/mediation-policies/apis_id_mediationpolicies_id_content_put.yaml - - /apis/{apiId}/wsdl-info: - get: - tags: - - APIs - summary: Get WSDL Meta Information - description: | - This operation can be used to retrieve the WSDL meta information of an API. It states whether the API is a SOAP - API. If the API is a SOAP API, it states whether it has a single WSDL or a WSDL archive. - operationId: getWSDLInfoOfAPI - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Requested WSDL meta information of the API is returned - content: - application/json: - schema: - $ref: '#/components/schemas/WSDLInfo' - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/wsdl-info"' - x-examples: - $ref: docs/examples/apis/wsdl/apiId_wsdl_info_get.yaml - - /apis/{apiId}/wsdl: - get: - tags: - - APIs - summary: Get WSDL definition - description: | - This operation can be used to retrieve the WSDL definition of an API. It can be either a single WSDL file or a WSDL archive. - - The type of the WSDL of the API is indicated at the "wsdlInfo" element of the API payload definition. - operationId: getWSDLOfAPI - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested WSDL document of the API is returned - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: {} - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/wsdl"' - x-examples: - $ref: docs/examples/apis/wsdl/apiId_wsdl_get.yaml - - put: - tags: - - APIs - summary: Update WSDL Definition - description: | - This operation can be used to update the WSDL definition of an existing API. WSDL to be updated can be passed as either "url" or "file". - Only one of "url" or "file" can be used at the same time. "file" can be specified as a single WSDL file or as a zip file which has a WSDL - and its dependencies (eg: XSDs) - operationId: updateWSDLOfAPI - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - file: - type: string - description: WSDL file or archive to upload - format: binary - url: - type: string - description: WSDL Definition url - responses: - 200: - description: | - OK. - Successful response with updated WSDL definition - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@api.wsdl "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/wsdl"' - x-examples: - $ref: docs/examples/apis/wsdl/apiId_wsdl_put.yaml - - /apis/{apiId}/graphql-policies/complexity: - get: - tags: - - GraphQL Policies - summary: Get the Complexity Related Details of an API - description: | - This operation can be used to retrieve complexity related details belonging to an API by providing the API id. - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Requested complexity details returned. - headers: - Content-Type: - description: | - The content of the body. - schema: - type: string - default: application/json - content: - application/json: - schema: - $ref: '#/components/schemas/GraphQLQueryComplexityInfo' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/graphql-policies/complexity"' - operationId: getGraphQLPolicyComplexityOfAPI - - - put: - tags: - - GraphQL Policies - summary: Update Complexity Related Details of an API - description: | - This operation can be used to update complexity details belonging to an API by providing the id of the API. - parameters: - - $ref: '#/components/parameters/apiId' - requestBody: - description: Role-depth mapping that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/GraphQLQueryComplexityInfo' - responses: - 200: - description: | - Created. - Complexity details created successfully. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/graphql-policies/complexity"' - operationId: updateGraphQLPolicyComplexityOfAPI - - /apis/{apiId}/graphql-policies/complexity/types: - get: - tags: - - GraphQL Policies - summary: Retrieve Types and Fields of a GraphQL Schema - description: | - This operation can be used to retrieve all types and fields of the GraphQL Schema by providing the API id. - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - Types and fields returned successfully. - headers: - Content-Type: - description: | - The content of the body. - schema: - type: string - default: application/json - content: - application/json: - schema: - $ref: '#/components/schemas/GraphQLSchemaTypeList' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/graphql-policies/complexity/types"' - operationId: getGraphQLPolicyComplexityTypesOfAPI - - /apis/{apiId}/resource-paths: - get: - tags: - - APIs - summary: Get Resource Paths of an API - description: | - This operation can be used to retrieve resource paths defined for a specific api. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - ResourcePaths returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modified the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ResourcePathList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/resource-paths"' - operationId: getAPIResourcePaths - - /apis/{apiId}/auditapi: - get: - tags: - - API Audit - summary: Retrieve the Security Audit Report of the Audit API - description: | - Retrieve the Security Audit Report of the Audit API - parameters: - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - The Security Audit Report has been returned. - headers: - Content-Type: - description: | - The content of the body. - schema: - type: string - default: application/json - content: - application/json: - schema: - $ref: '#/components/schemas/AuditReport' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/auditapi"' - x-examples: - $ref: "docs/examples/apis/apis_id_auditapi_get.yaml" - operationId: getAuditReportOfAPI - - /apis/{apiId}/external-stores: - get: - tags: - - External Stores - summary: Get the List of External Stores to which an API is Published - description: | - This operation can be used to retrieve a list of external stores which an API is published to by providing the id of the API. - operationId: getAllPublishedExternalStoresByAPI - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - External Store list is returned. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIExternalStoreList' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/external-stores"' - x-examples: - $ref: docs/examples/external-stores/external_stores.yaml#/getPublishedExternalStoresByAPI - - /apis/{apiId}/publish-to-external-stores: - post: - tags: - - External Stores - summary: Publish an API to External Stores - description: | - This operation can be used to publish an API to a list of external stores. - operationId: publishAPIToExternalStores - parameters: - - $ref: '#/components/parameters/apiId' - - name: externalStoreIds - in: query - description: External Store Ids of stores which the API needs to be published - or updated. - required: true - schema: - type: string - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - API was successfully published to all the selected external stores. - headers: - ETag: - description: | - Entity Tag of the blocked subscription. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the subscription has been blocked. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIExternalStoreList' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/96077508-fd01-4fae-bc64-5de0e2baf43c/publish-to-external-stores?externalStoreId=Store123#"' - x-examples: - $ref: docs/examples/external-stores/external_stores.yaml#/publishToExternalStore - - /apis/export: - get: - tags: - - Import Export - summary: Export an API - description: | - This operation can be used to export the details of a particular API as a zip file. - parameters: - - name: apiId - in: query - description: UUID of the API - schema: - type: string - - name: name - in: query - description: | - API Name - schema: - type: string - - name: version - in: query - description: | - Version of the API - schema: - type: string - - name: revisionNumber - in: query - description: | - Revision number of the API artifact - schema: - type: string - - name: providerName - in: query - description: | - Provider name of the API - schema: - type: string - - name: format - in: query - description: | - Format of output documents. Can be YAML or JSON. - schema: - type: string - enum: - - JSON - - YAML - - name: preserveStatus - in: query - description: | - Preserve API Status on export - schema: - type: boolean - - name: latestRevision - in: query - description: | - Export the latest revision of the API - schema: - type: boolean - default: false - responses: - 200: - description: | - OK. - Export Successful. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/zip: - schema: - type: string - format: binary - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_create - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/export?apiId=96077508-fd01-4fae-bc64-5de0e2baf43c&name=PizzaShackAPI&version=1.0&provider=admin&format=YAML" - > exportAPI.zip' - operationId: exportAPI - - /apis/import: - post: - tags: - - Import Export - summary: Import an API - description: | - This operation can be used to import an API. - parameters: - - name: preserveProvider - in: query - description: | - Preserve Original Provider of the API. This is the user choice to keep or replace the API provider - required: false - schema: - type: boolean - - name: rotateRevision - in: query - description: | - Once the revision max limit reached, undeploy and delete the earliest revision and create a new revision - required: false - schema: - type: boolean - - name: overwrite - in: query - description: | - Whether to update the API or not. This is used when updating already existing APIs - required: false - schema: - type: boolean - requestBody: - content: - multipart/form-data: - schema: - required: - - file - properties: - file: - type: string - description: Zip archive consisting on exported api configuration - format: binary - responses: - 200: - description: | - Created. - API Imported Successfully. - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@admin-PizzaShackAPI-1.0.0.zip "https://127.0.0.1:9443/api/am/publisher/v2/apis/import?preserveProvider=false&overwrite=false"' - operationId: importAPI - - ###################################################### - # The "Subscription Collection" resource APIs - ###################################################### - /subscriptions: - get: - tags: - - Subscriptions - summary: Get all Subscriptions - description: | - This operation can be used to retrieve a list of subscriptions of the user associated with the provided access token. This operation is capable of - - 1. Retrieving all subscriptions for the user's APIs. - `GET https://127.0.0.1:9443/api/am/publisher/v2/subscriptions` - - 2. Retrieving subscriptions for a specific API. - `GET https://127.0.0.1:9443/api/am/publisher/v2/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed` - parameters: - - $ref: '#/components/parameters/apiId-Q-Opt' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/If-None-Match' - - name: query - in: query - description: | - Keywords to filter subscriptions - schema: - type: string - responses: - 200: - description: | - OK. - Subscription list returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriptionList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:subscription_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions?apiId=96077508-fd01-4fae-bc64-5de0e2baf43c"' - operationId: getSubscriptions - - ###################################################### - # The Individual Subscription resource APIs - ###################################################### - /subscriptions/{subscriptionId}/usage: - get: - tags: - - API Monetization - summary: Get Details of a Pending Invoice for a Monetized Subscription with Metered Billing. - description: | - This operation can be used to get details of a pending invoice for a monetized subscription with meterd billing. - parameters: - - $ref: '#/components/parameters/subscriptionId' - responses: - 200: - description: | - OK. - Details of a pending invoice returned. - headers: - ETag: - description: Entity Tag of the response resource. Used by caches, or - in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: Date and time the resource has been modified the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIMonetizationUsage' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - description: | - Not Found. - Requested Subscription does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - security: - - OAuth2Security: - - apim:subscription_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809/usage"' - operationId: getSubscriptionUsage - - /subscriptions/{subscriptionId}/subscriber-info: - get: - tags: - - Subscriber - summary: Get Details of a Subscriber - description: | - This operation can be used to get details of a user who subscribed to the API. - parameters: - - $ref: '#/components/parameters/subscriptionId' - responses: - 200: - description: | - OK. - Details of the subscriber are returned. - content: - application/json: - schema: - $ref: '#/components/schemas/SubscriberInfo' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:subscription_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions/64eca60b-2e55-4c38-8603-e9e6bad7d809/subscriber-info"' - operationId: getSubscriberInfoBySubscriptionId - - /subscriptions/block-subscription: - post: - tags: - - Subscriptions - summary: Block a Subscription - description: | - This operation can be used to block a subscription. Along with the request, `blockState` must be specified as a query parameter. - - 1. `BLOCKED` : Subscription is completely blocked for both Production and Sandbox environments. - 2. `PROD_ONLY_BLOCKED` : Subscription is blocked for Production environment only. - parameters: - - $ref: '#/components/parameters/subscriptionId-Q' - - name: blockState - in: query - description: | - Subscription block state. - required: true - schema: - type: string - enum: - - BLOCKED - - PROD_ONLY_BLOCKED - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Subscription was blocked successfully. - headers: - ETag: - description: | - Entity Tag of the blocked subscription. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the subscription has been blocked. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:subscription_block - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions/block-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809&blockState=PROD_ONLY_BLOCKED"' - operationId: blockSubscription - - /subscriptions/unblock-subscription: - post: - tags: - - Subscriptions - summary: Unblock a Subscription - description: | - This operation can be used to unblock a subscription specifying the subscription Id. The subscription will be fully unblocked after performing this operation. - parameters: - - $ref: '#/components/parameters/subscriptionId-Q' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Subscription was unblocked successfully. - headers: - ETag: - description: | - Entity Tag of the unblocked subscription. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the subscription has been unblocked. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:subscription_block - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/subscriptions/unblock-subscription?subscriptionId=64eca60b-2e55-4c38-8603-e9e6bad7d809"' - operationId: unBlockSubscription - - - ###################################################### - # The "Thorttling Tier Collection" resource APIs - ###################################################### - /throttling-policies/{policyLevel}: - get: - tags: - - Throttling Policies - summary: Get All Throttling Policies for the Given Type - description: | - This operation can be used to list the available policies for a given policy level. Tier level should be specified as a path parameter and should be one of `subscription` and `api`. - `subscription` is for Subscription Level policies and `api` is for Resource Level policies - operationId: getAllThrottlingPolicies - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/policyLevel' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of policies returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ThrottlingPolicyList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api"' - - ###################################################### - # The "Subscription Throttling Based on Quota Type" resource APIs - ###################################################### - /throttling-policies/streaming/subscription: - get: - tags: - - Throttling Policies - summary: Get subscription throttling policies based on quota type - description: | - This operation can be used to list the available subscription policies for a given tenent ID based on the given quota type. - Quota Type should be provide as a query parameters and supported Quota types are "requestCount" ,"bandwidthVolume" and "eventCount" - operationId: getSubscriptionThrottlingPolicies - parameters: - - $ref: '#/components/parameters/tierQuotaType' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of subscription policies returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ThrottlingPolicyList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/subscription?tierQuotaType=RequestCountLimit"' - - ###################################################### - # The "Individual Throttling Tier" resource APIs - ###################################################### - /throttling-policies/{policyLevel}/{policyName}: - get: - tags: - - Throttling Policies - summary: Get Details of a Policy - description: | - This operation can be used to retrieve details of a single policy by specifying the policy level and policy name. - operationId: getThrottlingPolicyByName - parameters: - - $ref: '#/components/parameters/policyName' - - $ref: '#/components/parameters/policyLevel' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Tier returned - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ThrottlingPolicy' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/throttling-policies/api/Platinum"' - - ###################################################### - # The "Mediation Policy Collection" resource APIs - ###################################################### - /mediation-policies: - get: - tags: - - Global Mediation Policies - summary: | - Get all global level mediation policies - description: | - This operation provides you a list of available all global level mediation policies. - operationId: getAllGlobalMediationPolicies - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: query - in: query - description: -Not supported yet- - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of mediation policies is returned. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/MediationList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:mediation_policy_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/mediation-policies"' - x-examples: - $ref: docs/examples/mediation-policies/mediation_policies_get.yaml - - ################################################################### - # The "Individual Mediation Policy" resource - ################################################################### - /mediation-policies/{mediationPolicyId}/content: - get: - tags: - - Global Mediation Policy - summary: Download a Global Mediation Policy - description: | - This operation can be used to download a particular global mediation policy. - operationId: getGlobalMediationPolicyContent - parameters: - - $ref: '#/components/parameters/mediationPolicyId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Mediation policy returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_view - - apim:mediation_policy_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/mediation-policies/d48a3412-1b85-49be-99f4-b81a3722ae73/content" - > mediation.xml' - - /apis/{apiId}/client-certificates: - get: - tags: - - Client Certificates - summary: Retrieve/ Search Uploaded Client Certificates - description: | - This operation can be used to retrieve and search the uploaded client certificates. - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: alias - in: query - description: Alias for the client certificate - schema: - type: string - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. Successful response with the list of matching certificate information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ClientCertificates' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:client_certificates_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates?alias=wso2carbon"' - operationId: getAPIClientCertificates - - post: - tags: - - Client Certificates - summary: Upload a New Certificate - description: | - This operation can be used to upload a new certificate for an endpoint. - parameters: - - $ref: '#/components/parameters/apiId' - requestBody: - content: - multipart/form-data: - schema: - required: - - alias - - certificate - - tier - properties: - certificate: - type: string - description: The certificate that needs to be uploaded. - format: binary - alias: - maxLength: 30 - minLength: 1 - type: string - description: Alias for the certificate - tier: - type: string - description: api tier to which the certificate should be applied. - required: true - responses: - 200: - description: | - OK. - The Certificate added successfully. - headers: - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ClientCertMetadata' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:client_certificates_add - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon - -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates"' - operationId: addAPIClientCertificate - - /apis/{apiId}/client-certificates/{alias}: - get: - tags: - - Client Certificates - summary: Get the Certificate Information - description: | - This operation can be used to get the information about a certificate. - parameters: - - name: alias - in: path - required: true - schema: - type: string - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CertificateInfo' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:client_certificates_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' - operationId: getAPIClientCertificateByAlias - - put: - tags: - - Client Certificates - summary: Update a Certificate - description: | - This operation can be used to update an uploaded certificate. - parameters: - - name: alias - in: path - description: Alias for the certificate - required: true - schema: - maxLength: 30 - minLength: 1 - type: string - - $ref: '#/components/parameters/apiId' - requestBody: - content: - multipart/form-data: - schema: - properties: - certificate: - type: string - description: The certificate that needs to be uploaded. - format: binary - tier: - type: string - description: The tier of the certificate - responses: - 200: - description: | - OK. - The Certificate updated successfully. - headers: - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ClientCertMetadata' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:client_certificates_update - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=wso2carbon - -F apiId=fea749dd-d548-4a8b-b308-34903b39a34b -F tier=Gold "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' - operationId: updateAPIClientCertificateByAlias - - delete: - tags: - - Client Certificates - summary: Delete a Certificate - description: | - This operation can be used to delete an uploaded certificate. - parameters: - - name: alias - in: path - description: | - The alias of the certificate that should be deleted. - required: true - schema: - type: string - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. - The Certificate deleted successfully. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:client_certificates_update - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon"' - operationId: deleteAPIClientCertificateByAlias - - /apis/{apiId}/client-certificates/{alias}/content: - get: - tags: - - Client Certificates - summary: Download a Certificate - description: | - This operation can be used to download a certificate which matches the given alias. - parameters: - - $ref: '#/components/parameters/apiId' - - name: alias - in: path - required: true - schema: - type: string - responses: - 200: - description: | - OK. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:client_certificates_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/client-certificates/wso2carbon/content"' - operationId: getAPIClientCertificateContentByAlias - - ###################################################### - # The "Certificate Management" resource APIs - ###################################################### - /endpoint-certificates: - get: - tags: - - Endpoint Certificates - summary: Retrieve/Search Uploaded Certificates - description: | - This operation can be used to retrieve and search the uploaded certificates. - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: alias - in: query - description: Alias for the certificate - schema: - maxLength: 30 - type: string - - name: endpoint - in: query - description: Endpoint of which the certificate is uploaded - schema: - type: string - responses: - 200: - description: | - OK. Successful response with the list of matching certificate information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Certificates' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:ep_certificates_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/endpoint-certificates?alias=wso2carbon&endpoint=www.abc.com"' - operationId: getEndpointCertificates - - post: - tags: - - Endpoint Certificates - summary: Upload a new Certificate. - description: | - This operation can be used to upload a new certificate for an endpoint. - requestBody: - content: - multipart/form-data: - schema: - required: - - alias - - certificate - - endpoint - properties: - certificate: - type: string - description: The certificate that needs to be uploaded. - format: binary - alias: - maxLength: 30 - minLength: 1 - type: string - description: Alias for the certificate - endpoint: - type: string - description: Endpoint to which the certificate should be applied. - required: true - responses: - 200: - description: | - OK. - The Certificate added successfully. - headers: - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CertMetadata' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:ep_certificates_add - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F certificate=@test.crt -F alias=alias - -F "endpoint=endpoint=https://www.abc.com" "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/endpoint-certificates"' - operationId: addEndpointCertificate - - /endpoint-certificates/{alias}: - get: - tags: - - Endpoint Certificates - summary: Get the Certificate Information - description: | - This operation can be used to get the information about a certificate. - parameters: - - name: alias - in: path - required: true - schema: - type: string - responses: - 200: - description: | - OK. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CertificateInfo' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:ep_certificates_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/endpoint-certificates/wso2carbon"' - operationId: getEndpointCertificateByAlias - - put: - tags: - - Endpoint Certificates - summary: Update a certificate. - description: | - This operation can be used to update an uploaded certificate. - parameters: - - name: alias - in: path - description: Alias for the certificate - required: true - schema: - maxLength: 30 - minLength: 1 - type: string - requestBody: - content: - multipart/form-data: - schema: - required: - - certificate - properties: - certificate: - type: string - description: The certificate that needs to be uploaded. - format: binary - required: true - responses: - 200: - description: | - OK. - The Certificate updated successfully. - headers: - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/CertMetadata' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:ep_certificates_update - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F certificate=@test.crt "https://127.0.0.1:9443/api/am/publisher/v2/apis/d48a3412-1b85-49be-99f4-b81a3722ae73/endpoint-certificates/wso2carbon"' - operationId: updateEndpointCertificateByAlias - - delete: - tags: - - Endpoint Certificates - summary: Delete a certificate. - description: | - This operation can be used to delete an uploaded certificate. - parameters: - - name: alias - in: path - description: | - The alias of the certificate that should be deleted. - required: true - schema: - type: string - responses: - 200: - description: | - OK. - The Certificate deleted successfully. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_create - - apim:ep_certificates_update - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/endpoint-certificates/wso2carbon"' - operationId: deleteEndpointCertificateByAlias - - /endpoint-certificates/{alias}/content: - get: - tags: - - Endpoint Certificates - summary: Download a Certificate - description: | - This operation can be used to download a certificate which matches the given alias. - parameters: - - name: alias - in: path - required: true - schema: - type: string - responses: - 200: - description: | - OK. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - - apim:ep_certificates_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/endpoint-certificates/wso2carbon/content"' - operationId: getEndpointCertificateContentByAlias - - ###################################################### - # The "Content Search Results" resource APIs - ###################################################### - /search: - get: - tags: - - Unified Search - summary: | - Retrieve/Search APIs and API Documents by Content - description: | - This operation provides you a list of available APIs and API Documents qualifying the given keyword match. - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: query - in: query - description: | - **Search**. - - You can search by proving a keyword. - schema: - type: string - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of qualifying APIs and API documents is returned. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/SearchResultList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - apim:api_import_export - - apim:api_product_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/search?query=pizza"' - x-examples: - $ref: docs/examples/apis/search_get.yaml - operationId: search - - ###################################################### - # The "API Product Collection" resource APIs - ###################################################### - /api-products: - get: - tags: - - API Products - summary: | - Retrieve/Search API Products - description: | - This operation provides you a list of available API Products qualifying under a given search condition. - - Each retrieved API Product is represented with a minimal amount of attributes. If you want to get complete details of an API Product, you need to use **Get details of an API Product** operation. - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - name: query - in: query - schema: - type: string - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - List of qualifying API Products is returned. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIProductList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products?query=PizzaAPIProduct"' - operationId: getAllAPIProducts - - post: - tags: - - API Products - summary: Create a New API Product - description: | - This operation can be used to create a new API Product specifying the details of the API Product in the payload. - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/APIProduct' - required: true - responses: - 201: - description: | - 'Created. - Successful response with the newly created object as entity in the body. - Location header contains URL of newly created entity.' - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIProduct' - 400: - $ref: '#/components/responses/BadRequest' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/api-products"' - operationId: createAPIProduct - - ################################################################ - # The "Individual API Product" resource APIs - ################################################################ - /api-products/{apiProductId}: - get: - tags: - - API Products - summary: Get Details of an API Product - description: | - Using this operation, you can retrieve complete details of a single API Product. You need to provide the Id of the API to retrive it. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested API Product is returned - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIProduct' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33"' - operationId: getAPIProduct - - put: - tags: - - API Products - summary: Update an API Product - description: | - This operation can be used to update an existing API product. - But the properties `name`, `provider` and `version` cannot be changed. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: API object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/APIProduct' - required: true - responses: - 200: - description: | - OK. - Successful response with updated API product object - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIProduct' - 400: - $ref: '#/components/responses/BadRequest' - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33"' - operationId: updateAPIProduct - - - delete: - tags: - - API Products - summary: Delete an API Product - description: | - This operation can be used to delete an existing API Product proving the Id of the API Product. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Resource successfully deleted. - content: {} - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_product_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33"' - operationId: deleteAPIProduct - - /api-products/{apiProductId}/thumbnail: - get: - tags: - - API Products - summary: Get Thumbnail Image - description: | - This operation can be used to download a thumbnail image of an API product. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Thumbnail image returned - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/thumbnail" - > image.jpeg' - operationId: getAPIProductThumbnail - - put: - tags: - - API Products - summary: Upload a Thumbnail Image - description: | - This operation can be used to upload a thumbnail image of an API Product. The thumbnail to be uploaded should be given as a form data parameter `file`. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - required: - - file - properties: - file: - type: string - description: Image to upload - format: binary - required: true - responses: - 200: - description: | - OK. - Image updated - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the uploaded thumbnail image of the API Product. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/FileInfo' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F file=@image.jpeg "https://127.0.0.1:9443/api/am/publisher/v2/api-products/d48a3412-1b85-49be-99f4-b81a3722ae73/thumbnail"' - operationId: updateAPIProductThumbnail - - /api-products/{apiProductId}/swagger: - get: - tags: - - API Products - summary: Get Swagger Definition - description: | - This operation can be used to retrieve the swagger definition of an API. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested swagger document of the API is returned - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/swagger"' - operationId: getAPIProductSwagger - - /api-products/{apiProductId}/is-outdated: - get: - tags: - - API Products - summary: Check Whether API Product is Outdated - description: | - This operation can be used to retrieve the status indicating if an API Product is outdated due to updating of dependent APIs (This resource is not supported at the moment) - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested swagger document of the API is returned - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/APIProductOutdatedStatus' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_publish - operationId: getIsAPIProductOutdated - - /api-products/{apiProductId}/documents: - get: - tags: - - API Product Documents - summary: Get a List of Documents of an API Product - description: | - This operation can be used to retrive a list of documents belonging to an API Product by providing the id of the API Product. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Document list is returned. - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/DocumentList' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents"' - operationId: getAPIProductDocuments - - post: - tags: - - API Product Documents - summary: Add a New Document to an API Product - description: | - This operation can be used to add a new documentation to an API Product. This operation only adds the metadata of a document. To add the actual content we need to use **Upload the content of an API Product document ** API once we obtain a document Id by this operation. - parameters: - - $ref: '#/components/parameters/apiProductId' - requestBody: - description: Document object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - required: true - responses: - 201: - description: | - Created. - Successful response with the newly created Document object as entity in the body. - Location header contains URL of newly added document. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - Location to the newly created Document. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - 400: - $ref: '#/components/responses/BadRequest' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents"' - operationId: addAPIProductDocument - - /api-products/{apiProductId}/documents/{documentId}: - get: - tags: - - API Product Documents - summary: Get a Document of an API Product - description: | - This operation can be used to retrieve a particular document's metadata associated with an API. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Document returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3"' - operationId: getAPIProductDocument - - put: - tags: - - API Product Documents - summary: Update a Document of an API Product - description: | - This operation can be used to update metadata of an API's document. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - requestBody: - description: Document object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - required: true - responses: - 200: - description: | - OK. - Document updated - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the updated document. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3"' - operationId: updateAPIProductDocument - - delete: - tags: - - API Product Documents - summary: Delete a Document of an API Product - description: | - This operation can be used to delete a document associated with an API Product. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - responses: - 200: - description: | - OK. - Resource successfully deleted. - content: {} - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3"' - operationId: deleteAPIProductDocument - - /api-products/{apiProductId}/documents/{documentId}/content: - get: - tags: - - API Product Documents - summary: Get the Content of an API Product Document - description: | - This operation can be used to retrive the content of an API's document. - - The document can be of 3 types. In each cases responses are different. - - 1. **Inline type**: - The content of the document will be retrieved in `text/plain` content type - - _Sample cURL_ : `curl -k -H "Authorization:Bearer 579f0af4-37be-35c7-81a4-f1f1e9ee7c51" -F inlineContent=@"docs.txt" -X POST "https://localhost:9443/api/am/publisher/v2/apis/995a4972-3178-4b17-a374-756e0e19127c/documents/43c2bcce-60e7-405f-bc36-e39c0c5e189e/content` - 2. **FILE type**: - The file will be downloaded with the related content type (eg. `application/pdf`) - 3. **URL type**: - The client will recieve the URL of the document as the Location header with the response with - `303 See Other` - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/Accept' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - File or inline content returned. - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 303: - description: | - See Other. - Source can be retrived from the URL specified at the Location header. - headers: - Location: - description: | - The Source URL of the document. - schema: - type: string - content: {} - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: {} - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3/content"' - operationId: getAPIProductDocumentContent - - post: - tags: - - API Product Documents - summary: Upload the Content of an API Product Document - description: | - Thid operation can be used to upload a file or add inline content to an API Product document. - - **IMPORTANT:** - * Either **file** or **inlineContent** form data parameters should be specified at one time. - * Document's source type should be **FILE** in order to upload a file to the document using **file** parameter. - * Document's source type should be **INLINE** in order to add inline content to the document using **inlineContent** parameter. - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/documentId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - file: - type: string - description: Document to upload - format: binary - inlineContent: - type: string - description: Inline content of the document - responses: - 200: - description: | - OK. - Document updated - headers: - ETag: - description: | - Entity Tag of the response resource. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the updated content of the document. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Document' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: multipart/form-data" -F file=@sample.pdf "https://127.0.0.1:9443/api/am/publisher/v2/api-products/5bca47e1-8233-46a5-9295-525dca337f33/documents/83312daf-0d8a-427b-8f72-12755b7901d3/content"' - operationId: addAPIProductDocumentContent - - ###################################################### - # The "API Product Revisions" resource API - ###################################################### - /api-products/{apiProductId}/revisions: - - #-------------------------------------------- - # List available revisions of an API Product - #-------------------------------------------- - get: - tags: - - API Product Revisions - summary: List available revisions of an API Product - description: | - List available revisions of an API Product - operationId: getAPIProductRevisions - parameters: - - $ref: '#/components/parameters/apiProductId' - - name: query - in: query - schema: - type: string - responses: - 200: - description: | - OK. - List of API Product revisions are returned. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevisionList' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_product_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions?query=deployed:true"' - - #-------------------------------------------- - # Create a new API Product revision - #-------------------------------------------- - post: - tags: - - API Product Revisions - summary: Create a new API Product revision - description: | - Create a new API Product revision - operationId: createAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - requestBody: - description: API Product object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevision' - responses: - 201: - description: | - Created. - Successful response with the newly created APIRevision object as the entity in the body. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevision' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions"' - - ###################################################### - # The "API Revisions" individual resource API Product - ###################################################### - /api-products/{apiProductId}/revisions/{revisionId}: - - #-------------------------------------------- - # Get a revision - #-------------------------------------------- - get: - tags: - - API Product Revisions - summary: Retrieve a revision of an API Product - description: | - Retrieve a revision of an API Product - operationId: getAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/revisionId' - responses: - 200: - description: | - OK. - An API revision is returned. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevision' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' - - #-------------------------------------------- - # Delete a revision - #-------------------------------------------- - delete: - tags: - - API Product Revisions - summary: Delete a revision of an API Product - description: | - Delete a revision of an API Product - operationId: deleteAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/revisionId' - responses: - 200: - description: | - OK. - List of remaining API revisions are returned. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevisionList' - 204: - description: | - No Content. - Successfully deleted the revision - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/revisions/e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /api-products/{apiProductId}/deploy-revision: - - #-------------------------------------------- - # List available deployed revision deployment details of an API Product - #-------------------------------------------- - get: - tags: - - API Product Revisions - summary: List available deployed revision deployment details of an API Product - description: | - List available deployed revision deployment details of an API Product - operationId: getAPIProductRevisionDeployments - parameters: - - $ref: '#/components/parameters/apiProductId' - responses: - 200: - description: | - OK. - List of deployed revision deployment details are returned. - content: - application/json: - schema: - $ref: '#/components/schemas/APIRevisionDeploymentList' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision"' - - #-------------------------------------------- - # Deploy a revision - #-------------------------------------------- - post: - tags: - - API Product Revisions - summary: Deploy a revision - description: | - Deploy a revision - operationId: deployAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/revisionId-Q' - requestBody: - description: Deployment object that needs to be added - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - responses: - 200: - description: | - OK. - 201: - description: | - Created. - Successful response with the newly deployed APIRevisionDeployment List object as the entity in the body. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/deploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /api-products/{apiProductId}/undeploy-revision: - #-------------------------------------------- - # Un-Deploy a revision from deployed gateway - #-------------------------------------------- - post: - tags: - - API Product Revisions - summary: Un-Deploy a revision - description: | - Un-Deploy a revision - operationId: undeployAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/revisionId-Q' - - $ref: '#/components/parameters/revisionNum-Q' - - name: allEnvironments - in: query - schema: - type: boolean - default: false - requestBody: - description: Deployment object that needs to be added - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - responses: - 200: - description: | - OK. - 201: - description: | - Created. - Successful response with the newly undeployed APIRevisionDeploymentList object as the entity in the body. - content: - application/json: - schema: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - - apim:api_product_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/undeploy-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /api-products/{apiProductId}/restore-revision: - - #-------------------------------------------------------- - # Restore a revision to the working copy of the API Product - #-------------------------------------------------------- - post: - tags: - - API Product Revisions - summary: Restore a revision - description: | - Restore a revision to the working copy of the API Product - operationId: restoreAPIProductRevision - parameters: - - $ref: '#/components/parameters/apiProductId' - - $ref: '#/components/parameters/revisionId-Q' - responses: - 201: - description: | - Restored. - Successful response with the newly restored API Product object as the entity in the body. - content: - application/json: - schema: - $ref: '#/components/schemas/APIProduct' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/890a4f4d-09eb-4877-a323-57f6ce2ed79b/restore-revision?revisionId=e0824883-3e86-403a-aec1-22bbc454eb7c"' - - /api-products/export: - get: - tags: - - Import Export - summary: Export an API Product - description: | - This operation can be used to export the details of a particular API Product as a zip file. - parameters: - - name: name - in: query - description: | - API Product Name - schema: - type: string - - name: version - in: query - description: | - Version of the API Product - schema: - type: string - - name: providerName - in: query - description: | - Provider name of the API Product - schema: - type: string - - name: revisionNumber - in: query - description: | - Revision number of the API Product - schema: - type: string - - name: format - in: query - description: | - Format of output documents. Can be YAML or JSON. - schema: - type: string - enum: - - JSON - - YAML - - name: preserveStatus - in: query - description: | - Preserve API Product Status on export - schema: - type: boolean - - name: latestRevision - in: query - description: | - Export the latest revision of the API Product - schema: - type: boolean - default: false - responses: - 200: - description: | - OK. - Export Successful. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/zip: - schema: - type: string - format: binary - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-products/export?name=LeasingAPIProduct&version=1.0.0&revisionNumber=2&provider=admin&format=YAML" - > exportAPIProduct.zip' - operationId: exportAPIProduct - - /api-products/import: - post: - tags: - - Import Export - summary: Import an API Product - description: | - This operation can be used to import an API Product. - parameters: - - name: preserveProvider - in: query - description: | - Preserve Original Provider of the API Product. This is the user choice to keep or replace the API Product provider - required: false - schema: - type: boolean - - name: rotateRevision - in: query - description: | - Once the revision max limit reached, undeploy and delete the earliest revision and create a new revision - required: false - schema: - type: boolean - - name: importAPIs - in: query - description: | - Whether to import the dependent APIs or not. - schema: - type: boolean - - name: overwriteAPIProduct - in: query - description: | - Whether to update the API Product or not. This is used when updating already existing API Products. - schema: - type: boolean - - name: overwriteAPIs - in: query - description: | - Whether to update the dependent APIs or not. This is used when updating already existing dependent APIs of an API Product. - schema: - type: boolean - requestBody: - content: - multipart/form-data: - schema: - required: - - file - properties: - file: - type: string - description: | - Zip archive consisting on exported API Product configuration - format: binary - responses: - 200: - description: | - Created. - API Product Imported Successfully. - content: {} - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 409: - $ref: '#/components/responses/Conflict' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_product_import_export - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -F file=@admin-PizzaShackAPIProduct.zip "https://127.0.0.1:9443/api/am/admin/v2/api-products/importt?preserveProvider=false&overwriteAPIProduct=false&overwriteAPIs=false&importAPIs=false"' - operationId: importAPIProduct - - ###################################################### - # Roles resource APIs - ###################################################### - /roles/{roleId}: - head: - tags: - - Roles - summary: Check Whether Given Role Name already Exist - description: | - Using this operation, user can check a given role name exists or not. - operationId: validateSystemRole - parameters: - - $ref: '#/components/parameters/roleId' - responses: - 200: - description: OK. Requested role name exists. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/roles/SW50ZXJuYWwvcHVibGlzaGVyCQ"' - - /me/roles/{roleId}: - head: - tags: - - Roles - summary: Validate Whether the Logged-in User has the Given Role - description: | - Using this operation, logged-in user can check whether he has given role. - operationId: validateUserRole - parameters: - - $ref: '#/components/parameters/roleId' - responses: - 200: - description: OK. Requested user has the role. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/me/roles/SW50ZXJuYWwvcHVibGlzaGVyCQ"' - - ###################################################### - # The "ExternalStore Collection" resource APIs - ###################################################### - /external-stores: - get: - tags: - - External Stores - summary: Retrieve External Stores List to Publish an API - description: | - Retrieve external stores list configured to publish an API - operationId: getAllExternalStores - responses: - 200: - description: | - OK. - External Stores list returned - content: - application/json: - schema: - $ref: '#/components/schemas/ExternalStore' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/external-stores"' - - ###################################################### - # The Publisher settings resource APIs - ###################################################### - /settings: - get: - tags: - - Settings - summary: Retreive Publisher Settings - description: | - Retreive publisher settings - responses: - 200: - description: | - OK. - Settings returned - content: - application/json: - schema: - $ref: '#/components/schemas/Settings' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:publisher_settings - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/settings"' - operationId: getSettings - - ###################################################### - # The tenant resource APIs - ###################################################### - /tenants: - get: - tags: - - Tenants - summary: | - Get Tenants by State - description: | - This operation is to get tenants by state - operationId: getTenantsByState - parameters: - - name: state - in: query - description: | - The state represents the current state of the tenant - - Supported states are [active, inactive] - schema: - type: string - default: active - enum: - - active - - inactive - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - responses: - 200: - description: | - OK. - Tenant names returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/TenantList' - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/tenants?state=active"' - - /tenants/{tenantDomain}: - head: - tags: - - Tenants - summary: Check Whether the Given Tenant already Exists - description: | - Using this operation, user can check whether a given tenant exists or not. - operationId: getTenantExistence - parameters: - - $ref: '#/components/parameters/tenantDomain' - responses: - 200: - description: OK. Requested tenant exists. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/tenants/wso2.com"' - x-examples: - $ref: docs/examples/tenants/tenants.yaml - - #################################################### - # Publisher Alerts management REST API - #################################################### - /alert-types: - get: - tags: - - Alerts - summary: | - Get the list of API Publisher alert types. - description: | - This operation is used to get the list of supportd alert types for the 'publisher' agent. - operationId: getPublisherAlertTypes - responses: - 200: - description: | - OK. - The list of publisher alert types are returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertTypesList' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alert-types"' - x-examples: - $ref: docs/examples/alerts/alerts.yaml#/get - - /alert-subscriptions: - get: - tags: - - Alert Subscriptions - summary: | - Get the List of API Publisher Alert Types Subscribed by the User - description: | - This operation is used to get the list of subscribed alert types by the user. - operationId: getSubscribedAlertTypes - responses: - 200: - description: | - OK. - The list of subscribed alert types are returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfo' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/get - - put: - tags: - - Alert Subscriptions - summary: | - Subscribe to the Selected Tlert types by the User - description: | - This operation is used to get the list of subscribed alert types by the user. - operationId: subscribeToAlerts - requestBody: - description: The alerts list and the email list to subscribe. - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfo' - required: true - responses: - 201: - description: | - OK. - Successful response with the newly subscribed alerts. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertsInfoResponse' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/put - - delete: - tags: - - Alert Subscriptions - summary: | - Unsubscribe User from All the Alert Types - description: | - This operation is used to unsubscribe the respective user from all the alert types. - operationId: unsubscribeAllAlerts - responses: - 200: - description: | - OK. - The user is unsubscribed from the alerts successfully. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: {} - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alert-subscriptions"' - x-examples: - $ref: docs/examples/alerts/alerts_subscriptions.yaml#/delete - - /alerts/{alertType}/configurations: - get: - tags: - - Alert Configuration - summary: | - Get All AbnormalRequestsPerMin Alert Configurations - description: | - This operation is used to get all configurations of the AbnormalRequestsPerMin alert type. - operationId: getAllAlertConfigs - parameters: - - $ref: '#/components/parameters/alertType' - responses: - 200: - description: | - OK. - The Developer Portal alert configuration. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfigList' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/alerts/{alertType}/configurations"' - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/get - - /alerts/{alertType}/configurations/{configurationId}: - put: - tags: - - Alert Configuration - summary: | - Add AbnormalRequestsPerMin Alert Configurations. - description: | - This operation is used to add configuration for the AbnormalRequestsPerMin alert type. - operationId: addAlertConfig - parameters: - - $ref: '#/components/parameters/alertType' - - $ref: '#/components/parameters/configurationId' - requestBody: - description: Configuration for AbnormalRequestCount alert type - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfigInfo' - required: true - responses: - 201: - description: | - Created. - Successful response with newly created object as entity. - Location header contains URL of newly created entity. - headers: - Location: - description: | - The location of the newly created entity. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AlertConfig' - 400: - $ref: '#/components/responses/BadRequest' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/put - - delete: - tags: - - Alert Configuration - summary: | - Delete the Selected Configuration from AbnormalRequestsPerMin Alert Type. - description: | - This operation is used to delete configuration from the AbnormalRequestsPerMin alert type. - operationId: deleteAlertConfig - parameters: - - $ref: '#/components/parameters/alertType' - - $ref: '#/components/parameters/configurationId' - responses: - 200: - description: | - OK. - The alert config is deleted successfully. - content: {} - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:pub_alert_manage - x-examples: - $ref: docs/examples/alerts/alerts_config.yaml#/delete - - ###################################################### - # The "Label Collection" resource API - ###################################################### - /labels: - get: - tags: - - Label Collection - summary: Get all Registered Labels - description: | - Get all registered Labels - responses: - 200: - description: | - OK. - Labels returned - content: - application/json: - schema: - $ref: '#/components/schemas/LabelList' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/labels"' - operationId: getLabels - - ###################################################### - # The "API Category Collection" resource API - ###################################################### - /api-categories: - get: - tags: - - API Category (Collection) - summary: Get all API categories - description: | - Get all API categories - responses: - 200: - description: | - OK. - Categories returned - content: - application/json: - schema: - $ref: '#/components/schemas/APICategoryList' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/api-categories"' - operationId: getAllAPICategories - - ###################################################### - # The "Scopes" resource APIs - ###################################################### - /scopes: - get: - tags: - - Scopes - summary: Get All Available Shared Scopes - description: | - This operation can be used to get all the available Shared Scopes. - operationId: getSharedScopes - parameters: - - $ref: '#/components/parameters/limit' - - $ref: '#/components/parameters/offset' - responses: - 200: - description: | - OK. - Shared Scope list is returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/ScopeList' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/scopes"' - - post: - tags: - - Scopes - summary: Add a New Shared Scope - description: | - This operation can be used to add a new Shared Scope. - operationId: addSharedScope - requestBody: - description: Scope object that needs to be added - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - required: true - responses: - 201: - description: | - Created. - Successful response with the newly created Scope object as an entity in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - 400: - $ref: '#/components/responses/BadRequest' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:shared_scope_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X POST -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/scopes"' - - /scopes/{scopeId}: - get: - tags: - - Scopes - summary: Get a Shared Scope by Scope Id - description: | - This operation can be used to retrieve details of a Shared Scope by a given scope Id. - operationId: getSharedScope - parameters: - - $ref: '#/components/parameters/scopeId' - responses: - 200: - description: | - OK. - Requested Shared Scope is returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901"' - - put: - tags: - - Scopes - summary: Update a Shared Scope - description: | - This operation can be used to update a Shared Scope by a given scope Id. - operationId: updateSharedScope - parameters: - - $ref: '#/components/parameters/scopeId' - requestBody: - description: Scope object that needs to be updated - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - required: true - responses: - 200: - description: | - OK. - Successful response with updated Scope object - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/Scope' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:shared_scope_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X PUT -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - -H "Content-Type: application/json" -d @data.json "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901"' - - delete: - tags: - - Scopes - summary: Delete a Shared Scope - description: | - This operation can be used to delete a Shared Scope proving the Id of the scope. - operationId: deleteSharedScope - parameters: - - $ref: '#/components/parameters/scopeId' - responses: - 200: - description: | - OK. - Resource successfully deleted. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:shared_scope_manage - x-code-samples: - - lang: Curl - source: 'curl -k -X DELETE -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901"' - - head: - tags: - - Scopes - summary: Check Given Scope Name already Exists - description: | - Using this operation, user can check a given scope name exists or not. - operationId: validateScope - parameters: - - $ref: '#/components/parameters/scopeName' - responses: - 200: - description: OK. Requested scope name exists. - content: {} - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - apim:api_publish - x-code-samples: - - lang: Curl - source: 'curl -k -I -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/scopes/YXBpbTphcGlfdmlldw"' - - /scopes/{scopeId}/usage: - get: - tags: - - Scopes - summary: Get usages of a Shared Scope by Scope Id - description: | - This operation can be used to retrieve usages of a Shared Scope by a given scope Id. - operationId: getSharedScopeUsages - parameters: - - $ref: '#/components/parameters/scopeId' - responses: - 200: - description: | - OK. - Usages of the shared scope is returned. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/SharedScopeUsage' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/scopes/01234567-0123-0123-0123-012345678901/usage"' - - ###################################################### - # The "Key Managers Collection" resource API - ###################################################### - /key-managers: - get: - tags: - - Key Managers (Collection) - summary: Get All Key Managers - description: | - Get all Key managers - responses: - 200: - description: | - OK. - Categories returned - content: - application/json: - schema: - $ref: '#/components/schemas/KeyManagerList' - security: - - OAuth2Security: - - apim:api_create - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/key-managers"' - operationId: getAllKeyManagers - - ###################################################### - # The "Deployments" resource APIs - ###################################################### - /deployments: - get: - tags: - - Deployments - summary: Retrieve Deployment Environments Details - description: | - This operation can be used to retrieve cloud clusters information defines in tenant-conf.json file. - - With that you can deploy an API to selected cloud environments. - operationId: deploymentsGet - responses: - 200: - description: | - OK. Successful response with the list of deployment environments information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/DeploymentList' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/deployments"' - - /apis/{apiId}/deployments: - get: - tags: - - DeploymentStatus - summary: Retrieve Deployment Status Details - description: | - This operation can be used to retrieve the status of deployments in cloud clusters. - - With that you can get the status of the deployed APIs in cloud environments. - operationId: deploymentsGetStatus - parameters: - - $ref: '#/components/parameters/apiId' - responses: - 200: - description: | - OK. Successful response with the list of deployment environments information in the body. - headers: - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/DeploymentStatusList' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - 500: - $ref: '#/components/responses/InternalServerError' - security: - - OAuth2Security: - - apim:api_view - x-code-samples: - - lang: Curl - source: 'curl -k -H "Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8" - "https://127.0.0.1:9443/api/am/publisher/v2/apis/92bc1330-1848-4fe8-b992-c792186c212e/deployments/"' - - /apis/validate-asyncapi: - post: - tags: - - Validation - summary: Validate an AsyncAPI Specification - description: - This operation can be used to validate and AsyncAPI Specification and retrieve a summary. Provide either 'url' - or 'file' to specify the definition. - operationId: validateAsyncAPISpecification - parameters: - - name: returnContent - in: query - description: - Specify whether to return the full content of the AsyncAPI specification in the response. This is only - applicable when using url based validation - schema: - type: boolean - default: false - requestBody: - content: - multipart/form-data: - schema: - properties: - url: - type: string - description: AsyncAPI definition url - file: - type: string - description: AsyncAPI definition as a file - format: binary - responses: - 200: - description: - OK. - API definition validation information is returned - headers: - Content-Type: - description: - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/AsyncAPISpecificationValidationResponse' - 400: - $ref: '#/components/responses/BadRequest' - 404: - $ref: '#/components/responses/NotFound' - security: - - OAuth2Security: - - apim:api_create - - /apis/import-asyncapi: - post: - tags: - - APIs - summary: import an AsyncAPI Specification - description: - This operation can be used to create and API from the AsyncAPI Specification. Provide either 'url' or 'file' - to specify the definition. - - Specify additionalProperties with **at least** API's name, version, context and endpointConfig. - operationId: importAsyncAPISpecification - requestBody: - content: - multipart/form-data: - schema: - properties: - file: - type: string - description: Definition to upload as a file - format: binary - url: - type: string - description: Definition url - additionalProperties: - type: string - description: Additional attributes specified as a stringified JSON with API's schema - responses: - 201: - description: - Created. Successful response with the newly created object as entity in the body. - Location header contains URL of newly created entity. - headers: - Etag: - description: - Entity Tag of the respons resource. Used by caches, or in conditional requests (Will be supported in the future). - schema: - type: string - Location: - description: - The URL of the newly created resource. - schema: - type: string - Content-type: - description: - The content type of the body. - schema: - type: string - content: - application/json: - schema: - $ref: '#/components/schemas/API' - 400: - $ref: '#/components/responses/BadRequest' - 415: - $ref: '#/components/responses/UnsupportedMediaType' - security: - - OAuth2Security: - - apim:api_create - - /apis/{apiId}/asyncapi: - get: - tags: - - APIs - summary: Get AsyncAPI definition - description: | - This operation can be used to retrieve the AsyncAPI definition of an API. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-None-Match' - responses: - 200: - description: | - OK. - Requested AsyncAPI definition of the API is returned - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Willl= be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has beed modified the last time. - Used by caches, or in conditional request (Will be supported in future). - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: "" - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource (Will be supported in future). - content: { } - 404: - $ref: '#/components/responses/NotFound' - 406: - $ref: '#/components/responses/NotAcceptable' - security: - - OAuth2Security: - - apim:api_view - - put: - tags: - - APIs - summary: Update AsyncAPI definition - description: | - This operation can be used to update the AsyncAPI definition of an existing API. AsyncAPI definition to be updated is passed as a form data parameter 'apiDefinition'. - parameters: - - $ref: '#/components/parameters/apiId' - - $ref: '#/components/parameters/If-Match' - requestBody: - content: - multipart/form-data: - schema: - properties: - apiDefinition: - type: string - description: AsyncAPI definition of the API - url: - type: string - description: AsyncAPI definition URL of the API - file: - type: string - description: AsyncAPI definition as a file - format: binary - responses: - 200: - description: | - OK. - Successful response with updated AsyncAPI definition - headers: - ETag: - description: | - Entity Tag of the response resource. Used by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Last-Modified: - description: | - Date and time the resource has beed modified the last time. - Use =d by caches, or in conditional requests (Will be supported in future). - schema: - type: string - Location: - description: | - The URL of the newly created resource. - schema: - type: string - Content-Type: - description: | - The content type of the body. - schema: - type: string - content: - application/json: - schema: - type: string - example: "" - 400: - $ref: '#/components/responses/BadRequest' - 403: - $ref: '#/components/responses/Forbidden' - 404: - $ref: '#/components/responses/NotFound' - 412: - $ref: '#/components/responses/PreconditionFailed' - security: - - OAuth2Security: - - apim:api_create - -components: - schemas: - Comment: - title: Comment - required: - - content - type: object - properties: - id: - type: string - readOnly: true - example: 943d3002-000c-42d3-a1b9-d6559f8a4d49 - content: - maxLength: 512 - type: string - example: This is a comment - createdTime: - type: string - readOnly: true - example : 2021-02-11-09:57:25 - createdBy: - type: string - readOnly: true - example: admin - updatedTime: - type: string - readOnly: true - example : 2021-02-12-19:57:25 - category: - type: string - default: general - parentCommentId: - type: string - example: 6f38aea2-f41e-4ac9-b3f2-a9493d00ba97 - entryPoint: - type: string - enum: [devPortal, publisher] - commenterInfo: - $ref: '#/components/schemas/CommenterInfo' - replies: - $ref: '#/components/schemas/CommentList' - CommentList: - title: Comments List - type: object - properties: - count: - type: integer - description: | - Number of Comments returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Comment' - pagination: - $ref: '#/components/schemas/Pagination' - CommenterInfo: - type: object - properties: - firstName: - type: string - example: John - lastName: - type: string - example: David - fullName: - type: string - example: John David - APIList: - title: API List - type: object - properties: - count: - type: integer - description: | - Number of APIs returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APIInfo' - pagination: - $ref: '#/components/schemas/Pagination' - APIListExpanded: - title: API List - type: object - properties: - count: - type: integer - description: | - Number of APIs returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/API' - pagination: - $ref: '#/components/schemas/Pagination' - - APIInfo: - title: API Info object with basic API details. - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorAPI - description: - type: string - example: A calculator API that supports basic operations - context: - type: string - example: CalculatorAPI - version: - type: string - example: 1.0.0 - provider: - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - type: - type: string - example: HTTP - lifeCycleStatus: - type: string - example: CREATED - workflowStatus: - type: string - example: APPROVED - hasThumbnail: - type: boolean - example: true - securityScheme: - type: array - items: - type: string - - Topic: - title: Topic object - required: - - name - - mode - - description - type: object - properties: - id: - type: string - description: id - readOnly: true - example: 1222344 - name: - maxLength: 50 - minLength: 1 - pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+]*$)' - type: string - example: PizzaShackAPI - mode: - maxLength: 32766 - type: string - example: This is a simple API for Pizza Shack online pizza delivery store. - description: - maxLength: 32766 - type: string - example: This is a simple API for Pizza Shack online pizza delivery store. - TopicList: - title: Topic List - type: object - properties: - count: - type: integer - description: | - Number of Topics returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Topic' - pagination: - $ref: '#/components/schemas/Pagination' - API: - title: API object - required: - - context - - name - - version - type: object - properties: - id: - type: string - description: | - UUID of the api registry artifact - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - maxLength: 50 - minLength: 1 - pattern: '(^[^~!@#;:%^*()+={}|\\<>"'',&$\s+]*$)' - type: string - example: PizzaShackAPI - description: - maxLength: 32766 - type: string - example: This is a simple API for Pizza Shack online pizza delivery store. - context: - maxLength: 82 - minLength: 1 - type: string - example: pizza - version: - maxLength: 30 - minLength: 1 - type: string - pattern: '^[^~!@#;:%^*()+={}|\\<>"'',&/$]+$' - example: 1.0.0 - provider: - maxLength: 50 - type: string - description: | - If the provider value is not given user invoking the api will be used as the provider. - example: admin - lifeCycleStatus: - type: string - example: CREATED - x-otherScopes: - - apim:api_publish - wsdlInfo: - $ref: '#/components/schemas/WSDLInfo' - wsdlUrl: - type: string - readOnly: true - example: /apimgt/applicationdata/wsdls/admin--soap1.wsdl - testKey: - type: string - readOnly: true - example: 8swdwj9080edejhj - responseCachingEnabled: - type: boolean - example: true - cacheTimeout: - type: integer - example: 300 - destinationStatsEnabled: - type: string - example: Disabled - hasThumbnail: - type: boolean - example: false - isDefaultVersion: - type: boolean - example: false - isRevision: - type: boolean - example: false - revisionedApiId: - type: string - description: | - UUID of the api registry artifact - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - revisionId: - type: integer - example: 1 - enableSchemaValidation: - type: boolean - example: false - enableStore: - type: boolean - example: true - x-otherScopes: - - apim:api_publish - type: - type: string - description: The api creation type to be used. Accepted values are HTTP, - WS, SOAPTOREST, GRAPHQL, WEBSUB, SSE - example: HTTP - default: HTTP - enum: - - HTTP - - WS - - SOAPTOREST - - SOAP - - GRAPHQL - - WEBSUB - - SSE - transport: - type: array - description: | - Supported transports for the API (http and/or https). - example: - - http - - https - items: - type: string - tags: - type: array - example: - - pizza - - food - items: - type: string - x-otherScopes: - - apim:api_publish - policies: - type: array - example: - - Unlimited - items: - type: string - x-otherScopes: - - apim:api_publish - apiThrottlingPolicy: - type: string - description: The API level throttling policy selected for the particular - API - example: Unlimited - x-otherScopes: - - apim:api_publish - authorizationHeader: - type: string - description: | - Name of the Authorization header used for invoking the API. If it is not set, Authorization header name specified - in tenant or system level will be used. - example: Authorization - securityScheme: - type: array - description: | - Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If - it is not set OAuth2 will be set as the security for the current API. - example: - - oauth2 - items: - type: string - maxTps: - $ref: '#/components/schemas/APIMaxTps' - visibility: - type: string - description: The visibility level of the API. Accepts one of the following. - PUBLIC, PRIVATE, RESTRICTED. - example: PUBLIC - default: PUBLIC - enum: - - PUBLIC - - PRIVATE - - RESTRICTED - x-otherScopes: - - apim:api_publish - visibleRoles: - type: array - description: The user roles that are able to access the API in Developer Portal - example: [] - items: - type: string - x-otherScopes: - - apim:api_publish - visibleTenants: - type: array - example: [] - items: - type: string - endpointSecurity: - $ref: '#/components/schemas/APIEndpointSecurity' - gatewayEnvironments: - type: array - description: | - List of gateway environments the API is available - example: - - Production and Sandbox - items: - type: string - x-otherScopes: - - apim:api_publish - deploymentEnvironments: - type: array - description: | - List of selected deployment environments and clusters - items: - $ref: '#/components/schemas/DeploymentEnvironments' - x-otherScopes: - - apim:api_publish - labels: - type: array - description: | - Labels of micro-gateway environments attached to the API. - example: [] - items: - type: string - mediationPolicies: - type: array - example: - - name: json_to_xml_in_message - type: in - - name: xml_to_json_out_message - type: out - - name: json_fault - type: fault - items: - $ref: '#/components/schemas/MediationPolicy' - subscriptionAvailability: - type: string - description: The subscription availability. Accepts one of the following. - CURRENT_TENANT, ALL_TENANTS or SPECIFIC_TENANTS. - example: CURRENT_TENANT - default: CURRENT_TENANT - enum: - - CURRENT_TENANT - - ALL_TENANTS - - SPECIFIC_TENANTS - x-otherScopes: - - apim:api_publish - subscriptionAvailableTenants: - type: array - example: [] - items: - type: string - additionalProperties: - type: object - additionalProperties: - type: string - description: Map of custom properties of API - x-otherScopes: - - apim:api_publish - monetization: - $ref: '#/components/schemas/APIMonetizationInfo' - accessControl: - type: string - description: | - Is the API is restricted to certain set of publishers or creators or is it visible to all the - publishers and creators. If the accessControl restriction is none, this API can be modified by all the - publishers and creators, if not it can only be viewable/modifiable by certain set of publishers and creators, - based on the restriction. - default: NONE - enum: - - NONE - - RESTRICTED - accessControlRoles: - type: array - description: The user roles that are able to view/modify as API publisher - or creator. - example: [] - items: - type: string - businessInformation: - $ref: '#/components/schemas/APIBusinessInformation' - x-otherScopes: - - apim:api_publish - corsConfiguration: - $ref: '#/components/schemas/APICorsConfiguration' - websubSubscriptionConfiguration: - $ref: '#/components/schemas/WebsubSubscriptionConfiguration' - workflowStatus: - type: string - example: APPROVED - createdTime: - type: string - lastUpdatedTime: - type: string - x-otherScopes: - - apim:api_publish - endpointConfig: - type: object - properties: {} - description: | - Endpoint configuration of the API. This can be used to provide different types of endpoints including Simple REST Endpoints, Loadbalanced and Failover. - - `Simple REST Endpoint` - { - "endpoint_type": "http", - "sandbox_endpoints": { - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/" - }, - "production_endpoints": { - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/" - } - } - - `Loadbalanced Endpoint` - - { - "endpoint_type": "load_balance", - "algoCombo": "org.apache.synapse.endpoints.algorithms.RoundRobin", - "sessionManagement": "", - "sandbox_endpoints": [ - { - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/1" - }, - { - "endpoint_type": "http", - "template_not_supported": false, - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/2" - } - ], - "production_endpoints": [ - { - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/3" - }, - { - "endpoint_type": "http", - "template_not_supported": false, - "url": "https://localhost:9443/am/sample/pizzashack/v1/api/4" - } - ], - "sessionTimeOut": "", - "algoClassName": "org.apache.synapse.endpoints.algorithms.RoundRobin" - } - - `Failover Endpoint` - - { - "production_failovers":[ - { - "endpoint_type":"http", - "template_not_supported":false, - "url":"https://localhost:9443/am/sample/pizzashack/v1/api/1" - } - ], - "endpoint_type":"failover", - "sandbox_endpoints":{ - "url":"https://localhost:9443/am/sample/pizzashack/v1/api/2" - }, - "production_endpoints":{ - "url":"https://localhost:9443/am/sample/pizzashack/v1/api/3" - }, - "sandbox_failovers":[ - { - "endpoint_type":"http", - "template_not_supported":false, - "url":"https://localhost:9443/am/sample/pizzashack/v1/api/4" - } - ] - } - - `Default Endpoint` - - { - "endpoint_type":"default", - "sandbox_endpoints":{ - "url":"default" - }, - "production_endpoints":{ - "url":"default" - } - } - - `Endpoint from Endpoint Registry` - { - "endpoint_type": "Registry", - "endpoint_id": "{registry-name:entry-name:version}", - } - example: - endpoint_type: http - sandbox_endpoints: - url: https://localhost:9443/am/sample/pizzashack/v1/api/ - production_endpoints: - url: https://localhost:9443/am/sample/pizzashack/v1/api/ - endpointImplementationType: - type: string - example: INLINE - default: ENDPOINT - enum: - - INLINE - - ENDPOINT - scopes: - type: array - items: - $ref: '#/components/schemas/APIScope' - operations: - type: array - example: - - target: /order/{orderId} - verb: POST - authType: Application & Application User - throttlingPolicy: Unlimited - - target: /menu - verb: GET - authType: Application & Application User - throttlingPolicy: Unlimited - items: - $ref: '#/components/schemas/APIOperations' - threatProtectionPolicies: - type: object - properties: - list: - type: array - items: - type: object - properties: - policyId: - type: string - priority: - type: integer - categories: - type: array - description: | - API categories - items: - type: string - example: "" - x-otherScopes: - - apim:api_publish - keyManagers: - type: object - properties: {} - description: | - API Key Managers - readOnly: true - serviceInfo: - type: object - properties: - key: - type: string - example: PetStore-1.0.0 - name: - type: string - example: PetStore - version: - type: string - example: 1.0.0 - outdated: - type: boolean - example: false - x-scopes: - - apim:api_create - - apim:api_import_export - - #----------------------------------------------------- - # The API Revision resource - #----------------------------------------------------- - APIRevision: - title: API Info object with basic API details - properties: - displayName: - type: string - example: REVISION 1 - id: - type: string - example: c26b2b9b-4632-4ca4-b6f3-521c8863990c - description: - type: string - example: removed a post resource - createdTime: - type: string - format: date-time - apiInfo: - $ref: '#/components/schemas/APIRevisionAPIInfo' - deploymentInfo: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - - #----------------------------------------------------- - # The API Revision - API Info resource - #----------------------------------------------------- - APIRevisionAPIInfo: - title: API Info object with basic Revisioned API details - readOnly: true - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - - #----------------------------------------------------- - # The API Revision List resource - #----------------------------------------------------- - APIRevisionList: - title: API Revisions List - properties: - count: - type: integer - description: | - Number of API revisions returned - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APIRevision' - #----------------------------------------------------- - # The API Revision Deployment List resource - #----------------------------------------------------- - APIRevisionDeploymentList: - title: API Revision to Deployment mapped object with basic API deployment details - properties: - list: - type: array - items: - $ref: '#/components/schemas/APIRevisionDeployment' - #----------------------------------------------------- - # The API Revision Deployment resource - #----------------------------------------------------- - APIRevisionDeployment: - title: APIRevisionDeployment Info object with basic API deployment details - properties: - revisionUuid: - type: string - example: c26b2b9b-4632-4ca4-b6f3-521c8863990c - name: - type: string - example: default - vhost: - maxLength: 255 - minLength: 1 - # hostname regex as per RFC 1123 (http://tools.ietf.org/html/rfc1123) and appended * - pattern: '^(([a-zA-Z0-9]|[a-zA-Z0-9][a-zA-Z0-9\-]*[a-zA-Z0-9])\.)*([A-Za-z0-9]|[A-Za-z0-9][A-Za-z0-9\-]*[A-Za-z0-9])$' - type: string - example: mg.wso2.com - displayOnDevportal: - type: boolean - example: true - deployedTime: - type: string - format: date-time - - AuditReport: - title: Resource for Audit Report - type: object - properties: - report: - type: string - description: | - The API Security Audit Report - grade: - type: string - description: | - The overall grade of the Security Audit - example: "27.95" - numErrors: - type: integer - description: | - The number of errors in the API Definition - example: 20 - externalApiId: - type: string - description: | - The External API ID - example: fd21f9f7-3674-49cf-8a83-dca401f635de - APIProductList: - title: API Product List - type: object - properties: - count: - type: integer - description: | - Number of API Products returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APIProductInfo' - pagination: - $ref: '#/components/schemas/Pagination' - APIProductInfo: - title: API Info object with basic API details. - type: object - properties: - id: - type: string - description: | - UUID of the api product - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - description: Name of the API Product - example: PizzaShackAPIProduct - context: - type: string - example: pizzaproduct - description: - type: string - description: A brief description about the API - example: This is a simple API for Pizza Shack online pizza delivery store - provider: - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - hasThumbnail: - type: boolean - example: true - state: - type: string - description: | - State of the API product. Only published api products are visible on the Developer Portal - enum: - - CREATED - - PUBLISHED - securityScheme: - type: array - description: | - Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If - it is not set OAuth2 will be set as the security for the current API. - example: - - oauth2 - items: - type: string - APIProduct: - title: API Product object - required: - - name - type: object - properties: - id: - type: string - description: | - UUID of the api product - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - maxLength: 50 - minLength: 1 - type: string - description: Name of the API Product - example: PizzaShackAPIProduct - context: - maxLength: 60 - minLength: 1 - type: string - example: pizzaproduct - description: - type: string - description: A brief description about the API - example: This is a simple API for Pizza Shack online pizza delivery store - provider: - maxLength: 50 - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - hasThumbnail: - type: boolean - example: false - state: - type: string - description: | - State of the API product. Only published api products are visible on the Developer Portal - enum: - - CREATED - - PUBLISHED - enableSchemaValidation: - type: boolean - example: false - enableStore: - type: boolean - example: true - testKey: - type: string - readOnly: true - example: 8swdwj9080edejhj - isRevision: - type: boolean - example: false - revisionedApiProductId: - type: string - description: | - UUID of the api product registry artifact - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - revisionId: - type: integer - example: 1 - responseCachingEnabled: - type: boolean - example: true - cacheTimeout: - type: integer - example: 300 - visibility: - type: string - description: The visibility level of the API. Accepts one of the following. - PUBLIC, PRIVATE, RESTRICTED. - example: PUBLIC - default: PUBLIC - enum: - - PUBLIC - - PRIVATE - - RESTRICTED - visibleRoles: - type: array - description: The user roles that are able to access the API - example: [] - items: - type: string - visibleTenants: - type: array - example: [] - items: - type: string - accessControl: - type: string - description: | - Defines whether the API Product is restricted to certain set of publishers or creators or is it visible to all the - publishers and creators. If the accessControl restriction is none, this API Product can be modified by all the - publishers and creators, if not it can only be viewable/modifiable by certain set of publishers and creators, - based on the restriction. - default: NONE - enum: - - NONE - - RESTRICTED - accessControlRoles: - type: array - description: The user roles that are able to view/modify as API Product - publisher or creator. - example: [] - items: - type: string - gatewayEnvironments: - type: array - description: | - List of gateway environments the API Product is available - example: - - Production and Sandbox - items: - type: string - apiType: - type: string - description: The API type to be used. Accepted values are API, APIPRODUCT - example: APIPRODUCT - enum: - - API - - APIPRODUCT - transport: - type: array - description: | - Supported transports for the API (http and/or https). - example: - - http - - https - items: - type: string - tags: - type: array - example: - - pizza - - food - items: - type: string - policies: - type: array - example: - - Unlimited - items: - type: string - apiThrottlingPolicy: - type: string - description: The API level throttling policy selected for the particular - API Product - example: Unlimited - authorizationHeader: - type: string - description: | - Name of the Authorization header used for invoking the API. If it is not set, Authorization header name specified - in tenant or system level will be used. - example: Authorization - securityScheme: - type: array - description: | - Types of API security, the current API secured with. It can be either OAuth2 or mutual SSL or both. If - it is not set OAuth2 will be set as the security for the current API. - example: - - oauth2 - items: - type: string - subscriptionAvailability: - type: string - description: The subscription availability. Accepts one of the following. - CURRENT_TENANT, ALL_TENANTS or SPECIFIC_TENANTS. - example: CURRENT_TENANT - default: ALL_TENANTS - enum: - - CURRENT_TENANT - - ALL_TENANTS - - SPECIFIC_TENANTS - subscriptionAvailableTenants: - type: array - example: [] - items: - type: string - x-otherScopes: - - apim:api_publish - additionalProperties: - type: object - additionalProperties: - type: string - description: Map of custom properties of API - monetization: - $ref: '#/components/schemas/APIMonetizationInfo' - businessInformation: - $ref: '#/components/schemas/APIProductBusinessInformation' - corsConfiguration: - $ref: '#/components/schemas/APICorsConfiguration' - createdTime: - type: string - lastUpdatedTime: - type: string - apis: - type: array - description: | - APIs and resources in the API Product. - example: - - name: PizzaShackAPI - apiId: 01234567-0123-0123-0123-012345678901 - version: "1.0" - operations: - - target: /order/{orderId} - verb: POST - authType: Application & Application User - throttlingPolicy: Unlimited - - target: /menu - verb: GET - authType: Application & Application User - throttlingPolicy: Unlimited - items: - $ref: '#/components/schemas/ProductAPI' - scopes: - type: array - example: [] - items: - $ref: '#/components/schemas/APIScope' - categories: - type: array - description: | - API categories - example: [] - items: - type: string - ProductAPI: - title: ProductAPI - required: - - apiId - type: object - properties: - name: - type: string - example: PizzaShackAPI - apiId: - type: string - example: 01234567-0123-0123-0123-012345678901 - version: - type: string - example: "1.0" - operations: - type: array - items: - $ref: '#/components/schemas/APIOperations' - ResourcePath: - title: ResourcePath - required: - - id - type: object - properties: - id: - type: integer - example: 1 - resourcePath: - type: string - example: /menu - httpVerb: - type: string - example: GET - ResourcePathList: - title: ResourcePath List - type: object - properties: - count: - type: integer - description: | - Number of API Resource Paths returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/ResourcePath' - pagination: - $ref: '#/components/schemas/Pagination' - APIProductOutdatedStatus: - title: APIProduct is outdated status - type: object - properties: - isOutdated: - type: boolean - description: | - Indicates if an API Product is outdated - example: true - APIProductBusinessInformation: - type: object - properties: - businessOwner: - maxLength: 120 - type: string - example: businessowner - businessOwnerEmail: - type: string - example: businessowner@wso2.com - technicalOwner: - maxLength: 120 - type: string - example: technicalowner - technicalOwnerEmail: - type: string - example: technicalowner@wso2.com - Claim: - title: Claim - type: object - properties: - name: - type: string - example: email - URI: - type: string - example: http://wso2.org/claims/emailaddress - value: - type: string - example: admin@wso2.com - SubscriberInfo: - title: SubscriberInfo - type: object - properties: - name: - type: string - example: admin - claims: - type: array - items: - $ref: '#/components/schemas/Claim' - Application: - title: Application - required: - - name - - throttlingTier - type: object - properties: - applicationId: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorApp - subscriber: - type: string - example: admin - throttlingTier: - type: string - example: Unlimited - description: - type: string - example: Sample calculator application - groupId: - type: string - example: "" - ApplicationInfo: - title: Application info object with basic application details - type: object - properties: - applicationId: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorApp - subscriber: - type: string - example: admin - description: - type: string - example: Sample calculator application - subscriptionCount: - type: integer - DocumentList: - title: Document List - type: object - properties: - count: - type: integer - description: | - Number of Documents returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Document' - pagination: - $ref: '#/components/schemas/Pagination' - Document: - title: Document - required: - - name - - sourceType - - type - - visibility - type: object - properties: - documentId: - type: string - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - maxLength: 60 - minLength: 1 - type: string - example: PizzaShackDoc - type: - type: string - example: HOWTO - enum: - - HOWTO - - SAMPLES - - PUBLIC_FORUM - - SUPPORT_FORUM - - API_MESSAGE_FORMAT - - SWAGGER_DOC - - OTHER - summary: - maxLength: 32766 - minLength: 1 - type: string - example: Summary of PizzaShackAPI Documentation - sourceType: - type: string - example: INLINE - enum: - - INLINE - - MARKDOWN - - URL - - FILE - sourceUrl: - type: string - readOnly: true - example: "" - fileName: - type: string - readOnly: true - example: "" - inlineContent: - type: string - example: This is doc content. This can have many lines. - otherTypeName: - type: string - readOnly: true - example: "" - visibility: - type: string - example: API_LEVEL - enum: - - OWNER_ONLY - - PRIVATE - - API_LEVEL - createdTime: - type: string - readOnly: true - createdBy: - type: string - example: admin - lastUpdatedTime: - type: string - readOnly: true - lastUpdatedBy: - type: string - readOnly: true - example: admin - GraphQLSchema: - title: GraphQL Schema - required: - - name - type: object - properties: - name: - type: string - example: admin--HackerNewsAPI.graphql - schemaDefinition: - type: string - GraphQLQueryComplexityInfo: - title: GraphQL Query Complexity Info - type: object - properties: - list: - type: array - items: - $ref: '#/components/schemas/GraphQLCustomComplexityInfo' - GraphQLCustomComplexityInfo: - title: GraphQL Custom Complexity Info - required: - - complexityValue - - field - - type - type: object - properties: - type: - type: string - description: | - The type found within the schema of the API - example: Country - field: - type: string - description: | - The field which is found under the type within the schema of the API - example: name - complexityValue: - type: integer - description: | - The complexity value allocated for the associated field under the specified type - example: 1 - GraphQLSchemaTypeList: - title: List of types and corresponding fields of the GraphQL Schema - type: object - properties: - typeList: - type: array - items: - $ref: '#/components/schemas/GraphQLSchemaType' - GraphQLSchemaType: - title: Single type and corresponding fields found within the GraphQL Schema - type: object - properties: - type: - type: string - description: | - Type found within the GraphQL Schema - example: Country - fieldList: - type: array - description: | - Array of fields under current type - example: - - code - - name - items: - type: string - MediationList: - title: Mediation List - type: object - properties: - count: - type: integer - description: | - Number of mediation sequences returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/MediationInfo' - pagination: - $ref: '#/components/schemas/Pagination' - MediationInfo: - title: MediationInfo - required: - - id - - name - - type - type: object - properties: - name: - type: string - example: json_fault.xml - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - type: - type: string - example: in - enum: - - in - - out - - fault - Mediation: - title: Mediation - required: - - name - - type - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: json_fault.xml - type: - type: string - example: in - enum: - - in - - out - - fault - ThrottlingPolicyList: - title: Throttling policy list - type: object - properties: - count: - type: integer - description: | - Number of Tiers returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/ThrottlingPolicy' - pagination: - $ref: '#/components/schemas/Pagination' - ThrottlingPolicy: - title: Tier - required: - - name - - requestCount - - stopOnQuotaReach - - tierPlan - - unitTime - type: object - properties: - name: - type: string - example: Platinum - description: - type: string - example: Allows 50 request(s) per minute. - policyLevel: - type: string - example: api - enum: - - subscription - - api - displayName: - type: string - example: Platinum - attributes: - type: object - additionalProperties: - type: string - description: | - Custom attributes added to the policy policy - example: {} - requestCount: - type: integer - description: | - Maximum number of requests which can be sent within a provided unit time - format: int64 - example: 50 - dataUnit: - description: | - Unit of data allowed to be transfered. Allowed values are "KB", "MB" and "GB" - type: string - example: KB - unitTime: - type: integer - format: int64 - example: 60000 - timeUnit: - type: string - example: min - rateLimitCount: - type: integer - default: 0 - description: Burst control request count - example: 10 - rateLimitTimeUnit: - type: string - description: Burst control time unit - example: min - quotaPolicyType: - type: string - description: Default quota limit type - enum: - - REQUESTCOUNT - - BANDWIDTHVOLUME - example: REQUESTCOUNT - tierPlan: - type: string - description: | - This attribute declares whether this policy is available under commercial or free - example: FREE - enum: - - FREE - - COMMERCIAL - stopOnQuotaReach: - type: boolean - description: | - By making this attribute to false, you are capabale of sending requests - even if the request count exceeded within a unit time - example: true - monetizationProperties: - type: object - additionalProperties: - type: string - description: Properties of a tier plan which are related to monetization - example: {} - SubscriptionList: - title: Subscription List - type: object - properties: - count: - type: integer - description: | - Number of Subscriptions returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Subscription' - pagination: - $ref: '#/components/schemas/Pagination' - Subscription: - title: Subscription - required: - - applicationInfo - - subscriptionId - - subscriptionStatus - - throttlingPolicy - type: object - properties: - subscriptionId: - type: string - example: 01234567-0123-0123-0123-012345678901 - applicationInfo: - $ref: '#/components/schemas/ApplicationInfo' - throttlingPolicy: - type: string - example: Unlimited - subscriptionStatus: - type: string - example: BLOCKED - enum: - - BLOCKED - - PROD_ONLY_BLOCKED - - UNBLOCKED - - ON_HOLD - - REJECTED - - TIER_UPDATE_PENDING - APIMonetizationUsage: - title: API monetization usage object - type: object - properties: - properties: - type: object - additionalProperties: - type: string - description: Map of custom properties related to monetization usage - APIRevenue: - title: API revenue data object - type: object - properties: - properties: - type: object - additionalProperties: - type: string - description: Map of custom properties related to API revenue - MediationPolicy: - title: Mediation Policy - required: - - name - type: object - properties: - id: - type: string - example: 69ea3fa6-55c6-472e-896d-e449dd34a824 - name: - type: string - example: log_in_message - type: - type: string - example: in - shared: - type: boolean - example: true - Error: - title: Error object returned with 4XX HTTP Status - required: - - code - - message - type: object - properties: - code: - type: integer - format: int64 - message: - type: string - description: Error message. - description: - type: string - description: | - A detail description about the error message. - moreInfo: - type: string - description: | - Preferably an url with more details about the error. - error: - type: array - description: | - If there are more than one error list them out. - For example, list out validation errors by each field. - items: - $ref: '#/components/schemas/ErrorListItem' - ErrorListItem: - title: Description of individual errors that may have occurred during a request. - required: - - code - - message - type: object - properties: - code: - type: string - message: - type: string - description: | - Description about individual errors occurred - description: - type: string - description: | - A detail description about the error message. - Environment: - title: Environment - required: - - endpoints - - name - - serverUrl - - showInApiConsole - - type - type: object - properties: - name: - type: string - example: default - displayName: - type: string - example: Default - type: - type: string - example: hybrid - serverUrl: - type: string - example: https://localhost:9443/services/ - showInApiConsole: - type: boolean - example: true - endpoints: - $ref: '#/components/schemas/EnvironmentEndpoints' - vhosts: - type: array - items: - $ref: '#/components/schemas/VHost' - EnvironmentList: - title: Environment List - type: object - properties: - count: - type: integer - description: | - Number of Environments returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Environment' - EnvironmentEndpoints: - title: Environment Endpoints - type: object - properties: - http: - type: string - description: HTTP environment URL - example: http://localhost:8280 - https: - type: string - description: HTTPS environment URL - example: https://localhost:8243 - ws: - type: string - description: WS environment URL - example: http://localhost:9099 - wss: - type: string - description: WSS environment URL - example: https://localhost:8099 - VHost: - title: Virtual Host - type: object - properties: - host: - type: string - example: mg.wso2.com - httpContext: - type: string - example: pets - httpPort: - type: integer - example: 80 - httpsPort: - type: integer - example: 443 - wsPort: - type: integer - example: 9099 - wssPort: - type: integer - example: 8099 - FileInfo: - title: File Information including meta data - type: object - properties: - relativePath: - type: string - description: relative location of the file (excluding the base context and - host of the Publisher API) - example: apis/01234567-0123-0123-0123-012345678901/thumbnail - mediaType: - type: string - description: media-type of the file - example: image/jpeg - APIMaxTps: - type: object - properties: - production: - type: integer - format: int64 - example: 1000 - sandbox: - type: integer - format: int64 - example: 1000 - APIEndpointSecurity: - type: object - properties: - type: - type: string - description: Accepts one of the following, basic or digest. - example: BASIC - enum: - - BASIC - - DIGEST - username: - type: string - example: admin - password: - type: string - example: password - APIBusinessInformation: - type: object - properties: - businessOwner: - maxLength: 120 - type: string - example: businessowner - businessOwnerEmail: - type: string - example: businessowner@wso2.com - pattern: '^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$' - technicalOwner: - maxLength: 120 - type: string - example: technicalowner - technicalOwnerEmail: - type: string - example: technicalowner@wso2.com - - WebsubSubscriptionConfiguration: - type: object - properties: - secret: - type: string - description: Secret key to be used for subscription - signingAlgorithm: - type: string - description: The algorithm used for signing - signatureHeader: - type: string - description: The header uses to send the signature - - APICorsConfiguration: - type: object - properties: - corsConfigurationEnabled: - type: boolean - default: false - accessControlAllowOrigins: - type: array - items: - type: string - accessControlAllowCredentials: - type: boolean - default: false - accessControlAllowHeaders: - type: array - items: - type: string - accessControlAllowMethods: - type: array - items: - type: string - description: | - CORS configuration for the API - Endpoint: - title: Endpoints - type: object - properties: - id: - type: string - description: | - UUID of the Endpoint entry - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - description: | - name of the Endpoint entry - example: Endpoint 1 - endpointConfig: - type: object - properties: - endpointType: - type: string - example: FAIL_OVER - enum: - - SINGLE - - LOAD_BALANCED - - FAIL_OVER - list: - type: array - items: - $ref: '#/components/schemas/EndpointConfig' - endpointSecurity: - type: object - properties: - enabled: - type: boolean - example: false - type: - type: string - example: basic - username: - type: string - example: basic - password: - type: string - example: basic - maxTps: - type: integer - description: Endpoint max tps - format: int64 - example: 1000 - type: - type: string - example: http - EndpointConfig: - title: Endpoint Configuration - type: object - properties: - url: - type: string - description: | - Service url of the endpoint - example: http://localhost:8280 - timeout: - type: string - description: | - Time out of the endpoint - example: "1000" - attributes: - type: array - items: - type: object - properties: - name: - type: string - example: Suspension time - value: - type: string - example: 2s - EndpointList: - title: Endpoint List - type: object - properties: - count: - type: integer - description: | - Number of Endpoints returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Endpoint' - Scope: - title: Scope - required: - - name - type: object - properties: - id: - type: string - description: | - UUID of the Scope. Valid only for shared scopes. - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - name: - maxLength: 255 - minLength: 1 - type: string - description: | - name of Scope - example: apim:api_view - displayName: - maxLength: 255 - type: string - description: | - display name of Scope - example: api_view - description: - maxLength: 512 - type: string - description: | - description of Scope - example: This Scope can used to view Apis - bindings: - type: array - description: | - role bindings list of the Scope - example: - - admin - - Internal/creator - - Internal/publisher - items: - type: string - usageCount: - type: integer - description: | - usage count of Scope - readOnly: true - example: 3 - SharedScopeUsage: - title: SharedScopeUsage - required: - - id - - name - type: object - properties: - id: - type: string - description: | - UUID of the Scope. Valid only for shared scopes. - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - description: | - name of Scope - example: apim:api_view - usedApiList: - type: array - description: | - API list which have used the shared scope - items: - $ref: '#/components/schemas/SharedScopeUsedAPIInfo' - SharedScopeUsedAPIInfo: - title: API object using shared scope - required: - - context - - name - - version - type: object - properties: - name: - type: string - example: CalculatorAPI - context: - type: string - example: CalculatorAPI - version: - type: string - example: 1.0.0 - provider: - type: string - description: | - If the provider value is not given user invoking the api will be used as the provider. - example: admin - usedResourceList: - type: array - description: | - Resource list which have used the shared scope within this API - items: - $ref: '#/components/schemas/SharedScopeUsedAPIResourceInfo' - SharedScopeUsedAPIResourceInfo: - title: API resource object using shared scope - type: object - properties: - target: - type: string - example: /add - verb: - type: string - example: POST - APIScope: - title: APIScope - required: - - scope - type: object - properties: - scope: - $ref: '#/components/schemas/Scope' - shared: - type: boolean - description: | - States whether scope is shared. This will not be honored when updating/adding scopes to APIs or when - adding/updating Shared Scopes. - example: true - APIOperations: - title: Operation - type: object - properties: - id: - type: string - example: postapiresource - target: - type: string - example: /order/{orderId} - verb: - type: string - example: POST - authType: - type: string - example: Application & Application User - default: Any - throttlingPolicy: - type: string - example: Unlimited - scopes: - type: array - example: [] - items: - type: string - usedProductIds: - type: array - example: [] - items: - type: string - amznResourceName: - type: string - example: "" - amznResourceTimeout: - type: integer - payloadSchema: - type: string - example: "" - uriMapping: - type: string - example: "" - ScopeList: - title: Scope List - type: object - properties: - count: - type: integer - description: | - Number of Scopes returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Scope' - pagination: - $ref: '#/components/schemas/Pagination' - ExternalStore: - title: External Store - type: object - properties: - id: - type: string - description: | - The external store identifier, which is a unique value. - example: Store123# - displayName: - type: string - description: | - The name of the external API Store that is displayed in the Publisher UI. - example: UKStore - type: - type: string - description: | - The type of the Store. This can be a WSO2-specific API Store or an external one. - example: wso2 - endpoint: - type: string - description: | - The endpoint URL of the external store - example: http://localhost:9764/store - APIExternalStore: - title: API External Store - type: object - properties: - id: - type: string - description: | - The external store identifier, which is a unique value. - example: Store123# - lastUpdatedTime: - type: string - description: | - The recent timestamp which a given API is updated in the external store. - example: 2019-09-09T13:57:16.229 - APIExternalStoreList: - title: API External Store List - type: object - properties: - count: - type: integer - description: | - Number of external stores returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APIExternalStore' - ExternalStoreList: - title: External Store List - type: object - properties: - count: - type: integer - description: | - Number of external stores returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/ExternalStore' - Certificates: - title: Certificates - type: object - properties: - count: - type: integer - example: 1 - certificates: - type: array - items: - $ref: '#/components/schemas/CertMetadata' - pagination: - $ref: '#/components/schemas/Pagination' - description: Representation of a list of certificates - CertMetadata: - title: Certificate - type: object - properties: - alias: - type: string - example: wso2carbon - endpoint: - type: string - example: www.abc.com - description: Representation of the details of a certificate - CertificateInfo: - title: Certificate information - type: object - properties: - status: - type: string - example: Active - validity: - $ref: '#/components/schemas/CertificateValidity' - version: - type: string - example: V3 - subject: - type: string - example: CN=wso2.com, OU=wso2, O=wso2, L=Colombo, ST=Western, C=LK - CertificateValidity: - title: Certificate Valid period - type: object - properties: - from: - type: string - example: 12-12-2017 - to: - type: string - example: 01-01-2019 - ClientCertificates: - title: Client Certificates - type: object - properties: - count: - type: integer - example: 1 - certificates: - type: array - items: - $ref: '#/components/schemas/ClientCertMetadata' - pagination: - $ref: '#/components/schemas/Pagination' - description: Representation of a list of client certificates - ClientCertMetadata: - title: Client certificate meta data - type: object - properties: - alias: - type: string - example: wso2carbon - apiId: - type: string - example: 64eca60b-2e55-4c38-8603-e9e6bad7d809 - tier: - type: string - example: Gold - description: Meta data of certificate - Label: - title: Label - required: - - name - type: object - properties: - name: - type: string - example: marketing_store - description: - type: string - example: Public microgateway for marketing - access_urls: - type: array - example: https://localhost:9095 - items: - type: string - LabelList: - title: Label List - type: object - properties: - count: - type: integer - description: | - Number of Labels returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Label' - pagination: - $ref: '#/components/schemas/Pagination' - LifecycleState: - title: Lifecycle State - type: object - properties: - state: - type: string - example: Created - checkItems: - type: array - items: - type: object - properties: - name: - type: string - example: Deprecate old versions after publishing the API - value: - type: boolean - example: false - requiredStates: - type: array - example: [] - items: - type: string - availableTransitions: - type: array - items: - type: object - properties: - event: - type: string - example: Publish - targetState: - type: string - example: Published - LifecycleHistory: - title: Lifecycle history item list - type: object - properties: - count: - type: integer - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/LifecycleHistoryItem' - LifecycleHistoryItem: - title: Lifecycle history item - type: object - properties: - previousState: - type: string - example: Created - postState: - type: string - example: Published - user: - type: string - example: admin - updatedTime: - type: string - format: dateTime - example: 2019-02-31T23:59:60Z - WorkflowResponse: - title: workflow Response - required: - - workflowStatus - type: object - properties: - workflowStatus: - type: string - description: | - This attribute declares whether this workflow task is approved or rejected. - example: APPROVED - enum: - - CREATED - - APPROVED - - REJECTED - - REGISTERED - jsonPayload: - type: string - description: | - Attributes that returned after the workflow execution - example: null - lifecycleState: - $ref: '#/components/schemas/LifecycleState' - OpenAPIDefinitionValidationResponse: - title: OpenAPI Definition Validation Response - required: - - isValid - type: object - properties: - isValid: - type: boolean - description: | - This attribute declares whether this definition is valid or not. - example: true - content: - type: string - description: | - OpenAPI definition content. - info: - type: object - properties: - name: - type: string - example: PetStore - version: - type: string - example: 1.0.0 - context: - type: string - example: /petstore - description: - type: string - example: A sample API that uses a petstore as an example to demonstrate - swagger-2.0 specification - openAPIVersion: - type: string - example: 3.0.0 - endpoints: - type: array - description: | - contains host/servers specified in the OpenAPI file/URL - items: - type: string - example: https://localhost:9443/am/sample/pizzashack/v1/api/ - description: | - API definition information - errors: - type: array - description: | - If there are more than one error list them out. - For example, list out validation errors by each field. - items: - $ref: '#/components/schemas/ErrorListItem' - WSDLValidationResponse: - title: WSDL Definition Validation Response - required: - - isValid - type: object - properties: - isValid: - type: boolean - description: | - This attribute declares whether this definition is valid or not. - example: true - errors: - type: array - description: | - If there are more than one error list them out. - For example, list out validation errors by each field. - items: - $ref: '#/components/schemas/ErrorListItem' - wsdlInfo: - type: object - properties: - version: - type: string - description: | - WSDL version - example: "1.1" - endpoints: - type: array - description: | - A list of endpoints the service exposes - items: - type: object - properties: - name: - type: string - description: Name of the endpoint - example: StockQuoteSoap - location: - type: string - description: Endpoint URL - example: http://www.webservicex.net/stockquote.asmx - description: Summary of the WSDL including the basic information - GraphQLValidationResponse: - title: GraphQL API definition validation Response - required: - - errorMessage - - isValid - type: object - properties: - isValid: - type: boolean - description: | - This attribute declares whether this definition is valid or not. - example: true - errorMessage: - type: string description: | - This attribute declares the validation error message - graphQLInfo: - type: object - properties: - operations: - type: array - items: - $ref: '#/components/schemas/APIOperations' - graphQLSchema: - $ref: '#/components/schemas/GraphQLSchema' - description: Summary of the GraphQL including the basic information - ApiEndpointValidationResponse: - title: API Endpoint url validation response - required: - - statusCode - - statusMessage - type: object - properties: - statusCode: - type: integer - description: HTTP status code - example: 200 - statusMessage: - type: string - description: string - example: OK - error: - type: string - description: | - If an error occurs, the error message will be set to this property. - If not, this will remain null. - example: null - ThreatProtectionPolicyList: - title: Threat Protection Policy List - type: object - properties: - list: - type: array - items: - $ref: '#/components/schemas/ThreatProtectionPolicy' - ThreatProtectionPolicy: - title: Threat Protection Policy Schema - required: - - name - - policy - - type - type: object - properties: - uuid: - type: string - description: Policy ID - name: - type: string - description: Name of the policy - type: - type: string - description: Type of the policy - policy: - type: string - description: policy as a json string - SearchResultList: - title: Unified Search Result List - type: object - properties: - count: - type: integer - description: | - Number of results returned. - example: 1 - list: - type: array - items: - type: object - pagination: - $ref: '#/components/schemas/Pagination' - SearchResult: - title: Search Result - required: - - name - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: TestAPI - type: - type: string - example: API - enum: - - DOC - - API - - APIProduct - transportType: - type: string - description: Accepted values are HTTP, WS, SOAPTOREST, GRAPHQL - discriminator: - propertyName: name - APISearchResult: - title: API Result - allOf: - - $ref: '#/components/schemas/SearchResult' - - type: object - properties: - description: - type: string - description: A brief description about the API - example: A calculator API that supports basic operations - context: - type: string - description: A string that represents the context of the user's request - example: CalculatorAPI - version: - type: string - description: The version of the API - example: 1.0.0 - provider: - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - status: - type: string - description: This describes in which status of the lifecycle the API is - example: CREATED - thumbnailUri: - type: string - example: /apis/01234567-0123-0123-0123-012345678901/thumbnail - APIProductSearchResult: - title: API Result - allOf: - - $ref: '#/components/schemas/SearchResult' - - type: object - properties: - description: - type: string - description: A brief description about the API - example: A calculator API that supports basic operations - context: - type: string - description: A string that represents the context of the user's request - example: CalculatorAPI - version: - type: string - description: The version of the API Product - example: 1.0.0 - provider: - type: string - description: | - If the provider value is not given, the user invoking the API will be used as the provider. - example: admin - status: - type: string - description: This describes in which status of the lifecycle the APIPRODUCT - is - example: PUBLISHED - thumbnailUri: - type: string - example: /apis/01234567-0123-0123-0123-012345678901/thumbnail - APIMonetizationInfo: - title: API monetization object - required: - - enabled - type: object - properties: - enabled: - type: boolean - description: Flag to indicate the monetization status - example: true + Not Found. + Workflow for the given reference in not found. + schema: + $ref: '#/definitions/Error' +###################################################### +# Parameters - required by some of the APIs above +###################################################### +parameters: + +# API Identifier +# Specified as part of the path expression + apiId: + name: apiId + in: path + description: | + **API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. + The combination of the provider of the API, name of the API and the version is also accepted as a valid API ID. + Should be formatted as **provider-name-version**. + required: true + type: string + x-encoded: true + +# API Identifier +# Specified as part of the query string + apiId-Q: + name: apiId + in: query + description: | + **API ID** consisting of the **UUID** of the API. Using the **UUID** in the API call is recommended. + The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. + Should be formatted as **provider-name-version**. + required: true + type: string + x-encoded: true + + +# Document Identifier +# Specified as part of the path expression + documentId: + name: documentId + in: path + description: | + Document Identifier + required: true + type: string + +# Application Identifier +# Specified as part of the path expression + applicationId: + name: applicationId + in: path + description: | + **Application Identifier** consisting of the UUID of the Application. + required: true + type: string + +# Subscription Identifier +# Specified as part of the path expression + subscriptionId: + name: subscriptionId + in: path + description: | + Subscription Id + required: true + type: string + +# Mediation policy identifier +# Specified as part of the path expression + mediationPolicyId: + name: mediationPolicyId + in: path + description: | + Mediation policy Id + required: true + type: string + + + +# Subscription Identifier +# Specified as part of the query string + subscriptionId-Q: + name: subscriptionId + in: query + description: | + Subscription Id + required: true + type: string + +# Tier Name +# Specified as part of the path expression + tierName: + name: tierName + in: path + description: | + Tier name + required: true + type: string + +# Tier Name +# Specified as part of the query string + tierName-Q: + name: tierName + in: query + description: | + Name of the tier + required: true + type: string + +# Tier Type +# Specified as part of the path expression + tierLevel: + name: tierLevel + in: path + description: | + List API or Application or Resource type tiers. + type: string + enum: + - api + - application + - resource + required: true + +# Tier Type +# Specified as part of the path expression + tierLevel-A: + name: tierLevel + in: path + description: | + List API or Application or Resource type tiers. + type: string + enum: + - api + required: true + +# Tier Type +# Specified as part of the query string + tierLevel-Q: + name: tierLevel + in: query + description: | + List API or Application or Resource type tiers. + type: string + enum: + - api + - application + - resource + required: true + +# Used for pagination: +# The maximum number of resoures to be returned by a GET + limit: + name: limit + in: query + description: | + Maximum length of resource array to return. + default: 25 + type: integer + +# Used for pagination: +# The order number of an instance in a qualified set of resoures +# at which to start to return the next batch of qualified resources + offset: + name: offset + in: query + description: | + Starting point within the complete list of items qualified. + default: 0 + type: integer + +# The HTTP Accept header + Accept: + name: Accept + in: header + description: | + Media types acceptable for the response. Default is application/json. + default: application/json + type: string + +# The HTTP Content-Type header + Content-Type: + name: Content-Type + in: header + description: | + Media type of the entity in the body. Default is application/json. + default: application/json + required: true + type : string + +# The HTTP Authorization header + Authorization: + name: Authorization + in: header + description: | + Holds the bearer token for apis that require authentication. + required: true + type : string + +# The HTTP If-None-Match header +# Used to avoid retrieving data that are already cached + If-None-Match: + name: If-None-Match + in: header + description: | + Validator for conditional requests; based on the ETag of the formerly retrieved + variant of the resource (Will be supported in future). + type : string + +# The HTTP If-Modified-Since header +# Used to avoid retrieving data that are already cached + If-Modified-Since: + name: If-Modified-Since + in: header + description: | + Validator for conditional requests; based on Last Modified header of the + formerly retrieved variant of the resource (Will be supported in future). + type: string + +# The HTTP If-Match header +# Used to avoid concurrent updates + If-Match: + name: If-Match + in: header + description: | + Validator for conditional requests; based on ETag (Will be supported in future). + type: string + +# The HTTP If-Unmodified-Since header +# Used to avoid concurrent updates + If-Unmodified-Since: + name: If-Unmodified-Since + in: header + description: | + Validator for conditional requests; based on Last Modified header (Will be supported in future). + type: string + + +# Workflow reference ID +# Specified as part of the path expression + workflowReferenceId-Q: + name: workflowReferenceId + in: query + description: | + Workflow reference id + required: true + type: string + +###################################################### +# The resources used by some of the APIs above within the message body +###################################################### +definitions: + +#----------------------------------------------------- +# The API List resource +#----------------------------------------------------- + APIList: + title: API List + properties: + count: + type: integer + description: | + Number of APIs returned. + example: 1 + next: + type: string + description: | + Link to the next subset of resources qualified. + Empty if no more resources are to be returned. + example: "/apis?limit=1&offset=2&query=" + previous: + type: string + description: | + Link to the previous subset of resources qualified. + Empty if current subset is the first subset returned. + example: "/apis?limit=1&offset=0&query=" + list: + type: array + items: + $ref: '#/definitions/APIInfo' + pagination: properties: - type: object - additionalProperties: - type: string - description: Map of custom properties related to monetization - DocumentSearchResult: - title: Document Result - allOf: - - $ref: '#/components/schemas/SearchResult' - - type: object - properties: - docType: - type: string - example: HOWTO - enum: - - HOWTO - - SAMPLES - - PUBLIC_FORUM - - SUPPORT_FORUM - - API_MESSAGE_FORMAT - - SWAGGER_DOC - - OTHER - summary: - type: string - example: Summary of Calculator Documentation - sourceType: - type: string - example: INLINE - enum: - - INLINE - - URL - - FILE - sourceUrl: - type: string - example: "" - otherTypeName: - type: string - example: "" - visibility: - type: string - example: API_LEVEL - enum: - - OWNER_ONLY - - PRIVATE - - API_LEVEL - apiName: - type: string - description: The name of the associated API - example: TestAPI - apiVersion: - type: string - description: The version of the associated API - example: 1.0.0 - apiProvider: - type: string - example: admin - apiUUID: - type: string - associatedType: - type: string - MockResponsePayloadList: - title: Mock Response Payload list - type: object - properties: - list: - type: array - items: - $ref: '#/components/schemas/MockResponsePayloadInfo' - MockResponsePayloadInfo: - title: Mock Response Payload info object - type: object - properties: - path: - type: string - description: path of the resource - example: /menu - content: - type: string - description: new modified code - example: "var accept = \"\\\"\"+mc.getProperty('AcceptHeader')+\"\\\"\"\ - ;\nvar responseCode = mc.getProperty('query.param.responseCode');\nvar\ - \ responseCodeStr = \"\\\"\"+responseCode+\"\\\"\";\nvar responses = [];\n\ - \nif (!responses[200]) {\n responses [200] = [];\n}\nresponses[200][\"\ - application/json\"] = \n[ {\n \"price\" : \"string\",\n \"description\"\ - \ : \"string\",\n \"name\" : \"string\",\n \"image\" : \"string\"\n\ - } ]\n\n/*if (!responses[304]) {\n responses[304] = [];\n}\nresponses[304][\"\ - application/(json or xml)\"] = {}/<>*/\n\nif (!responses[406]) {\n responses\ - \ [406] = [];\n}\nresponses[406][\"application/json\"] = \n{\n \"message\"\ - \ : \"string\",\n \"error\" : [ {\n \"message\" : \"string\",\n \ - \ \"code\" : 0\n } ],\n \"description\" : \"string\",\n \"code\" :\ - \ 0,\n \"moreInfo\" : \"string\"\n}\n\nresponses[501] = [];\nresponses[501][\"\ - application/json\"] = {\n\"code\" : 501,\n\"description\" : \"Not Implemented\"\ - }\nresponses[501][\"application/xml\"] = 501Not\ - \ Implemented;\n\nif (!responses[responseCode])\ - \ {\n responseCode = 501;\n}\n\nif (responseCode == null) {\n responseCode\ - \ = 200;\n responseCodeStr = \"200\";\n}\n\nif (accept == null || !responses[responseCode][accept])\ - \ {\n accept = \"application/json\";\n}\n\nif (accept === \"application/json\"\ - ) {\n mc.setProperty('CONTENT_TYPE', 'application/json');\n mc.setProperty('HTTP_SC',\ - \ responseCodeStr);\n mc.setPayloadJSON(responses[responseCode][\"application/json\"\ - ]);\n} else if (accept === \"application/xml\") {\n mc.setProperty('CONTENT_TYPE',\ - \ 'application/xml');\n mc.setProperty('HTTP_SC', responseCodeStr);\n\ - \ mc.setPayloadXML(responses[responseCode][\"application/xml\"]);\n}" - verb: - type: string - example: POST - ResourcePolicyList: - title: Resource policy List - type: object - properties: - list: - type: array - items: - $ref: '#/components/schemas/ResourcePolicyInfo' - count: - type: integer - description: | - Number of policy resources returned. - example: 1 - ResourcePolicyInfo: - title: Resource policy Info object with conversion policy resource details. - type: object - properties: - id: - type: string - description: | - UUID of the resource policy registry artifact - readOnly: true - example: 01234567-0123-0123-0123-012345678901 - httpVerb: - type: string - description: HTTP verb used for the resource path - example: get - resourcePath: - type: string - description: A string that represents the resource path of the api for the - related resource policy - example: checkPhoneNumber - content: - type: string - description: The resource policy content - example:
- Settings: - title: SettingsDTO - type: object - properties: - devportalUrl: - type: string - description: The Developer Portal URL - example: https://localhost:9443/devportal - environment: - type: array - items: - $ref: '#/components/schemas/Environment' - scopes: - type: array - example: - - apim:api_create - - apim:api_publish - items: - type: string - monetizationAttributes: - type: array - example: [] - items: - $ref: '#/components/schemas/MonetizationAttribute' - securityAuditProperties: - type: object - properties: {} - externalStoresEnabled: - type: boolean - description: | - Is External Stores configuration enabled - example: true - docVisibilityEnabled: - type: boolean - description: | - Is Document Visibility configuration enabled - example: false - crossTenantSubscriptionEnabled: - type: boolean - description: | - Is Cross Tenant Subscriptions Enabled - example: false - default: false - deployments: - type: array - items: - $ref: '#/components/schemas/Deployments' - SecurityAuditAttribute: - title: SecurityAuditAttributeDTO - type: object - properties: - isGlobal: - type: boolean - example: false - overrideGlobal: - type: boolean - example: false - apiToken: - type: string - example: b1267ytf-b7gc-4aee-924d-ece81241efec - collectionId: - type: string - example: 456ef957-5a79-449f-83y3-9027945d3c60 - baseUrl: - type: string - WSDLInfo: - title: WSDL information of the API. This is only available if the API is a SOAP - API. - type: object - properties: - type: - type: string - description: Indicates whether the WSDL is a single WSDL or an archive in - ZIP format - enum: - - WSDL - - ZIP - Pagination: - title: Pagination - type: object - properties: - offset: - type: integer - example: 0 - limit: - type: integer - example: 1 - total: - type: integer - example: 10 - next: - type: string - description: | - Link to the next subset of resources qualified. - Empty if no more resources are to be returned. - previous: - type: string - description: | - Link to the previous subset of resources qualified. - Empty if current subset is the first subset returned. - MonetizationAttribute: - title: Monetization attribute object - type: object - properties: - required: - type: boolean - description: | - Is attribute required - example: true - name: - type: string - description: | - Name of the attribute - displayName: - type: string - description: | - Display name of the attribute - description: - type: string - description: | - Description of the attribute - hidden: - type: boolean - description: | - Is attribute hidden - default: - type: string - description: | - Default value of the attribute - Tenant: - title: Tenant - type: object - properties: - domain: - type: string - description: tenant domain - example: wso2.com - status: + offset: + type: integer + example: 12 + limit: + type: integer + example: 25 + total: + type: integer + example: 1290 + +#----------------------------------------------------- +# The API Info resource +#----------------------------------------------------- + APIInfo: + title: API Info object with basic API details. + properties: + id: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: CalculatorAPI + description: + type: string + example: A calculator API that supports basic operations + context: + type: string + example: CalculatorAPI + version: + type: string + example: 1.0.0 + provider: + description: | + If the provider value is not given, the user invoking the API will be used as the provider. + type: string + example: admin + status: + type: string + example: CREATED + thumbnailUri: + type: string + example: /apis/01234567-0123-0123-0123-012345678901/thumbnail + +#----------------------------------------------------- +# The API resource +#----------------------------------------------------- + API: + title: API object + required: + - name + - context + - version + - tiers + - isDefaultVersion + - transport + - endpointConfig + - visibility + - type + properties: + id: + type: string + description: | + UUID of the api registry artifact + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + description: Name of the API + example: CalculatorAPI + description: + type: string + description: A brief description about the API + example: A calculator API that supports basic operations + context: + type: string + description: A string that represents the context of the user's request + example: CalculatorAPI + version: + type: string + description: The version of the API + example: 1.0.0 + provider: + description: | + If the provider value is not given user invoking the api will be used as the provider. + type: string + example: admin + apiDefinition: + description: | + Swagger definition of the API which contains details about URI templates and scopes + type: string + example: "{\"paths\":{\"/substract\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"parameters\":[{\"name\":\"x\",\"required\":true,\"type\":\"string\",\"in\":\"query\"},{\"name\":\"y\",\"required\":true,\"type\":\"string\",\"in\":\"query\"}],\"responses\":{\"200\":{}}}},\"/add\":{\"get\":{\"x-auth-type\":\"Application & Application User\",\"x-throttling-tier\":\"Unlimited\",\"parameters\":[{\"name\":\"x\",\"required\":true,\"type\":\"string\",\"in\":\"query\"},{\"name\":\"y\",\"required\":true,\"type\":\"string\",\"in\":\"query\"}],\"responses\":{\"200\":{}}}}},\"swagger\":\"2.0\",\"info\":{\"title\":\"CalculatorAPI\",\"version\":\"1.0.0\"}}" + wsdlUri: + description: | + WSDL URL if the API is based on a WSDL endpoint + type: string + example: "http://www.webservicex.com/globalweather.asmx?wsdl" + status: + type: string + description: This describes in which status of the lifecycle the API is + example: CREATED + responseCaching: + type: string + example: Disabled + cacheTimeout: + type: integer + example: 300 + destinationStatsEnabled: + type: string + example: Disabled + isDefaultVersion: + type: boolean + example: false + type: + type: string + description: The transport to be set. Accepted values are HTTP, WS + enum: + - HTTP + - WS + example: HTTP + default: HTTP + transport: + description: | + Supported transports for the API (http and/or https). + type: array + items: type: string - description: current status of the tenant active/inactive - example: active - TenantList: - title: Tenant list - type: object - properties: - count: - type: integer - description: | - Number of tenants returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Tenant' - pagination: - $ref: '#/components/schemas/Pagination' - AlertTypesList: - title: Alert Types List - type: object - properties: - count: - type: integer - description: The number of alerts - example: 3 - alerts: - type: array - items: - $ref: '#/components/schemas/AlertType' - AlertType: - title: Alert Type - type: object - properties: - id: - type: integer - description: The alert Id - example: 1 - name: + example: ["http","https"] + tags: + type: array + description: Search keywords related to the API + items: type: string - description: The name of the alert. - example: AbnormalRequestTime - requireConfiguration: - type: boolean - description: Whether the alert type require additional configurations. - example: true - Alert: - title: Alert - type: object - properties: - id: - type: integer - description: The alert Id - example: 1 - name: + example: ["substract","add"] + tiers: + type: array + description: The subscription tiers selected for the particular API + items: type: string - description: The name of the alert. - example: AbnormalRequestsPerMin - configuration: - type: array - items: - $ref: '#/components/schemas/AlertConfig' - AlertsInfo: - title: Alerts Info - type: object - properties: - alerts: - type: array - items: - $ref: '#/components/schemas/Alert' - emailList: - type: array - items: + example: ["Unlimited"] + apiLevelPolicy: + description: The policy selected for the particular API + type: string + example: "Unlimited" + maxTps: + properties: + production: + type: integer + format: int64 + example: 1000 + sandbox: + type: integer + format: int64 + example: 1000 + thumbnailUri: + type: string + example: "/apis/01234567-0123-0123-0123-012345678901/thumbnail" + visibility: + type: string + description: The visibility level of the API. Accepts one of the following. PUBLIC, PRIVATE, RESTRICTED OR CONTROLLED. + enum: + - PUBLIC + - PRIVATE + - RESTRICTED + - CONTROLLED + example: PUBLIC + visibleRoles: + type: array + description: The user roles that are able to access the API + items: + type: string + example: [] + endpointConfig: + type: string + example: "{\"production_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":{\"suspendErrorCode\":\"101000\",\"suspendDuration\":\"2000\",\"suspendMaxDuration\":\"3\",\"factor\":\"2\",\"retryErroCode\":\"101000\",\"retryTimeOut\":\"4\",\"retryDelay\":\"1000\",\"actionSelect\":\"fault\",\"actionDuration\":\"3000\"}},\"sandbox_endpoints\":{\"url\":\"https://localhost:9443/am/sample/pizzashack/v1/api/\",\"config\":null},\"endpoint_type\":\"http\"}" + endpointSecurity: + properties: + type: type: string - AlertsInfoResponse: - title: Alerts Info Response - type: object - properties: - alerts: - type: array - items: - $ref: '#/components/schemas/Alert' - emailList: - type: array - items: + example: basic + description: Accepts one of the following, basic or digest. + enum: + - basic + - digest + username: type: string - failedConfigurations: - type: array - items: - $ref: '#/components/schemas/AlertConfig' - AlertConfigList: - title: Alert Configuration List - type: object - properties: - count: - type: integer - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/AlertConfig' - AlertConfig: - title: Alert Configuration - type: object - properties: - configurationId: - type: string - description: The alert config subscription id. - example: UGl6emFTaGFja0FQSSsxLjAuMCtEZWZhdWx0QXBwbGljYXRpb24K - configuration: - type: object - additionalProperties: + example: admin + password: type: string - description: The config parameters. - example: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - AlertConfigInfo: - title: Alert Configuration Info - type: object + example: password + gatewayEnvironments: + description: | + Comma separated list of gateway environments. + type: string + example: Production and Sandbox + sequences: + type: array + items: + $ref: '#/definitions/Sequence' + example: [] + subscriptionAvailability: + type: string + description: The subscription availability. Accepts one of the following. current_tenant, all_tenants or specific_tenants. + enum: + - current_tenant + - all_tenants + - specific_tenants + example: current_tenant + subscriptionAvailableTenants: + type: array + items: + type: string + example: ["tenant1", "tenant2"] additionalProperties: + type: object + description : Map of custom properties of API + accessControl: type: string - description: The config parameters. - example: - apiName: PizzaShackAPI - apiVersion: 1.0.0 - applicationName: DefaultApplication - requestConunt: "12" - APICategory: - title: API Category - required: - - name - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: Finance - description: - type: string - example: Finance related APIs - APICategoryList: - title: API Category List - type: object - properties: - count: - type: integer - description: | - Number of API categories returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/APICategory' - KeyManagerInfo: - title: Key Manager Info - required: - - name - - type - type: object - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: WSO2 IS - displayName: - type: string - description: | - display name of Keymanager - example: Keymanager1 - type: - type: string - example: IS - description: - type: string - example: This is a key manager for Developers - enabled: - type: boolean - example: true - additionalProperties: - type: array - items: - type: object - properties: {} - KeyManagerList: - title: Key Manager List - type: object - properties: - count: - type: integer - description: | - Number of Key managers returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/KeyManagerInfo' - DeploymentList: - title: Deployment List - type: object - properties: - count: - type: integer - description: | - Number of deployment clusters returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/Deployments' - Deployments: - title: Deployments - required: - - clusters - - name - type: object - properties: - name: - type: string - example: Kubernetes - clusters: - type: array - items: - $ref: '#/components/schemas/DeploymentClusterInfo' - DeploymentClusterInfo: - title: DeploymentClusterInfo - required: - - accessURL - - clusterName - - displayName - - properties - type: object - properties: - clusterName: - type: string - example: minikube - accessURL: - type: string - example: https://api.com - displayName: - type: string - example: kubernetes-minikube + description: | + Is the API is restricted to certain set of publishers or creators or is it visible to all the + publishers and creators. If the accessControl restriction is none, this API can be modified by all the + publishers and creators, if not it can only be viewable/modifiable by certain set of publishers and creators, + based on the restriction. enum: + - NONE + - RESTRICTED + accessControlRoles: + type: array + description: The user roles that are able to view/modify as API publisher or creator. + items: + type: string + example: [admin] + businessInformation: properties: - type: object - additionalProperties: + businessOwner: type: string - DeploymentStatusList: - title: DeploymentStatus List - type: object - properties: - count: - type: integer - description: | - Status of the deployments returned. - example: 1 - list: - type: array - items: - $ref: '#/components/schemas/DeploymentStatus' - DeploymentStatus: - title: DeploymentStatus - required: - - clusters - - type - type: object - properties: - type: - type: string - example: Kubernetes - clusters: - type: array - items: - $ref: '#/components/schemas/DeploymentClusterStatus' - DeploymentClusterStatus: - title: DeploymentClusterStatus - required: - - clusterName - - healthStatus - - podsRunning - type: object - properties: - clusterName: - type: string - example: Minikube - podsRunning: - type: integer - healthStatus: - type: array - items: - $ref: '#/components/schemas/PodStatus' - DeploymentEnvironments: - title: DeploymentEnvironments - required: - - clusterName - - type - type: object - properties: - type: - type: string - example: Kubernetes - clusterName: - type: array - example: - - minikube - items: + example: businessowner + businessOwnerEmail: type: string - PodStatus: - title: PodStatus - required: - - name - - ready - - status - type: object - properties: - name: - type: string - example: petStore-677bb7cc65-shb2f - ready: - type: string - example: 1/1 - status: - type: string - example: running - creationTimestamp: - type: string - example: 2020-05-12T06:12:00Z - AsyncAPISpecificationValidationResponse: - title: AsyncAPI Specification Validation Response - required: - - isValid - type: object - properties: - isValid: - type: boolean - description: - This attribute declares whether this definition is valid or not. - example: true - content: - type: string - description: - AsyncAPI specification content - info: - type: object - properties: - name: - type: string - example: Streetlights - version: - type: string - example: 1.0.0 - context: - type: string - example: /streetlights - description: + example: businessowner@wso2.com + technicalOwner: + type: string + example: technicalowner + technicalOwnerEmail: + type: string + example: technicalowner@wso2.com + corsConfiguration: + description: | + CORS configuration for the API + properties: + corsConfigurationEnabled: + type: boolean + default: false + accessControlAllowOrigins: + type: array + items: + type: string + accessControlAllowCredentials: + type: boolean + default: false + accessControlAllowHeaders: + type: array + items: type: string - example: A sample API that uses a streetlights as an example to demonstrate AsyncAPI specifications - asyncAPIVersion: + accessControlAllowMethods: + type: array + items: type: string - example: 2.0 - endpoints: - type: array - description: - contains host/servers specified in the AsyncAPI file/URL - items: - type: string - example: "https://localhost:9443/am/sample/pizzashack/v1/api/" - description: - API definition information - errors: - type: array - description: - If there are more than one error list them out. - For example, list out validation error by each field. - items: - $ref: '#/components/schemas/ErrorListItem' - responses: - BadRequest: - description: Bad Request. Invalid request or validation error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 400 - message: Bad Request - description: Invalid request or validation error - moreInfo: "" - error: [] - Conflict: - description: Conflict. Specified resource already exists. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 409 - message: Conflict - description: Specified resource already exists - moreInfo: "" - error: [] - Forbidden: - description: Forbidden. The request must be conditional but no condition has - been specified. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 403 - message: Forbidden - description: The request must be conditional but no condition has been - specified - moreInfo: "" - error: [] - InternalServerError: - description: Internal Server Error. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 500 - message: Internal Server Error - description: The server encountered an internal error. Please contact - administrator. - moreInfo: "" - error: [] - NotAcceptable: - description: Not Acceptable. The requested media type is not supported. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 406 - message: Not Acceptable - description: The requested media type is not supported - moreInfo: "" - error: [] - NotFound: - description: Not Found. The specified resource does not exist. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 404 - message: Not Found - description: The specified resource does not exist - moreInfo: "" - error: [] - PreconditionFailed: - description: Precondition Failed. The request has not been performed because - one of the preconditions is not met. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 412 - message: Precondition Failed - description: The request has not been performed because one of the preconditions - is not met - moreInfo: "" - error: [] - Unauthorized: - description: Unauthorized. The user is not authorized. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 401 - message: Unauthorized - description: The user is not authorized - moreInfo: "" - error: [] - UnsupportedMediaType: - description: Unsupported Media Type. The entity of the request was not in a - supported format. - content: - application/json: - schema: - $ref: '#/components/schemas/Error' - example: - code: 415 - message: Unsupported media type - description: The entity of the request was not in a supported format - moreInfo: "" - error: [] - parameters: - replyLimit: - name: replyLimit - in: query - description: | - Maximum size of replies array to return. - schema: - type: integer - default: 25 - replyOffset: - name: replyOffset - in: query - description: | - Starting point within the complete list of replies. - schema: + +#----------------------------------------------------- +# The Application resource +#----------------------------------------------------- + Application: + title: Application + required: + - name + - throttlingTier + properties: + applicationId: + type: string + example: 01234567-0123-0123-0123-012345678901 + name: + type: string + example: CalculatorApp + subscriber: + type: string + example: admin + throttlingTier: + type: string + example: Unlimited + description: + type: string + example: Sample calculator application + groupId: + type: string + example: "" + +#----------------------------------------------------- +# The Document List resource +#----------------------------------------------------- + DocumentList: + title: Document List + properties: + count: type: integer - default: 0 - commentId: - name: commentId - in: path - description: | - Comment Id - required: true - schema: + description: | + Number of Documents returned. + example: 1 + next: type: string - parentCommentID: - name: replyTo - in: query - description: | - ID of the perent comment. - schema: + description: | + Link to the next subset of resources qualified. + Empty if no more resources are to be returned. + example: "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=2" + previous: type: string - includeCommenterInfo: - name: includeCommenterInfo - in: query - description: | - Whether we need to display commentor details. - schema: - type: boolean - default : false - apiId: - name: apiId - in: path - description: | - **API ID** consisting of the **UUID** of the API. - required: true - schema: + description: | + Link to the previous subset of resources qualified. + Empty if current subset is the first subset returned. + example: "/apis/01234567-0123-0123-0123-012345678901/documents?limit=1&offset=0" + list: + type: array + items: + $ref: '#/definitions/Document' + +#----------------------------------------------------- +# The Document resource +#----------------------------------------------------- + Document: + title: Document + required: + - name + - type + - sourceType + - visibility + properties: + documentId: type: string - endpointId: - name: endpointId - in: path - description: | - **Endpoint ID** consisting of the **UUID** of the Endpoint**. - required: true - schema: + example: 01234567-0123-0123-0123-012345678901 + name: type: string - apiId-Q: - name: apiId - in: query - description: | - **API ID** consisting of the **UUID** of the API. - The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. - Should be formatted as **provider-name-version**. - required: true - schema: + example: CalculatorDoc + type: type: string - apiId-Q-Opt: - name: apiId - in: query - description: | - **API ID** consisting of the **UUID** of the API. - The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. - Should be formatted as **provider-name-version**. - schema: + enum: + - HOWTO + - SAMPLES + - PUBLIC_FORUM + - SUPPORT_FORUM + - API_MESSAGE_FORMAT + - SWAGGER_DOC + - OTHER + example: HOWTO + summary: type: string - labelType-Q: - name: labelType - in: query - description: | - **API ID** consisting of the **UUID** of the API. - The combination of the provider of the API, name of the API and the version is also accepted as a valid API I. - Should be formatted as **provider-name-version**. - schema: + example: "Summary of Calculator Documentation" + sourceType: type: string - name: - name: name - in: path - description: | - Name of the API - required: true - schema: + enum: + - INLINE + - URL + - FILE + example: INLINE + sourceUrl: type: string - version: - name: version - in: path - description: | - Version of the API - required: true - schema: + example: "" + otherTypeName: type: string - apiName-Q: - name: name - in: query - description: | - Name of the API - schema: + example: "" + visibility: type: string - apiVersion-Q: - name: version - in: query - description: | - Version of the API - schema: + enum: + - OWNER_ONLY + - PRIVATE + - API_LEVEL + example: API_LEVEL + +#----------------------------------------------------- +# The Mediation List resource +#----------------------------------------------------- + mediationList: + title: Mediation List + properties: + count: + type: integer + description: | + Number of mediation sequences returned. + example: 1 + next: type: string - apiProvider-Q: - name: providerName - in: query - description: | - Provider name of the API - schema: + description: | + Link to the next subset of sequences qualified. + Empty if no more sequences are to be returned. + example: "" + previous: type: string - documentId: - name: documentId - in: path - description: | - Document Identifier - required: true - schema: + description: | + Link to the previous subset of sequences qualified. + Empty if current subset is the first subset returned. + example: "" + list: + type: array + items: + $ref: '#/definitions/MediationInfo' + +#----------------------------------------------------- +# The MediationInfo resource +#----------------------------------------------------- + MediationInfo: + title: MediationInfo + required: + - name + - type + - id + properties: + name: type: string - applicationId: - name: applicationId - in: path - description: | - **Application Identifier** consisting of the UUID of the Application. - required: true - schema: + example: json_fault.xml + id: type: string - subscriptionId: - name: subscriptionId - in: path - description: | - Subscription Id - required: true - schema: + example: 01234567-0123-0123-0123-012345678901 + type: type: string - mediationPolicyId: - name: mediationPolicyId - in: path - description: | - Mediation policy Id - required: true - schema: + enum: + - in + - out + - fault + example: in +#----------------------------------------------------- +# The Mediation resource +#----------------------------------------------------- + Mediation: + title: Mediation + required: + - name + - type + - config + properties: + id: type: string - resourcePolicyId: - name: resourcePolicyId - in: path - description: | - registry resource Id - required: true - schema: + example: 01234567-0123-0123-0123-012345678901 + name: type: string - subscriptionId-Q: - name: subscriptionId - in: query - description: | - Subscription Id - required: true - schema: + example: json_fault.xml + type: type: string - - # API Revision Identifier - # Specified as part of the path expression - revisionId: - name: revisionId - in: path - description: | - Revision ID of an API - required: true - schema: + enum: + - in + - out + - fault + example: in + config: type: string + example: ' + + + + ' + +#----------------------------------------------------- +# The MediationInfo resource +#----------------------------------------------------- + Wsdl: + title: Wsdl + required: + - name + properties: + name: + type: string + example: admin--calculatorAPI2.0.wsdl + wsdlDefinition: + type: string - # API Revision Identifier - # Specified as part of the query string - revisionId-Q: - name: revisionId - in: query - description: | - Revision ID of an API - schema: + +# The Tier List resource +#----------------------------------------------------- + TierList: + title: Tier List + properties: + count: + type: integer + description: | + Number of Tiers returned. + example: 1 + next: type: string - revisionNum-Q: - name: revisionNumber - in: query - description: | - Revision Number of an API - schema: + description: | + Link to the next subset of resources qualified. + Empty if no more resources are to be returned. + example: "/tiers/api?limit=1&offset=2" + previous: type: string - policyName: - name: policyName - in: path - description: | - Tier name - required: true - schema: + description: | + Link to the previous subset of resources qualified. + Empty if current subset is the first subset returned. + example: "/tiers/api?limit=1&offset=0" + list: + type: array + items: + $ref: '#/definitions/Tier' + +#----------------------------------------------------- +# The Tier resource +#----------------------------------------------------- + Tier: + title: Tier + required: + - name + - tierPlan + - requestCount + - unitTime + - stopOnQuotaReach + properties: + name: type: string - policyName-Q: - name: policyName - in: query - description: | - Name of the policy - required: true - schema: + example: Platinum + description: type: string - policyLevel: - name: policyLevel - in: path - description: | - List API or Application or Resource type policies. - required: true - schema: + example: "Allows 50 request(s) per minute." + tierLevel: type: string enum: - api - - subcription - policyLevel-Q: - name: policyLevel - in: query - description: | - List API or Application or Resource type policies. - required: true - schema: + - application + - resource + example: api + attributes: + description: | + Custom attributes added to the tier policy + type: object + additionalProperties: + type: string + example: {} + requestCount: + description: | + Maximum number of requests which can be sent within a provided unit time + type: integer + format: int64 + example: 50 + unitTime: + type: integer + format: int64 + example: 60000 + timeUnit: + type: string + example: "min" + tierPlan: + description: | + This attribute declares whether this tier is available under commercial or free type: string enum: - - api - - subcription - limit: - name: limit - in: query - description: | - Maximum size of resource array to return. - schema: - type: integer - default: 25 - Accept: - name: Accept - in: header - description: | - Media types acceptable for the response. Default is application/json. - schema: + - FREE + - COMMERCIAL + example: FREE + stopOnQuotaReach: + description: | + By making this attribute to false, you are capabale of sending requests + even if the request count exceeded within a unit time + type: boolean + example: true + +#----------------------------------------------------- +# The Tier Permission resource +#----------------------------------------------------- + TierPermission: + title: tierPermission + required: + - permissionType + - roles + properties: + permissionType: type: string - default: application/json - offset: - name: offset - in: query - description: | - Starting point within the complete list of items qualified. - schema: + enum: + - allow + - deny + example: deny + roles: + type: array + items: + type: string + example: ["Internal/everyone"] + +#----------------------------------------------------- +# The Subscription List resource +#----------------------------------------------------- + SubscriptionList: + title: Subscription List + properties: + count: type: integer - default: 0 - If-None-Match: - name: If-None-Match - in: header - description: | - Validator for conditional requests; based on the ETag of the formerly retrieved - variant of the resource. - schema: + description: | + Number of Subscriptions returned. + example: 1 + next: type: string - If-Match: - name: If-Match - in: header - description: | - Validator for conditional requests; based on ETag. - schema: + description: | + Link to the next subset of resources qualified. + Empty if no more resources are to be returned. + example: "/subscriptions?limit=1&offset=2&apiId=01234567-0123-0123-0123-012345678901&groupId=" + previous: type: string - scopeName: - name: scopeId - in: path - description: | - Scope name - required: true - schema: + description: | + Link to the previous subset of resources qualified. + Empty if current subset is the first subset returned. + example: "/subscriptions?limit=1&offset=0&apiId=01234567-0123-0123-0123-012345678901&groupId=" + list: + type: array + items: + $ref: '#/definitions/Subscription' + +#----------------------------------------------------- +# The Subscription resource +#----------------------------------------------------- + Subscription: + title: Subscription + required: + - applicationId + - apiIdentifier + - tier + properties: + subscriptionId: type: string - scopeId: - name: scopeId - in: path - description: | - Scope Id consisting the UUID of the shared scope - required: true - schema: + example: 01234567-0123-0123-0123-012345678901 + applicationId: type: string - expand: - name: expand - in: query - description: | - Defines whether the returned response should contain full details of API - schema: + example: 01234567-0123-0123-0123-012345678901 + apiIdentifier: + type: string + example: 01234567-0123-0123-0123-012345678901 + tier: + type: string + example: Unlimited + status: + type: string + enum: + - BLOCKED + - PROD_ONLY_BLOCKED + - UNBLOCKED + - ON_HOLD + - REJECTED + example: UNBLOCKED + +#----------------------------------------------------- +# The Extended Subscription resource +#----------------------------------------------------- + ExtendedSubscription: + title: Subscription with Ext. Workflow Reference + required: + - workflowId + allOf: + - $ref: '#/definitions/Subscription' + - properties: + workflowId: + type: string + example: 01234567-0123-0123-0123-012345678901 + +#----------------------------------------------------- +# The Sequence resource +#----------------------------------------------------- + Sequence: + title: Sequence + required: + - name + properties: + name: + type: string + example: log_in_message + type: + type: string + example: in + id: + type: string + example: 69ea3fa6-55c6-472e-896d-e449dd34a824 + shared: type: boolean - threatProtectionPolicyId: - name: policyId - in: path - description: | - The UUID of a Policy - required: true - schema: + example: true + +#----------------------------------------------------- +# The Error resource +#----------------------------------------------------- + Error: + title: Error object returned with 4XX HTTP status + required: + - code + - message + properties: + code: + type: integer + format: int64 + message: type: string - roleId: - name: roleId - in: path - description: | - The Base 64 URL encoded role name with domain. If the given role is in secondary user-store, role ID should be - derived as Base64URLEncode({user-store-name}/{role-name}). If the given role is in PRIMARY user-store, role ID - can be derived as Base64URLEncode(role-name) - required: true - schema: + description: Error message. + description: type: string - requestedTenant: - name: X-WSO2-Tenant - in: header - description: | - For cross-tenant invocations, this is used to specify the tenant domain, where the resource need to be - retirieved from. - schema: + description: | + A detail description about the error message. + moreInfo: type: string - apiProductId: - name: apiProductId - in: path - description: | - **API Product ID** consisting of the **UUID** of the API Product. Using the **UUID** in the API call is recommended. - required: true - schema: + description: | + Preferably an url with more details about the error. + error: + type: array + description: | + If there are more than one error list them out. + For example, list out validation errors by each field. + items: + $ref: '#/definitions/ErrorListItem' + +#----------------------------------------------------- +# The Error List Item resource +#----------------------------------------------------- + ErrorListItem: + title: Description of individual errors that may have occurred during a request. + required: + - code + - message + properties: + code: type: string - x-encoded: true - x-encoded: true - tenantDomain: - name: tenantDomain - in: path - description: | - The domain of a specific tenant - required: true - schema: + message: type: string - alertType: - name: alertType - in: path - description: The alert type. - required: true - schema: + description: | + Description about individual errors occurred + +#----------------------------------------------------- +# The Environment resource +#----------------------------------------------------- + Environment: + title: Environment + required: + - name + - type + - serverUrl + - endpoints + - showInApiConsole + properties: + name: type: string - configurationId: - name: configurationId - in: path - description: The alert configuration id. - required: true - schema: + example: Production and Sandbox + type: type: string - tierQuotaType: - name: tierQuotaType - description: Filter the subscription base on tier quota type - in: query - schema: + example: hybrid + serverUrl: type: string - requestBodies: - threatProtectionPolicy: - description: | - Threat protection policy request parameter - content: - application/json: - schema: - $ref: '#/components/schemas/ThreatProtectionPolicy' - required: true - securitySchemes: - OAuth2Security: - type: oauth2 - flows: - password: - tokenUrl: https://localhost:9443/oauth2/token - scopes: - openid: Authorize access to user details - apim:api_view: View API - apim:api_create: Create API - apim:api_delete: Delete API - apim:api_publish: Publish API - apim:subscription_view: View Subscription - apim:subscription_block: Block Subscription - apim:external_services_discover: Discover External Services - apim:threat_protection_policy_create: Create threat protection policies - apim:threat_protection_policy_manage: Update and delete threat protection policies - apim:document_create: Create API documents - apim:document_manage: Update and delete API documents - apim:mediation_policy_view: View mediation policies - apim:mediation_policy_create: Create mediation policies - apim:mediation_policy_manage: Update and delete mediation policies - apim:client_certificates_view: View client certificates - apim:client_certificates_add: Add client certificates - apim:client_certificates_update: Update and delete client certificates - apim:ep_certificates_view: View backend endpoint certificates - apim:ep_certificates_add: Add backend endpoint certificates - apim:ep_certificates_update: Update and delete backend endpoint certificates - apim:publisher_settings: Retrieve store settings - apim:pub_alert_manage: Get/ subscribe/ configure publisher alerts - apim:shared_scope_manage: Manage shared scopes - apim:app_import_export: Import and export applications related operations - apim:api_import_export: Import and export APIs related operations - apim:api_product_import_export: Import and export API Products related operations + example: "https://localhost:9443/services/" + showInApiConsole: + type: boolean + example: true + endpoints: + $ref: '#/definitions/EnvironmentEndpoints' + +#----------------------------------------------------- +# The Environment List resource +#----------------------------------------------------- + EnvironmentList: + title: Environment List + properties: + count: + type: integer + description: | + Number of Environments returned. + example: 1 + list: + type: array + items: + $ref: '#/definitions/Environment' + + +#----------------------------------------------------- +# The Environment Endpoint resource +#----------------------------------------------------- + EnvironmentEndpoints : + title: Environment Endpoints + properties: + http: + type: string + description: HTTP environment URL + example: "http://localhost:8280" + https: + type: string + description: HTTPS environment URL + example: "https://localhost:8243" + +#----------------------------------------------------- +# The File Information resource +#----------------------------------------------------- + FileInfo : + title: File Information including meta data + properties: + relativePath: + type: string + description: relative location of the file (excluding the base context and host of the Publisher API) + example: "apis/01234567-0123-0123-0123-012345678901/thumbnail" + mediaType: + type: string + description: media-type of the file + example: "image/jpeg" + + +#----------------------------------------------------- +# The workflow response resource +#----------------------------------------------------- + Workflow: + title: workflow + required: + - status + properties: + status: + description: | + This attribute declares whether this workflow task is approved or rejected. + type: string + enum: + - APPROVED + - REJECTED + example: APPROVED + attributes: + description: | + Custom attributes to complete the workflow task + type: object + additionalProperties: + type: string + example: {} + description: + type: string + example: "Approve workflow request." \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index ce938982e9..b2b587bcd1 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -43,22 +43,10 @@ org.eclipse.osgi org.eclipse.osgi - - - javax.ws.rs - javax.ws.rs - - org.eclipse.osgi org.eclipse.osgi.services - - - javax.ws.rs - javax.ws.rs - - org.testng @@ -67,166 +55,68 @@ org.wso2.tomcat tomcat - - - javax.ws.rs - javax.ws.rs - - org.wso2.tomcat tomcat-servlet-api - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon org.wso2.carbon.core - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon org.wso2.carbon.logging - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon org.wso2.carbon.utils - - - javax.ws.rs - javax.ws.rs - - org.apache.axis2.wso2 axis2 - - - javax.ws.rs - javax.ws.rs - - com.google.code.gson gson - - - javax.ws.rs - javax.ws.rs - - org.wso2.orbit.org.scannotation scannotation - - - javax.ws.rs - javax.ws.rs - - javax.ws.rs jsr311-api - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.governance org.wso2.carbon.governance.api - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.governance org.wso2.carbon.governance.lcm - - - javax.ws.rs - javax.ws.rs - - javax.ws.rs javax.ws.rs-api - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.common - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.apimgt org.wso2.carbon.apimgt.api provided - 9.0.5 - - - javax.ws.rs - javax.ws.rs - - org.wso2.carbon.apimgt org.wso2.carbon.apimgt.impl - 9.0.5 provided - - - javax.ws.rs - javax.ws.rs - - com.h2database.wso2 @@ -260,61 +150,75 @@ org.wso2.carbon.apimgt.webapp.publisher.* - com.google.gson;version="2.3",com.google.gson.reflect; - version="2.3",io.swagger.annotations,javax.servlet;version="2.6",javax.xml,javax.xml.bind,javax.xml.bind.annotat - ion,javax.xml.parsers,org.apache.catalina;version="9.0",org.apache.ca - talina.core;version="9.0",org.apache.commons.logging;version="1.2",org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}",org.scannotation;version="1.0",org.scannotation.archiveiterator;ve - rsion="1.0",org.w3c.dom,org.wso2.carbon.apimgt.annotations.api,org.ws - o2.carbon.apimgt.api,org.wso2.carbon.apimgt.api.model,org.wso2.carbon - .apimgt.impl,org.wso2.carbon.apimgt.webapp.publisher,org.wso2.carbon. - apimgt.webapp.publisher.config,org.wso2.carbon.apimgt.webapp.publishe - r.dto,org.wso2.carbon.apimgt.webapp.publisher.exception,org.wso2.carb - on.apimgt.webapp.publisher.lifecycle.listener,org.wso2.carbon.apimgt. - webapp.publisher.lifecycle.util,org.wso2.carbon.base;version="1.0",or - g.wso2.carbon.context;version="4.6",org.wso2.carbon.core;version="4.6 - ",org.wso2.carbon.core.util;version="4.6",org.wso2.carbon.registry.co - re.service;version="1.0",org.wso2.carbon.user.api;version="1.0",org.w - so2.carbon.user.core.service;version="4.6",org.wso2.carbon.user.core. - tenant;version="4.6",org.wso2.carbon.utils;version="4.6",org.wso2.car - bon.utils.multitenancy;version="4.6" + com.google.gson;version="2.3", + com.google.gson.reflect;version="2.3", + io.swagger.annotations, + javax.servlet;version="2.6", + javax.xml, + javax.xml.bind, + javax.xml.bind.annotation, + javax.xml.parsers, + org.apache.catalina;version="9.0", + org.apache.catalina.core;version="9.0", + org.apache.commons.logging;version="1.2", + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.scannotation;version="1.0", + org.scannotation.archiveiterator;version="1.0", + org.w3c.dom, + org.wso2.carbon.apimgt.annotations.api, + org.wso2.carbon.apimgt.api, + org.wso2.carbon.apimgt.api.model, + org.wso2.carbon.apimgt.impl, + org.wso2.carbon.apimgt.webapp.publisher, + org.wso2.carbon.apimgt.webapp.publisher.config, + org.wso2.carbon.apimgt.webapp.publisher.dto, + org.wso2.carbon.apimgt.webapp.publisher.exception, + org.wso2.carbon.apimgt.webapp.publisher.lifecycle.listener, + org.wso2.carbon.apimgt.webapp.publisher.lifecycle.util, + org.wso2.carbon.base;version="1.0", + org.wso2.carbon.context;version="4.6", + org.wso2.carbon.core;version="4.6", + org.wso2.carbon.core.util;version="4.6", + org.wso2.carbon.registry.core.service;version="1.0", + org.wso2.carbon.user.api;version="1.0", + org.wso2.carbon.user.core.service;version="4.6", + org.wso2.carbon.user.core.tenant;version="4.6", + org.wso2.carbon.utils;version="4.6", + org.wso2.carbon.utils.multitenancy;version="4.6" - jsr311-api;scope=compile|runtime;inline=false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + org.jacoco + jacoco-maven-plugin + + ${basedir}/target/coverage-reports/jacoco-unit.exec + + + + jacoco-initialize + + prepare-agent + + + + jacoco-site + test + + report + + + ${basedir}/target/coverage-reports/jacoco-unit.exec + ${basedir}/target/coverage-reports/site + + + + diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java index a6b98ad438..d1312714c1 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -44,9 +44,6 @@ import java.util.Iterator; import java.util.List; import java.util.Set; -//import org.wso2.carbon.apimgt.integration.generated.client.publisher.model.*; -//import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient; - /** * This class represents the concrete implementation of the APIPublisherService that corresponds to providing all * API publishing related operations. @@ -54,8 +51,6 @@ import java.util.Set; public class APIPublisherServiceImpl implements APIPublisherService { private static final String UNLIMITED_TIER = "Unlimited"; private static final String API_PUBLISH_ENVIRONMENT = "Production and Sandbox"; - private static final String CONTENT_TYPE = "application/json"; - private static final String PUBLISHED_STATUS = "PUBLISHED"; private static final String CREATED_STATUS = "CREATED"; private static final String PUBLISH_ACTION = "Publish"; public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance(); @@ -118,7 +113,6 @@ public class APIPublisherServiceImpl implements APIPublisherService { String context = config.getContext(); context = context.startsWith("/") ? context : ("/" + context); api.setContext(context + "/" + config.getVersion()); -// api.setContext(context); api.setStatus(CREATED_STATUS); api.setWsdlUrl(null); api.setResponseCache("Disabled"); @@ -172,8 +166,6 @@ public class APIPublisherServiceImpl implements APIPublisherService { api.setSubscriptionAvailability(APIConstants.SUBSCRIPTION_TO_CURRENT_TENANT); api.setVisibility(APIConstants.API_PRIVATE_VISIBILITY); } - // String endpointConfig = "{\"production_endpoints\":{\"url\":\"" + config.getEndpoint() + - // "\",\"config\":null},\"endpoint_type\":\"http\"}"; String endpointConfig = "{ \"endpoint_type\": \"http\", \"sandbox_endpoints\": { \"url\": \" " + config.getEndpoint() + "\" }, \"production_endpoints\": { \"url\": \" "+ config.getEndpoint()+"\" } }"; diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java index 9acc17232f..afc5ec6998 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java @@ -18,7 +18,6 @@ */ package org.wso2.carbon.apimgt.webapp.publisher.internal; -//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.apimgt.webapp.publisher.APIConfig; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService; import org.wso2.carbon.registry.core.service.RegistryService; @@ -37,8 +36,6 @@ public class APIPublisherDataHolder { private RegistryService registryService; private boolean isServerStarted; private Stack unpublishedApis = new Stack<>(); - // private IntegrationClientService integrationClientService; - private static APIPublisherDataHolder thisInstance = new APIPublisherDataHolder(); private APIPublisherDataHolder() { @@ -117,12 +114,4 @@ public class APIPublisherDataHolder { this.unpublishedApis = unpublishedApis; } - // public IntegrationClientService getIntegrationClientService() { - // return integrationClientService; - // } - - // public void setIntegrationClientService( - // IntegrationClientService integrationClientService) { - // this.integrationClientService = integrationClientService; - // } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java index a714d97aa8..dbdd874810 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java @@ -22,7 +22,6 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherService; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherServiceImpl; import org.wso2.carbon.apimgt.webapp.publisher.APIPublisherStartupHandler; @@ -45,7 +44,6 @@ import org.wso2.carbon.user.core.service.RealmService; * policy="dynamic" * bind="setRegistryService" * unbind="unsetRegistryService" - */ public class APIPublisherServiceComponent { @@ -116,14 +114,4 @@ public class APIPublisherServiceComponent { APIPublisherDataHolder.getInstance().setRegistryService(null); } - // protected void setIntegrationClientService(IntegrationClientService integrationClientService) { - // if (integrationClientService != null && log.isDebugEnabled()) { - // log.debug("integrationClientService initialized"); - // } - // APIPublisherDataHolder.getInstance().setIntegrationClientService(integrationClientService); - // } - // - // protected void unsetIntegrationClientService(IntegrationClientService integrationClientService) { - // APIPublisherDataHolder.getInstance().setIntegrationClientService(null); - // } } diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index fca4d2100a..eea40219af 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -34,13 +34,10 @@ http://wso2.org - - org.wso2.carbon.apimgt.webapp.publisher org.wso2.carbon.apimgt.application.extension org.wso2.carbon.apimgt.application.extension.api org.wso2.carbon.apimgt.annotations - diff --git a/pom.xml b/pom.xml index bfa525b9df..4f443c2add 100644 --- a/pom.xml +++ b/pom.xml @@ -912,6 +912,16 @@ org.wso2.carbon.apimgt.keymgt ${carbon.api.mgt.version} + + org.wso2.carbon.apimgt + org.wso2.carbon.apimgt.api + ${carbon.api.mgt.version} + + + org.wso2.carbon.apimgt + org.wso2.carbon.apimgt.impl + ${carbon.api.mgt.version} + From 7108b15549f7ec40a1c9dbd58c9d259fd2bf19fb Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 10:56:16 +0530 Subject: [PATCH 03/54] cleaned up components/application-mgt --- .../pom.xml | 64 ------------------- 1 file changed, 64 deletions(-) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml index f861513e29..e54526735e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml @@ -51,64 +51,6 @@ Application Management Core Bundle org.wso2.carbon.device.application.mgt.core.internal - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", org.apache.commons.logging, @@ -145,8 +87,6 @@ org.apache.commons.validator.routines apk-parser;scope=compile|runtime;inline=false - - !org.wso2.carbon.device.application.mgt.core.internal.*, org.wso2.carbon.device.application.mgt.core.* @@ -410,10 +350,6 @@ org.wso2.carbon.devicemgt org.wso2.carbon.identity.jwt.client.extension - - - - From 584dbd7894c72700cc65af4b5432e9c55758ff5f Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 11:02:18 +0530 Subject: [PATCH 04/54] cleaned up components/certificate-mgt --- .../pom.xml | 25 ------------------- .../pom.xml | 19 -------------- 2 files changed, 44 deletions(-) diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index 888eda3b79..f77e066ce5 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -133,11 +133,6 @@ - - - - - org.springframework spring-web @@ -159,26 +154,11 @@ - - - - - - - - - - junit junit test - - - - - org.wso2.carbon org.wso2.carbon.logging @@ -221,11 +201,6 @@ - - - - - org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index 94d2a8fec1..743227b322 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -133,10 +133,6 @@ - - - - org.springframework spring-web @@ -147,12 +143,6 @@ cxf-bundle-jaxrs provided - - - - - - commons-codec.wso2 commons-codec @@ -163,10 +153,6 @@ - - - - junit junit @@ -216,11 +202,6 @@ - - - - - org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations From 056987141b90e14e1600b716536cd14a3213bbef Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 12:30:38 +0530 Subject: [PATCH 05/54] cleaned up components/device-mgt --- .../pom.xml | 11 ------ .../DeviceManagementConfigServiceImpl.java | 4 +-- .../org.wso2.carbon.device.mgt.api/pom.xml | 36 ------------------- .../api/DeviceEventManagementService.java | 4 +++ .../service/api/GeoLocationBasedService.java | 3 ++ .../service/impl/DeviceAgentServiceImpl.java | 3 -- .../DeviceEventManagementServiceImpl.java | 29 ++++----------- .../impl/GeoLocationBasedServiceImpl.java | 20 ++--------- .../CredentialManagementResponseBuilder.java | 1 - .../mgt/jaxrs/util/DeviceMgtAPIUtils.java | 35 ++++-------------- .../org.wso2.carbon.device.mgt.common/pom.xml | 9 ----- .../org.wso2.carbon.device.mgt.core/pom.xml | 29 --------------- .../impl/DeviceInformationManagerImpl.java | 17 ++++----- .../DeviceManagementProviderServiceImpl.java | 7 +++- .../mgt/core/util/DeviceManagerUtil.java | 6 ++-- components/device-mgt/pom.xml | 3 -- .../pom.xml | 12 +++---- features/device-mgt/pom.xml | 2 +- pom.xml | 12 +++---- 19 files changed, 54 insertions(+), 189 deletions(-) diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml index 4eada72d20..0629418662 100644 --- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml +++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml @@ -155,17 +155,6 @@ cxf-bundle-jaxrs provided - - - - - - - - - - - javax.ws.rs jsr311-api diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java index f9ee5e913d..9ccbecda3d 100644 --- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java +++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java @@ -200,8 +200,8 @@ public class DeviceManagementConfigServiceImpl implements DeviceManagementConfig DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); KeyManagerConfigurations kmConfig = deviceManagementConfig.getKeyManagerConfigurations(); AppRegistrationCredentials credentials = DeviceManagerUtil.getApplicationRegistrationCredentials( - System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_CORE_HOST), - System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_CORE_HTTPS_PORT), + System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_GATEWAY_HOST), + System.getProperty(DeviceManagementConstants.ConfigurationManagement.IOT_GATEWAY_HTTPS_PORT), kmConfig.getAdminUsername(), kmConfig.getAdminPassword()); AccessTokenInfo accessTokenForAdmin = DeviceManagerUtil.getAccessTokenForDeviceOwner( diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index 86b7e6e035..38bc2c001a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -155,32 +155,11 @@ cxf-bundle-jaxrs provided - - - - - - - - - - - - - - - - commons-httpclient.wso2 commons-httpclient provided - - - - - org.wso2.carbon org.wso2.carbon.utils @@ -211,11 +190,6 @@ org.wso2.carbon.device.mgt.common provided - - - - - org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.extensions @@ -362,11 +336,6 @@ org.wso2.carbon.analytics.api provided - - - - - org.wso2.carbon.devicemgt org.wso2.carbon.identity.jwt.client.extension @@ -413,11 +382,6 @@ org.wso2.carbon.event.stream.persistence.stub provided - - - - - org.powermock powermock-module-testng diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java index fc0ce9c794..205f1b8ee2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java @@ -67,6 +67,7 @@ import javax.ws.rs.core.Response; @Consumes(MediaType.APPLICATION_JSON) public interface DeviceEventManagementService { + //todo:amalka // @POST // @Path("/{type}") // @ApiOperation( @@ -178,6 +179,7 @@ public interface DeviceEventManagementService { "ios, and windows.", required = false) @PathParam("type")String deviceType); + //todo:amalka // @GET // @Path("/{type}/{deviceId}") // @ApiOperation( @@ -240,6 +242,7 @@ public interface DeviceEventManagementService { // @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false) // @QueryParam("limit") int limit); + //todo:amalka // @GET // @Path("last-known/{type}/{deviceId}") // @ApiOperation( @@ -296,6 +299,7 @@ public interface DeviceEventManagementService { // @ApiParam(name = "limit", value = "limit of the records that needs to be picked up", required = false) // @QueryParam("limit") int limit); + //todo:amalka // @GET // @Path("filter/{type}/{parameter}") // @ApiOperation( diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java index 8b3071f1ef..4a3e994f70 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java @@ -97,6 +97,7 @@ public interface GeoLocationBasedService { /** * Retrieve Analytics for the device type */ + //todo:amalka // @GET // @Path("stats/{deviceType}/{deviceId}") // @ApiOperation( @@ -602,6 +603,7 @@ public interface GeoLocationBasedService { /** * Retrieve Geo alerts history */ + //todo:amalka // @GET // @Path("alerts/history/{deviceType}/{deviceId}") // @ApiOperation( @@ -671,6 +673,7 @@ public interface GeoLocationBasedService { /** * Retrieve Geo alerts history for geo clusters */ + //todo:amalka // @GET // @Path("alerts/history") // @ApiOperation( diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java index 52702536d1..47126e22da 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceImpl.java @@ -26,7 +26,6 @@ import org.apache.axis2.AxisFault; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; @@ -36,7 +35,6 @@ import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.exceptions.InvalidConfigurationException; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; -import org.wso2.carbon.device.mgt.common.policy.mgt.Policy; import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.ComplianceFeature; import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.PolicyComplianceException; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; @@ -52,7 +50,6 @@ import org.wso2.carbon.event.stream.stub.types.EventStreamAttributeDto; import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; import org.wso2.carbon.policy.mgt.common.PolicyAdministratorPoint; -import org.wso2.carbon.policy.mgt.common.PolicyEvaluationException; import org.wso2.carbon.policy.mgt.common.PolicyManagementException; import org.wso2.carbon.user.api.UserStoreException; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java index f5a7dacfd1..eda7ee4822 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceEventManagementServiceImpl.java @@ -4,29 +4,13 @@ import org.apache.axis2.AxisFault; import org.apache.axis2.client.Stub; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -//import org.wso2.carbon.analytics.api.AnalyticsDataAPI; -//import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil; -//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; -//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; -//import org.wso2.carbon.analytics.dataservice.commons.SortByField; -//import org.wso2.carbon.analytics.dataservice.commons.SortType; -//import org.wso2.carbon.analytics.datasource.commons.Record; -//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; -//import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException; -//import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub; -//import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTable; -//import org.wso2.carbon.analytics.stream.persistence.stub.dto.AnalyticsTableRecord; import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.Attribute; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.AttributeType; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.DeviceTypeEvent; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventAttributeList; -import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.EventRecords; import org.wso2.carbon.device.mgt.jaxrs.beans.analytics.TransportType; import org.wso2.carbon.device.mgt.jaxrs.service.api.DeviceEventManagementService; import org.wso2.carbon.device.mgt.jaxrs.util.Constants; @@ -43,21 +27,14 @@ import org.wso2.carbon.event.stream.stub.types.EventStreamDefinitionDto; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; import org.wso2.carbon.user.api.UserStoreException; -import javax.validation.Valid; import javax.ws.rs.DELETE; import javax.ws.rs.GET; -import javax.ws.rs.POST; import javax.ws.rs.Path; import javax.ws.rs.PathParam; -import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; import java.rmi.RemoteException; import java.util.ArrayList; -import java.util.Calendar; -import java.util.Comparator; -import java.util.HashSet; import java.util.List; -import java.util.Set; /** @@ -81,6 +58,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe private static final String MQTT_CONTENT_VALIDATOR = "default"; private static final String TIMESTAMP_FIELD_NAME = "_timestamp"; + //todo:amalka // private static AnalyticsDataAPI getAnalyticsDataAPI() { // PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); // AnalyticsDataAPI analyticsDataAPI = @@ -195,6 +173,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe /** * Deploy Event Stream, Receiver, Publisher and Store Configuration. */ + //todo:amalka // @POST // @Path("/{type}") // @Override @@ -349,6 +328,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe /** * Returns device specific data for the give period of time. */ + //todo:amalka // @GET // @Path("/{type}/{deviceId}") // @Override @@ -403,6 +383,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe * Returns last known data points up to the limit if limit is specified. Otherwise returns last known data point. * Limit parameter needs to be zero or positive. */ + //todo:amalka // @GET // @Path("/last-known/{type}/{deviceId}") // @Override @@ -453,6 +434,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe * Returns the filterd device list. Devices are filterd using the paramter given and the timestamp of the record. * parameter should given as a range. */ + //todo:amalka // @GET // @Path("filter/{type}/{parameter}") // @Override @@ -613,6 +595,7 @@ public class DeviceEventManagementServiceImpl implements DeviceEventManagementSe } } + //todo:amalka // private void publishEventStore(String streamName, String version, EventAttributeList eventAttributes) // throws RemoteException, UserStoreException, JWTClientException, // EventStreamPersistenceAdminServiceEventStreamPersistenceAdminServiceExceptionException { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java index 9075dceddd..30ea94954c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java @@ -25,15 +25,6 @@ import com.google.gson.Gson; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.http.HttpStatus; -//import org.wso2.carbon.analytics.api.AnalyticsDataAPI; -//import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil; -//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; -//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; -//import org.wso2.carbon.analytics.dataservice.commons.SortByField; -//import org.wso2.carbon.analytics.dataservice.commons.SortType; -//import org.wso2.carbon.analytics.datasource.commons.Record; -//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; -import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.DeviceManagementConstants; @@ -46,7 +37,6 @@ import org.wso2.carbon.device.mgt.common.event.config.EventConfigurationExceptio import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.geo.service.Alert; import org.wso2.carbon.device.mgt.common.geo.service.AlertAlreadyExistException; -import org.wso2.carbon.device.mgt.common.geo.service.Event; import org.wso2.carbon.device.mgt.common.geo.service.GeoFence; import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationBasedServiceException; import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService; @@ -57,18 +47,13 @@ import org.wso2.carbon.device.mgt.core.geo.geoHash.GeoCoordinate; import org.wso2.carbon.device.mgt.core.geo.geoHash.geoHashStrategy.GeoHashLengthStrategy; import org.wso2.carbon.device.mgt.core.geo.geoHash.geoHashStrategy.ZoomGeoHashLengthStrategy; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; -import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.beans.EventAction; import org.wso2.carbon.device.mgt.jaxrs.beans.GeofenceWrapper; import org.wso2.carbon.device.mgt.jaxrs.service.api.GeoLocationBasedService; import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.InputValidationException; import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil; -import org.wso2.carbon.device.mgt.jaxrs.util.Constants; import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils; -import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtUtil; -import org.wso2.carbon.user.api.UserStoreException; -import org.wso2.carbon.utils.multitenancy.MultitenantUtils; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; @@ -82,9 +67,7 @@ import javax.ws.rs.QueryParam; import javax.ws.rs.core.Response; import java.io.IOException; import java.util.ArrayList; -import java.util.HashMap; import java.util.List; -import java.util.Map; /** * The api for @@ -93,6 +76,7 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { private static Log log = LogFactory.getLog(GeoLocationBasedServiceImpl.class); + //todo:amalka // @Path("stats/{deviceType}/{deviceId}") // @GET // @Consumes("application/json") @@ -471,6 +455,7 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { } } + //todo:amalka // @Path("alerts/history/{deviceType}/{deviceId}") // @GET // @Consumes("application/json") @@ -521,6 +506,7 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { // } // } + //todo:amalka // @Path("alerts/history") // @GET // @Consumes("application/json") diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java index 16d4102176..19a8e59979 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/CredentialManagementResponseBuilder.java @@ -21,7 +21,6 @@ package org.wso2.carbon.device.mgt.jaxrs.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.beans.OldPasswordResetWrapper; import org.wso2.carbon.device.mgt.jaxrs.beans.PasswordResetWrapper; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java index fd8b0d9f59..49a734cdee 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java @@ -45,31 +45,28 @@ import org.apache.commons.httpclient.protocol.Protocol; import org.apache.commons.httpclient.protocol.ProtocolSocketFactory; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.analytics.api.AnalyticsDataAPI; import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub; -//import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; import org.wso2.carbon.base.ServerConfiguration; -import org.wso2.carbon.analytics.api.AnalyticsDataAPI; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.util.Utils; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.Device; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; -import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.common.MonitoringOperation; +import org.wso2.carbon.device.mgt.common.OperationMonitoringTaskConfig; import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationException; +import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService; +import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; +import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistory; import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistorySnapshot; import org.wso2.carbon.device.mgt.common.device.details.DeviceLocationHistorySnapshotWrapper; -import org.wso2.carbon.device.mgt.common.event.config.EventConfigurationProviderService; import org.wso2.carbon.device.mgt.common.exceptions.BadRequestException; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; -import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService; -import org.wso2.carbon.device.mgt.common.configuration.mgt.ConfigurationEntry; -import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration; -import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; import org.wso2.carbon.device.mgt.common.exceptions.UnAuthorizedException; import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; @@ -373,24 +370,6 @@ public class DeviceMgtAPIUtils { return privacyComplianceProvider; } - -// public static IntegrationClientService getIntegrationClientService() { -// if (integrationClientService == null) { -// synchronized (DeviceMgtAPIUtils.class) { -// if (integrationClientService == null) { -// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); -// integrationClientService = (IntegrationClientService) ctx.getOSGiService(IntegrationClientService.class, null); -// if (integrationClientService == null) { -// String msg = "IntegrationClientService is not initialized"; -// log.error(msg); -// throw new IllegalStateException(msg); -// } -// } -// } -// } -// return integrationClientService; -// } - /** * Initializing and accessing method for OTPManagementService. * diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index d896782b1a..dc6240b236 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -50,7 +50,6 @@ javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", com.fasterxml.jackson.annotation;version="${jackson-annotations.version}", - io.swagger.annotations; version="${swagger.annotations.version}"; resolution:=optional, com.google.gson @@ -96,14 +95,6 @@ org.wso2.orbit.com.fasterxml.jackson.core jackson-annotations - - - - - - - - com.google.code.gson gson diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index ae28f57c44..68e174db3f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -90,7 +90,6 @@ org.wso2.carbon.core, org.wso2.carbon.utils.*, org.wso2.carbon.device.mgt.common.*, - org.wso2.carbon.user.api, org.wso2.carbon.user.core.*, org.wso2.carbon.registry.core.service, @@ -104,8 +103,6 @@ org.wso2.carbon.ndatasource.core, org.wso2.carbon.ntask.core.*, org.wso2.carbon.ntask.common, - - org.apache.commons.collections;version="${commons-collections.version.range}", org.wso2.carbon.email.sender.*, io.swagger.annotations.*;resolution:=optional, @@ -166,32 +163,6 @@ org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.common - - - - - - - - - - - - - - - - - - - - - - - - - - org.wso2.carbon org.wso2.carbon.logging diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java index 396df0f61f..e1ce6c4f9c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java @@ -22,22 +22,17 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; -import org.wso2.carbon.context.PrivilegedCarbonContext; -//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; -import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; -import org.wso2.carbon.device.mgt.common.device.details.DeviceData; import org.wso2.carbon.device.mgt.common.device.details.DeviceDetailsWrapper; +import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; +import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.exceptions.EventPublishingException; import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException; -import org.wso2.carbon.device.mgt.common.device.details.DeviceInfo; -import org.wso2.carbon.device.mgt.common.device.details.DeviceLocation; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; import org.wso2.carbon.device.mgt.core.DeviceManagementConstants; -import org.wso2.carbon.device.mgt.core.config.tenant.PlatformConfigurationManagementServiceImpl; import org.wso2.carbon.device.mgt.core.dao.DeviceDAO; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; @@ -46,18 +41,14 @@ import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManag import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsDAO; import org.wso2.carbon.device.mgt.core.device.details.mgt.dao.DeviceDetailsMgtDAOException; import org.wso2.carbon.device.mgt.core.internal.DeviceManagementDataHolder; - -import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService; import org.wso2.carbon.device.mgt.core.report.mgt.Constants; import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; import org.wso2.carbon.device.mgt.core.util.HttpReportingUtil; -import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import java.sql.SQLException; import java.util.ArrayList; -import java.util.Arrays; import java.util.Calendar; import java.util.HashMap; import java.util.List; @@ -178,6 +169,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { deviceInfo.getAvailableRAMMemory(), deviceInfo.isPluggedIn() }; + //todo:amalka // DeviceManagerUtil.getEventPublisherService().publishEvent( // DEVICE_INFO_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload // ); @@ -193,6 +185,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { DeviceManagementDAOFactory.rollbackTransaction(); throw new DeviceDetailsMgtException("Error occurred while updating the last update timestamp of the " + "device", e); + //todo:amalka // } catch (DataPublisherConfigurationException e) { // throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e); } finally { @@ -389,6 +382,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { deviceLocation.getBearing(), deviceLocation.getDistance() }; + //todo:amalka // DeviceManagerUtil.getEventPublisherService().publishEvent( // LOCATION_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload // ); @@ -403,6 +397,7 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager { } catch (DeviceManagementException e) { DeviceManagementDAOFactory.rollbackTransaction(); throw new DeviceDetailsMgtException("Error occurred while getting the device information.", e); + //todo:amalka // } catch (DataPublisherConfigurationException e) { // DeviceManagementDAOFactory.rollbackTransaction(); // throw new DeviceDetailsMgtException("Error occurred while publishing the device location information.", e); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java index 52a169ef61..dba8d2b88e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/service/DeviceManagementProviderServiceImpl.java @@ -49,7 +49,6 @@ import org.apache.http.protocol.HTTP; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; import org.wso2.carbon.device.mgt.common.ActivityPaginationRequest; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceEnrollmentInfoNotification; @@ -163,6 +162,8 @@ import java.util.Map; import java.util.Properties; import java.util.stream.Collectors; +//import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; + public class DeviceManagementProviderServiceImpl implements DeviceManagementProviderService, PluginInitializationListener { @@ -1964,6 +1965,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv operation.getStatus() != null ? operation.getStatus().toString() : null, operation.getOperationResponse() }; + //todo:amalka // DeviceManagerUtil.getEventPublisherService().publishEvent( // OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload // ); @@ -1973,6 +1975,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv String msg = "Error occurred while reading configs."; log.error(msg, e); throw new OperationManagementException(msg, e); + //todo:amalka } //catch (DataPublisherConfigurationException e) { // String msg = "Error occurred while publishing event."; // log.error(msg, e); @@ -2006,6 +2009,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv operation.getStatus() != null ? operation.getStatus().toString() : null, operation.getOperationResponse() }; + //todo:amalka // DeviceManagerUtil.getEventPublisherService().publishEvent( // OPERATION_RESPONSE_EVENT_STREAM_DEFINITION, "1.0.0", metaData, new Object[0], payload // ); @@ -2015,6 +2019,7 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv String msg = "Error occurred while reading configs."; log.error(msg, e); throw new OperationManagementException(msg, e); + //todo:amalka } //catch (DataPublisherConfigurationException e) { // String msg = "Error occurred while publishing event."; // log.error(msg, e); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java index 13593baf12..0a2932e930 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java @@ -50,7 +50,6 @@ import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.caching.impl.CacheImpl; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; import org.wso2.carbon.device.mgt.common.AppRegistrationCredentials; import org.wso2.carbon.device.mgt.common.ApplicationRegistration; import org.wso2.carbon.device.mgt.common.ApplicationRegistrationException; @@ -67,11 +66,11 @@ import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfiguration import org.wso2.carbon.device.mgt.common.event.config.EventConfigurationProviderService; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.exceptions.DeviceNotFoundException; +import org.wso2.carbon.device.mgt.common.exceptions.MetadataManagementException; import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException; import org.wso2.carbon.device.mgt.common.geo.service.GeofenceData; import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; -import org.wso2.carbon.device.mgt.common.exceptions.MetadataManagementException; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; @@ -129,6 +128,8 @@ import java.util.regex.Matcher; import java.util.regex.Pattern; import java.util.stream.IntStream; +//import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; + public final class DeviceManagerUtil { private static final Log log = LogFactory.getLog(DeviceManagerUtil.class); @@ -595,6 +596,7 @@ public final class DeviceManagerUtil { return Caching.getCacheManagerFactory().getCacheManager(DeviceManagementConstants.DM_CACHE_MANAGER); } + //todo:amalka // public static EventsPublisherService getEventPublisherService() { // PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); // EventsPublisherService eventsPublisherService = diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index 709e09d6bc..adb86890c8 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -36,11 +36,8 @@ org.wso2.carbon.device.mgt.core org.wso2.carbon.device.mgt.common org.wso2.carbon.device.mgt.extensions - org.wso2.carbon.device.mgt.ui org.wso2.carbon.device.mgt.api - org.wso2.carbon.device.mgt.url.printer - io.entgra.carbon.device.mgt.config.api diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml index 5dcaac8a0f..4472e7200f 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml @@ -39,11 +39,11 @@ org.wso2.carbon.device.mgt.server.feature zip - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.ui.feature - zip - + + + + + javax.servlet.jsp javax.servlet.jsp-api @@ -80,7 +80,7 @@ org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.server.feature:${carbon.device.mgt.version} - org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.ui.feature:${carbon.device.mgt.version} + javax.servlet.jsp:javax.servlet.jsp-api diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index 1c4c45ab71..37bcec882b 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -35,7 +35,7 @@ org.wso2.carbon.device.mgt.basics.feature org.wso2.carbon.device.mgt.server.feature - org.wso2.carbon.device.mgt.ui.feature + org.wso2.carbon.device.mgt.api.feature org.wso2.carbon.device.mgt.feature org.wso2.carbon.device.mgt.extensions.feature diff --git a/pom.xml b/pom.xml index 4f443c2add..a6156c75b0 100644 --- a/pom.xml +++ b/pom.xml @@ -310,12 +310,12 @@ zip ${carbon.device.mgt.version} - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.ui.feature - zip - ${carbon.device.mgt.version} - + + + + + + org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.application.extension From 8590268db48a397b7151d870d9646f52990be4c3 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 12:33:04 +0530 Subject: [PATCH 06/54] cleaned up components/heartbeat-management/ --- .../pom.xml | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml index 65b62fca38..2aab7d1cdd 100644 --- a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml +++ b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml @@ -61,12 +61,6 @@ org.wso2.carbon.utils.*, org.wso2.carbon.ndatasource.core, org.w3c.dom, - - - - - - org.apache.commons.io, org.apache.axis2.transport.mail, org.apache.commons.collections, @@ -149,14 +143,6 @@ org.apache.axis2.wso2 axis2 - - - - - - - - commons-io.wso2 commons-io From bf074061f17c03d65ed322dc814bd67a9a0fc043 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 12:36:01 +0530 Subject: [PATCH 07/54] cleaned up components/identity-extensions --- .../org.wso2.carbon.device.mgt.oauth.extensions/pom.xml | 9 ++------- .../handlers/grant/AccessTokenGrantHandler.java | 5 +++-- .../handlers/grant/ExtendedJWTGrantHandler.java | 8 ++++++-- .../handlers/grant/ExtendedSAML2BearerGrantHandler.java | 5 +++-- .../pom.xml | 4 ++-- components/identity-extensions/pom.xml | 2 -- 6 files changed, 16 insertions(+), 17 deletions(-) diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml index 27de8ac3a6..ae46c74805 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml @@ -87,11 +87,10 @@ org.wso2.carbon.device.mgt.oauth.extensions.* - + org.wso2.carbon.identity.oauth2.grant.jwt;version="${carbon.identity.jwt.grant.version.range}", org.apache.commons.lang, org.apache.commons.logging, - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.osgi.service.component, org.wso2.carbon.identity.application.common.model;version="${carbon.identity.framework.version.range}", org.wso2.carbon.identity.application.common;version="${carbon.identity.framework.version.range}", org.wso2.carbon.identity.application.mgt.*;version="${carbon.identity.framework.version.range}", @@ -114,10 +113,6 @@ org.apache.oltu.oauth2.common.validators, org.apache.commons.lang3.tuple, - - - - diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java index 4cc7881344..1153cb0561 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/AccessTokenGrantHandler.java @@ -21,6 +21,7 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.apimgt.keymgt.ScopesIssuer; import org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant.oauth.validator.LocalOAuthValidator; import org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant.oauth.validator.OAuthValidationResponse; import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser; @@ -57,8 +58,8 @@ public class AccessTokenGrantHandler extends AbstractAuthorizationGrantHandler { } @Override - public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception { - return super.validateScope(tokReqMsgCtx); + public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) { + return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx); } @Override diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java index f6560e76eb..006317f179 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedJWTGrantHandler.java @@ -20,10 +20,14 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.apimgt.keymgt.ScopesIssuer; +import org.wso2.carbon.base.MultitenantConstants; +import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception; import org.wso2.carbon.identity.oauth2.grant.jwt.JWTBearerGrantHandler; import org.wso2.carbon.identity.oauth2.model.RequestParameter; import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext; +import org.wso2.carbon.utils.multitenancy.MultitenantUtils; /** * This sets up user with tenant aware username. @@ -34,8 +38,8 @@ public class ExtendedJWTGrantHandler extends JWTBearerGrantHandler { private static final String TENANT_DOMAIN_KEY = "tenantDomain"; @Override - public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception { - return super.validateScope(tokReqMsgCtx); + public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) { + return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx); } @Override diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java index 2193d2d3ed..5caededdaf 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/src/main/java/org/wso2/carbon/device/mgt/oauth/extensions/handlers/grant/ExtendedSAML2BearerGrantHandler.java @@ -20,6 +20,7 @@ package org.wso2.carbon.device.mgt.oauth.extensions.handlers.grant; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.apimgt.keymgt.ScopesIssuer; import org.wso2.carbon.identity.application.authentication.framework.model.AuthenticatedUser; import org.wso2.carbon.identity.oauth2.IdentityOAuth2Exception; import org.wso2.carbon.identity.oauth2.token.OAuthTokenReqMessageContext; @@ -34,8 +35,8 @@ public class ExtendedSAML2BearerGrantHandler extends SAML2BearerGrantHandler { private static Log log = LogFactory.getLog(ExtendedSAML2BearerGrantHandler.class); @Override - public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) throws IdentityOAuth2Exception { - return super.validateScope(tokReqMsgCtx); + public boolean validateScope(OAuthTokenReqMessageContext tokReqMsgCtx) { + return ScopesIssuer.getInstance().setScopes(tokReqMsgCtx); } @Override diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml index abcf3859a3..4adb6539ab 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml @@ -109,8 +109,8 @@ org.apache.commons.httpclient, org.apache.commons.logging, org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}", - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.osgi.framework, + org.osgi.service.component, org.wso2.carbon.core.security, org.wso2.carbon.core.services.authentication, org.wso2.carbon.utils.multitenancy, diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml index de175d9dba..bbf1f08a4e 100644 --- a/components/identity-extensions/pom.xml +++ b/components/identity-extensions/pom.xml @@ -33,8 +33,6 @@ http://wso2.org - - org.wso2.carbon.identity.jwt.client.extension From 1f2b1e84e6971c4ef86a1ee5fc531ff4bdb5a424 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 12:46:56 +0530 Subject: [PATCH 08/54] cleaned up components/policy-mgt --- pom.xml | 5 ----- 1 file changed, 5 deletions(-) diff --git a/pom.xml b/pom.xml index a6156c75b0..22525c77c5 100644 --- a/pom.xml +++ b/pom.xml @@ -226,11 +226,6 @@ org.wso2.carbon.policy.mgt.core ${carbon.device.mgt.version} - - org.wso2.carbon.devicemgt - org.wso2.carbon.complex.policy.decision.point - ${carbon.device.mgt.version} - org.wso2.carbon.devicemgt org.wso2.carbon.policy.decision.point From 95695e850de2a2e0a547a0e19ca81343264ca242 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 12:48:50 +0530 Subject: [PATCH 09/54] cleaned up components/transport-mgt --- .../pom.xml | 15 --------------- 1 file changed, 15 deletions(-) diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml index edc6bfedb2..8a8ae5ee3c 100644 --- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml +++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml @@ -96,21 +96,6 @@ cxf-bundle-jaxrs provided - - - - - - - - - - - - - - - javax.servlet javax.servlet-api From 73df5e2fedc7bfb428448e65c416872d784148c0 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 13:06:30 +0530 Subject: [PATCH 10/54] cleaned up components/ui-request-interceptor --- .../io.entgra.ui.request.interceptor/pom.xml | 20 +++++-------------- .../ui/request/interceptor/LoginHandler.java | 13 +++--------- .../interceptor/SsoLoginCallbackHandler.java | 2 +- .../request/interceptor/SsoLoginHandler.java | 6 +++--- .../ui/request/interceptor/UserHandler.java | 8 +++++--- .../request/interceptor/util/HandlerUtil.java | 19 ++---------------- 6 files changed, 19 insertions(+), 49 deletions(-) diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml index 783643a999..d41942e3f6 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml @@ -103,6 +103,11 @@ org.wso2.carbon.apimgt.application.extension provided + + org.wso2.carbon.devicemgt + org.wso2.carbon.device.mgt.core + provided + org.springframework spring-web @@ -113,21 +118,6 @@ cxf-bundle-jaxrs provided - - - - - - - - - - - - - - - javax.servlet javax.servlet-api diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java index 5a664552b8..cd0ff14a20 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java @@ -24,6 +24,7 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import io.entgra.ui.request.interceptor.beans.AuthData; +import io.entgra.ui.request.interceptor.beans.ProxyResponse; import io.entgra.ui.request.interceptor.exceptions.LoginException; import io.entgra.ui.request.interceptor.util.HandlerConstants; import io.entgra.ui.request.interceptor.util.HandlerUtil; @@ -34,17 +35,12 @@ import org.apache.http.HttpStatus; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; -import org.apache.http.protocol.HTTP; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl; import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants; import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; -import org.wso2.carbon.authenticator.stub.AuthenticationAdmin; -import org.wso2.carbon.authenticator.stub.Login; import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.ui.request.interceptor.beans.ProxyResponse; -import org.wso2.carbon.utils.multitenancy.MultitenantUtils; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; @@ -81,7 +77,8 @@ public class LoginHandler extends HttpServlet { //setting session to expiry in 5 minutes httpSession.setMaxInactiveInterval(Math.toIntExact(HandlerConstants.TIMEOUT)); //todo: amalka do we need this remote call? - JsonObject uiConfigJsonObject = HandlerUtil.getUIConfigAndPersistInSession(uiConfigUrl, gatewayUrl, httpSession, resp); + JsonObject uiConfigJsonObject = HandlerUtil.getUIConfigAndPersistInSession( + uiConfigUrl, gatewayUrl, httpSession, resp); JsonArray tags = uiConfigJsonObject.get("appRegistration").getAsJsonObject().get("tags").getAsJsonArray(); JsonArray scopes = uiConfigJsonObject.get("scopes").getAsJsonArray(); @@ -140,11 +137,7 @@ public class LoginHandler extends HttpServlet { HttpServletResponse resp, JsonArray scopes) throws LoginException { JsonParser jsonParser = new JsonParser(); try { -// JsonElement jClientAppResult = jsonParser.parse(clientAppResult); if (clientId != null && clientSecret != null) { -// JsonObject jClientAppResultAsJsonObject = jClientAppResult.getAsJsonObject(); -// String clientId = jClientAppResultAsJsonObject.get("client_id").getAsString(); -// String clientSecret = jClientAppResultAsJsonObject.get("client_secret").getAsString(); String encodedClientApp = Base64.getEncoder() .encodeToString((clientId + HandlerConstants.COLON + clientSecret).getBytes()); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java index 641aa6d990..8ee6ec776b 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java @@ -61,7 +61,7 @@ public class SsoLoginCallbackHandler extends HttpServlet { String iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") + HandlerConstants.COLON + iotsCorePort; - HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + session.getAttribute("encodedClientApp")); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java index 23e76b81ae..1ade046d43 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java @@ -101,7 +101,7 @@ public class SsoLoginHandler extends HttpServlet { */ private void dynamicClientRegistration(HttpServletRequest req, HttpServletResponse resp) { try { - File userMgtConf = new File("repository/conf/user-mgt.xml"); + File userMgtConf = new File("conf/user-mgt.xml"); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(userMgtConf); @@ -136,7 +136,7 @@ public class SsoLoginHandler extends HttpServlet { JsonArray scopes = uiConfigJsonObject.get("scopes").getAsJsonArray(); // Register the client application - HttpPost apiRegEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.APP_REG_ENDPOINT); + HttpPost apiRegEndpoint = new HttpPost(gatewayUrl + HandlerConstants.APP_REG_ENDPOINT); encodedAdminCredentials = Base64.getEncoder() .encodeToString((adminUsername + HandlerConstants.COLON + adminPassword).getBytes()); apiRegEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + @@ -262,7 +262,7 @@ public class SsoLoginHandler extends HttpServlet { * @throws IOException IO exception throws if an error occurred when invoking token endpoint */ private ProxyResponse getTokenResult(String encodedClientApp) throws IOException { - HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + encodedClientApp); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java index 67b2834516..d6ef958a5c 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java @@ -33,6 +33,8 @@ import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import io.entgra.ui.request.interceptor.beans.ProxyResponse; +import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; +import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; @@ -72,9 +74,9 @@ public class UserHandler extends HttpServlet { HttpPost introspectionEndpoint = new HttpPost(serverUrl + HandlerConstants.INTROSPECT_ENDPOINT); introspectionEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); - //todo:amalka - String username = "admin"; - String password = "admin"; + DeviceManagementConfig dmc = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); + String username = dmc.getKeyManagerConfigurations().getAdminUsername(); + String password = dmc.getKeyManagerConfigurations().getAdminPassword(); introspectionEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + Base64.getEncoder() .encodeToString((username + HandlerConstants.COLON + password).getBytes())); StringEntity introspectionPayload = new StringEntity("token=" + accessToken, diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java index bc864c03ee..4582468a0c 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java @@ -23,8 +23,6 @@ import com.google.gson.JsonArray; import com.google.gson.JsonElement; import com.google.gson.JsonObject; import com.google.gson.JsonParser; -import com.sun.org.apache.xml.internal.serialize.OutputFormat; -import com.sun.org.apache.xml.internal.serialize.XMLSerializer; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -38,12 +36,12 @@ import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; import org.apache.http.impl.client.CloseableHttpClient; import org.apache.http.impl.client.HttpClients; +import org.apache.xml.serialize.OutputFormat; +import org.apache.xml.serialize.XMLSerializer; import org.json.JSONException; import org.json.JSONObject; import org.w3c.dom.Document; import io.entgra.ui.request.interceptor.beans.ProxyResponse; -import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; -import org.wso2.carbon.context.PrivilegedCarbonContext; import org.xml.sax.SAXException; import javax.servlet.http.HttpServletRequest; @@ -82,7 +80,6 @@ public class HandlerUtil { HandlerConstants.INTERNAL_ERROR_CODE)); return proxyResponse; } else { - int statusCode = response.getStatusLine().getStatusCode(); try (BufferedReader rd = new BufferedReader(new InputStreamReader(response.getEntity().getContent()))) { StringBuilder result = new StringBuilder(); @@ -403,16 +400,4 @@ public class HandlerUtil { return stringOutput; } - - public static APIManagementProviderService getAPIManagementProviderService() { - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - APIManagementProviderService apiManagementProviderService = - (APIManagementProviderService) ctx.getOSGiService(APIManagementProviderService.class, null); - if (apiManagementProviderService == null) { - String msg = "API management provider service has not initialized."; - log.error(msg); - throw new IllegalStateException(msg); - } - return apiManagementProviderService; - } } From 0d8750f0a7493c89d40fc0d50f30f5fe3b92491a Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 13:07:47 +0530 Subject: [PATCH 11/54] cleaned up components/webapp-authenticator-framework --- .../pom.xml | 22 +++++++++---------- 1 file changed, 11 insertions(+), 11 deletions(-) diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 64e71e342d..2d3df3e061 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -63,15 +63,15 @@ javax.xml.bind.annotation, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, javax.xml.validation, - - - + org.apache.catalina, + org.apache.catalina.connector, + org.apache.catalina.util, org.apache.commons.logging, - - - - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.apache.coyote, + org.apache.tomcat.util.buf, + org.apache.tomcat.util.http, + org.osgi.service.component, + org.osgi.framework, org.w3c.dom, org.wso2.carbon.context, org.wso2.carbon.core.util, @@ -79,7 +79,7 @@ org.wso2.carbon.identity.core.util; version="${carbon.identity.imp.pkg.version}", org.wso2.carbon.identity.oauth2.*; version="${carbon.identity-inbound-auth-oauth.imp.pkg.version}", - + org.wso2.carbon.tomcat.ext.valves, org.wso2.carbon.user.api, org.wso2.carbon.user.core.service, org.wso2.carbon.user.core.tenant, @@ -106,8 +106,8 @@ org.apache.commons.pool.impl, org.apache.http.conn, org.apache.http.impl.conn, - - + javax.xml.soap; version="${javax.xml.soap.imp.pkg.version}", + javax.xml.stream, org.apache.axiom.*; version="${axiom.osgi.version.range}", org.wso2.carbon.registry.core.*, org.wso2.carbon.registry.common.*;version="${carbon.registry.imp.pkg.version.range}", From 291565127252f02546e374a9eaf697ad30fa07ab Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 10 May 2021 13:23:36 +0530 Subject: [PATCH 12/54] cleaned up features --- .../pom.xml | 6 +- .../conf/webapp-publisher-config.xml | 2 +- features/apimgt-extensions/pom.xml | 2 - .../pom.xml | 49 --------------- .../apis/admin--OAuth2TokenManagement.xml | 1 - .../admin--UserManagementValidateUser.xml | 1 - .../pom.xml | 2 - .../pom.xml | 6 -- features/device-mgt/pom.xml | 2 - .../pom.xml | 8 --- pom.xml | 61 ++----------------- 11 files changed, 8 insertions(+), 132 deletions(-) diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml index 401ad66f4e..a934c7dc4c 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml @@ -107,9 +107,9 @@ org.wso2.carbon.devicemgt:org.wso2.carbon.apimgt.integration.client:${project.version} - - - + + org.wso2.carbon.devicemgt:org.wso2.carbon.apimgt.integration.generated.client:${project.version} + diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml index ff54fb9cb8..067a6af7f8 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml @@ -24,7 +24,7 @@ - https://localhost:9443 + https://${iot.core.host}:${iot.core.https.port} true diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml index 956fdf8d49..3561b8c4d6 100644 --- a/features/apimgt-extensions/pom.xml +++ b/features/apimgt-extensions/pom.xml @@ -35,10 +35,8 @@ http://wso2.org - org.wso2.carbon.apimgt.webapp.publisher.feature org.wso2.carbon.apimgt.application.extension.feature - diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml index 845938c469..f315096d69 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml @@ -43,34 +43,6 @@ org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.common - - - - - - - - - - - - - - - - - - - - - - - - - - - - @@ -127,27 +99,6 @@ org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version} - - - - - - - - - - - - - - - - - - - - - diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml index 23c74aaedb..637f40f776 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--OAuth2TokenManagement.xml @@ -20,7 +20,6 @@ - diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml index 7d26b7b857..ec61d66eec 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/apis/admin--UserManagementValidateUser.xml @@ -20,7 +20,6 @@ - diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml index 0222243bf9..00d4a96a0b 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml @@ -87,8 +87,6 @@ org.wso2.carbon.core.server:${carbon.kernel.version} - - diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml index 4472e7200f..f986e520a0 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml @@ -39,11 +39,6 @@ org.wso2.carbon.device.mgt.server.feature zip - - - - - javax.servlet.jsp javax.servlet.jsp-api @@ -80,7 +75,6 @@ org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.server.feature:${carbon.device.mgt.version} - javax.servlet.jsp:javax.servlet.jsp-api diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index 37bcec882b..528051da15 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -35,11 +35,9 @@ org.wso2.carbon.device.mgt.basics.feature org.wso2.carbon.device.mgt.server.feature - org.wso2.carbon.device.mgt.api.feature org.wso2.carbon.device.mgt.feature org.wso2.carbon.device.mgt.extensions.feature - diff --git a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml index 6d17103c21..de26779b16 100644 --- a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml +++ b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml @@ -73,14 +73,6 @@ org.codehaus.woodstox wstx-asl - - - - - - - - diff --git a/pom.xml b/pom.xml index 22525c77c5..e902abd70c 100644 --- a/pom.xml +++ b/pom.xml @@ -54,11 +54,6 @@ features/jwt-client features/device-mgt-extensions features/transport-mgt - - - - - @@ -241,16 +236,6 @@ org.wso2.carbon.apimgt.webapp.publisher ${carbon.device.mgt.version} - - - - - - - - - - org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.annotations @@ -282,11 +267,6 @@ org.wso2.carbon.device.mgt.analytics.data.publisher ${carbon.device.mgt.version} - - - - - org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.server.feature @@ -305,12 +285,6 @@ zip ${carbon.device.mgt.version} - - - - - - org.wso2.carbon.devicemgt org.wso2.carbon.apimgt.application.extension @@ -326,12 +300,6 @@ org.wso2.carbon.apimgt.application.extension.api ${carbon.device.mgt.version} - - - - - - org.wso2.carbon.devicemgt org.wso2.carbon.device.application.mgt.server.feature @@ -479,7 +447,8 @@ javax.servlet - javax.servlet-api + javax.servlet-api + @@ -828,7 +797,7 @@ org.wso2.carbon org.wso2.carbon.logging - 4.4.9 + ${org.wso2.carbon.logging.version} org.wso2.carbon @@ -1159,17 +1128,6 @@ - - - - - - - - - - - org.apache.cxf cxf-rt-rs-extension-providers @@ -1353,21 +1311,11 @@ gson ${google.gson.version} - - org.wso2.orbit.com.squareup.okhttp - okhttp - ${okhttp.wso2.version} - com.squareup.okhttp3 okhttp ${squareup.okhttp3.version} - - org.wso2.orbit.com.squareup.okio - okio - ${okio.wso2.version} - com.squareup.okio okio @@ -2085,6 +2033,7 @@ 5.1.2 1.3 3.1.3 + 4.4.9 [1.6.1.wso2v11, 1.7.0) @@ -2193,8 +2142,6 @@ 1.3 2.3.1 4.6.0 - 4.2.0.wso2v1 - 2.4.0.wso2v1 1.13.0 9.3.1 1.1.1 From a12be72a1317f3b578f85bc4e84c4ae9f1bec6c2 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Fri, 14 May 2021 10:34:41 +0530 Subject: [PATCH 13/54] updated to kernel 4.6.2 --- .../pom.xml | 29 +++++----- .../APIManagementProviderService.java | 21 -------- .../APIManagementProviderServiceImpl.java | 53 ++++--------------- .../publisher/APIPublisherServiceImpl.java | 4 +- .../pom.xml | 2 +- .../org.wso2.carbon.device.mgt.core/pom.xml | 2 - .../ui/request/interceptor/LoginHandler.java | 2 +- pom.xml | 45 +++++++--------- 8 files changed, 44 insertions(+), 114 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index 3f0f92602b..0282a89040 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -73,11 +73,6 @@ org.wso2.carbon.identity.jwt.client.extension provided - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.core - provided - @@ -109,28 +104,28 @@ org.apache.commons.lang;version="[2.6,3)", org.apache.commons.logging;version="[1.2,2)", - org.json.simple,org.osgi.framework;version="${imp.package.version.osgi.framework}", - org.osgi.service.component;version="${imp.package.version.osgi.service}", - org.wso2.carbon.apimgt.api;version="[9.0,10)", - org.wso2.carbon.apimgt.api.dto;version="[9.0,10)", - org.wso2.carbon.apimgt.api.model;version="[9.0,10)", + org.json.simple, + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", + org.wso2.carbon.apimgt.api;version="${carbon.api.mgt.version.range}", + org.wso2.carbon.apimgt.api.dto;version="${carbon.api.mgt.version.range}", + org.wso2.carbon.apimgt.api.model;version="${carbon.api.mgt.version.range}", org.wso2.carbon.apimgt.application.extension.bean, org.wso2.carbon.apimgt.application.extension.dto, org.wso2.carbon.apimgt.application.extension.exception, - org.wso2.carbon.apimgt.impl;version="[9.0,10)", - org.wso2.carbon.apimgt.impl.utils;version="[9.0,10)", - org.wso2.carbon.context;version="[4.6,5)", - org.wso2.carbon.device.mgt.core.config.ui;version="[4.1,5)", + org.wso2.carbon.apimgt.impl;version="${carbon.api.mgt.version.range}", + org.wso2.carbon.apimgt.impl.utils;version="${carbon.api.mgt.version.range}", + org.wso2.carbon.context;version="${carbon.kernel.version.range}", org.wso2.carbon.identity.jwt.client.extension, org.wso2.carbon.identity.jwt.client.extension.dto, org.wso2.carbon.identity.jwt.client.extension.exception, org.wso2.carbon.identity.jwt.client.extension.service, org.wso2.carbon.registry.core.exceptions;version="[1.0,2)", org.wso2.carbon.registry.core.service;version="[1.0,2)", - org.wso2.carbon.registry.indexing.service;version="[4.7,5)", + org.wso2.carbon.registry.indexing.service;version="${carbon.registry.imp.pkg.version.range}", org.wso2.carbon.user.api;version="[1.0,2)", - org.wso2.carbon.user.core.service;version="[4.6,5)", - org.wso2.carbon.user.core.tenant;version="[4.6,5)" + org.wso2.carbon.user.core.service;version="${carbon.kernel.version.range}", + org.wso2.carbon.user.core.tenant;version="${carbon.kernel.version.range}" !org.wso2.carbon.apimgt.application.extension.internal, diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java index d1bc3911b6..7405737237 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderService.java @@ -50,27 +50,6 @@ public interface APIManagementProviderService { String keyType, String username, boolean isAllowedAllDomains, String validityTime) throws APIManagerException; - /** - * Generate and retreive application keys. if the application does exist then - * create it and subscribe to apis that are grouped with the tags. - * - * @param apiApplicationName name of the application. - * @param tags tags of the apis that application needs to be subscribed. - * @param keyType of the application. - * @param username to whom the application is created - * @param isAllowedAllDomains application is allowed to all the tenants - * @param validityTime validity period of the application - * @param scopes scopes - * @return consumerkey and secrete of the created application. - * @throws APIManagerException - */ - ApiApplicationKey generateAndRetrieveApplicationKeys(String apiApplicationName, - String tags[], - String keyType, - String username, - boolean isAllowedAllDomains, - String validityTime, String scopes) throws APIManagerException; - /** * Remove APIM Application. */ diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java index 3b46ace15f..40d13f7eda 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java @@ -42,8 +42,6 @@ import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.APIManagerFactory; import org.wso2.carbon.apimgt.impl.utils.APIUtil; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.core.config.ui.UIConfiguration; -import org.wso2.carbon.device.mgt.core.config.ui.UIConfigurationManager; import org.wso2.carbon.identity.jwt.client.extension.JWTClient; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; @@ -101,7 +99,7 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe */ @Override public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[], - String keyType, String username, boolean isAllowedAllDomains, String validityTime, String scopes) + String keyType, String username, boolean isAllowedAllDomains, String validityTime) throws APIManagerException { String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); @@ -125,14 +123,14 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe application = new Application(applicationName, subscriber); application.setTier(ApiApplicationConstants.DEFAULT_TIER); application.setGroupId(""); - applicationId = apiConsumer.addApplication(application, username); + apiConsumer.addApplication(application, username); + application = apiConsumer.getApplicationsByName(username, applicationName, ""); } else { - applicationId = application.getId(); subscriber = apiConsumer.getSubscriber(username); } Set subscribedAPIs = - apiConsumer.getSubscribedAPIsByApplicationId(subscriber, applicationId, ""); + apiConsumer.getSubscribedAPIs(subscriber, applicationName, ""); log.info("Already subscribed API count: " + subscribedAPIs.size()); @@ -160,9 +158,11 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe } } if (!subscriptionExist && !tempApiIds.contains(id)) { - ApiTypeWrapper apiTypeWrapper = new ApiTypeWrapper(apiInfo); + ApiTypeWrapper apiTypeWrapper = apiConsumer.getAPIorAPIProductByUUID( + apiInfo.getUuid(), tenantDomain); apiTypeWrapper.setTier(ApiApplicationConstants.DEFAULT_TIER); - apiConsumer.addSubscription(apiTypeWrapper, username, applicationId, ""); + + apiConsumer.addSubscription(apiTypeWrapper, username, application); tempApiIds.add(id); } } @@ -210,31 +210,9 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe "\\\"id_token_expiry_time\\\":\\\"N\\/A\\\"}\"," + "\"username\":\"" + username + "\"}"; - // if scopes not defined - if (StringUtils.isEmpty(scopes)) { - UIConfigurationManager uiConfigurationManager = UIConfigurationManager.getInstance(); - UIConfiguration uiConfiguration = uiConfigurationManager.getUIConfig(); - List scopeList = uiConfiguration.getScopes(); - - if (scopeList != null && scopeList.size() > 0) { - StringBuilder builder = new StringBuilder(); - for (String scope : scopeList) { - String tmpScope = scope + " "; - builder.append(tmpScope); - } - scopes = builder.toString(); - } - - if (StringUtils.isEmpty(scopes)) { - scopes = scopes.trim(); - } else { - scopes = "default"; - } - } - Map keyDetails = apiConsumer .requestApprovalForApplicationRegistration(username, applicationName, keyType, "", - allowedDomains.toArray(new String[allowedDomains.size()]), validityTime, scopes, "", + allowedDomains.toArray(new String[allowedDomains.size()]), validityTime, "default", "", jsonString, keyManagerId, tenantDomain); if (keyDetails != null) { @@ -252,19 +230,6 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe } } - /** - * {@inheritDoc} - */ - @Override - public synchronized ApiApplicationKey generateAndRetrieveApplicationKeys(String applicationName, String tags[], - String keyType, String username, - boolean isAllowedAllDomains, - String validityTime) - throws APIManagerException { - return this.generateAndRetrieveApplicationKeys(applicationName, tags, keyType, username, - isAllowedAllDomains, validityTime, null); - } - @Override public AccessTokenInfo getAccessToken(String scopes, String[] tags, String applicationName, String tokenType, String validityPeriod) throws APIManagerException { diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java index d1312714c1..b1c7769768 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -50,7 +50,7 @@ import java.util.Set; */ public class APIPublisherServiceImpl implements APIPublisherService { private static final String UNLIMITED_TIER = "Unlimited"; - private static final String API_PUBLISH_ENVIRONMENT = "Production and Sandbox"; + private static final String API_PUBLISH_ENVIRONMENT = "Default"; private static final String CREATED_STATUS = "CREATED"; private static final String PUBLISH_ACTION = "Publish"; public static final APIManagerFactory API_MANAGER_FACTORY = APIManagerFactory.getInstance(); @@ -179,7 +179,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { accessControlAllowHeaders.add("Content-Type"); accessControlAllowHeaders.add("SOAPAction"); accessControlAllowHeaders.add("apikey"); - accessControlAllowHeaders.add("testKey"); + accessControlAllowHeaders.add("Internal-Key"); List accessControlAllowMethods = new ArrayList<>(); accessControlAllowMethods.add("GET"); accessControlAllowMethods.add("PUT"); diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index 81ac96adc5..2a60c2797e 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -140,7 +140,7 @@ org.wso2.carbon.context, org.wso2.carbon.device.mgt.common.operation.mgt, org.wso2.carbon.device.mgt.common.push.notification, - org.wso2.carbon.device.mgt.core.service, + org.wso2.carbon.device.mgt.core.*, org.wso2.carbon.event.output.adapter.core, org.wso2.carbon.event.output.adapter.core.exception, org.wso2.carbon.core, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index 68e174db3f..30a8d6fa76 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -119,9 +119,7 @@ org.wso2.carbon.device.mgt.core.* - javax.ws.rs-api, scribe;scope=compile|runtime;inline=false, - javassist;inline=false * diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java index cd0ff14a20..8843f507cc 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java @@ -102,7 +102,7 @@ public class LoginHandler extends HttpServlet { ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys( HandlerConstants.PUBLISHER_APPLICATION_NAME, tagsAsStringArray, HandlerConstants.PRODUCTION_KEY, username, false, - ApiApplicationConstants.DEFAULT_VALIDITY_PERIOD, scopeString); + ApiApplicationConstants.DEFAULT_VALIDITY_PERIOD); if (apiApplicationKey != null && getTokenAndPersistInSession(apiApplicationKey.getConsumerKey(), apiApplicationKey.getConsumerSecret(), req, resp, scopes)) { diff --git a/pom.xml b/pom.xml index e902abd70c..e3e7998167 100644 --- a/pom.xml +++ b/pom.xml @@ -661,10 +661,6 @@ commons-httpclient.wso2 commons-httpclient - - commons-httpclient.wso2 - commons-httpclient - org.wso2.carbon org.wso2.carbon.registry.api @@ -2028,8 +2024,8 @@ 2.2.1 6.1.1 - 4.6.1 - [4.6.0, 5.0.0) + 4.6.2 + [4.5.0, 5.0.0) 5.1.2 1.3 3.1.3 @@ -2057,9 +2053,9 @@ 4.8.2 - 3.6.100.v20120522-1841 + 3.6.200.v20130402-1505 3.3.100.v20120522-1822 - 3.9.1.v20130814-1242 + 3.9.1.v20140110-1610 1.2.140.wso2v3 @@ -2075,19 +2071,19 @@ 5.18.187 [5.2.0, 7.0.0) 6.4.111 - 5.4.6 + 5.5.2 1.0.31 [1.0.31, 2.0.0) - [5.7.0, 6.0.0) - [5.2.0, 7.0.0) - [5.1.0, 7.0.0) + [5.14.0, 6.0.0) + [6.0.0, 7.0.0) + [5.3.0, 6.0.0) - 4.6.11 + 4.9.10 - 4.7.23 + 4.8.21 1.2.11-wso2v10 @@ -2098,7 +2094,7 @@ 4.1.16-SNAPSHOT - 4.6.21 + 4.7.35 1.4.0.wso2v1 [1.4.0,2.0.0) 2.4.0.wso2v1 @@ -2106,8 +2102,8 @@ [2.6.0,3.0.0) - 9.0.5 - (6.0.0,10.0.0] + 9.0.174 + [9.0.0, 10.0.0) 5.1.37 @@ -2117,7 +2113,7 @@ 2.1.23 - 4.7.38 + 4.7.39 ${carbon.registry.version} [4.7.0, 5.0.0) @@ -2135,12 +2131,9 @@ 2.3.0.wso2v2 - - 2.26.1.wso2v3 - 3.0.0.wso2v1 1.3 - 2.3.1 + 2.8.5 4.6.0 1.13.0 9.3.1 @@ -2191,12 +2184,12 @@ 2.0.1 1.5.10 - 1.5.10 + 1.6.1 4.0.1 1.0.10 - 2.6.1.wso2v1 + 2.9.8.wso2v1 2.6.1.wso2v3 2.8.2.wso2v1 1.2.0.wso2v1 @@ -2220,7 +2213,7 @@ 1.7 - 2.1.7-wso2v7 + 2.1.7-wso2v227 1.5.11.wso2v15 @@ -2258,7 +2251,7 @@ 1.0 1.13.1 - 5.1.2.RELEASE + 5.1.13.RELEASE 2.7.18 [1.6.0, 2.0.0) From d5c85980e1555b3360636502899a4b3c9c661a60 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 17 May 2021 12:25:32 +0530 Subject: [PATCH 14/54] move appmgt db creation, application-extension synapse apis, cdm datasource config --- .../src/main/resources/p2.inf | 4 +- .../api/_API_Application_Registration_.xml | 63 ++++++++++++++++++ .../sequences/_api_registration_fault_.xml | 22 +++++++ .../pom.xml | 37 +++++++++++ .../src/main/resources/p2.inf | 1 + .../conf/datasources/cdm-datasources.xml | 65 +++++++++++++++++++ .../src/main/resources/p2.inf | 1 + 7 files changed, 192 insertions(+), 1 deletion(-) create mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/synapse-configs/default/api/_API_Application_Registration_.xml create mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/synapse-configs/default/sequences/_api_registration_fault_.xml create mode 100755 features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/p2.inf b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/p2.inf index 1d8124571f..61654c2892 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/p2.inf +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/p2.inf @@ -1,3 +1,5 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/webapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.apimgt.application.extension_${feature.version}/webapps/,target:${installFolder}/../../deployment/server/webapps/,overwrite:true);\ \ No newline at end of file +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.apimgt.application.extension_${feature.version}/webapps/,target:${installFolder}/../../deployment/server/webapps/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.apimgt.application.extension_${feature.version}/synapse-configs/default/api/_API_Application_Registration_.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/_API_Application_Registration_.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.apimgt.application.extension_${feature.version}/synapse-configs/default/sequences/_api_registration_fault_.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/sequences/_api_registration_fault_.xml,overwrite:true);\ diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/synapse-configs/default/api/_API_Application_Registration_.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/synapse-configs/default/api/_API_Application_Registration_.xml new file mode 100644 index 0000000000..7e25c01342 --- /dev/null +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/synapse-configs/default/api/_API_Application_Registration_.xml @@ -0,0 +1,63 @@ + + + + + + + + + + 60000 + fault + + + + + + + + + + + + + + + + + + 60000 + fault + + + + + + + + + + + + + + + + + + 60000 + fault + + + + + + + + + + + + + + \ No newline at end of file diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/synapse-configs/default/sequences/_api_registration_fault_.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/synapse-configs/default/sequences/_api_registration_fault_.xml new file mode 100644 index 0000000000..335a9abaf3 --- /dev/null +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/src/main/resources/synapse-configs/default/sequences/_api_registration_fault_.xml @@ -0,0 +1,22 @@ + + + + + + diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml index d8a8448fac..dc53590a67 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml @@ -60,6 +60,10 @@ cxf-rt-frontend-jaxrs ${cxf.version} + + com.h2database.wso2 + h2-database-engine + @@ -108,6 +112,39 @@ + + org.apache.maven.plugins + maven-antrun-plugin + + + create-app-mgt-schema + package + + run + + + + + + + + + + + + + + + + + + + + + + + + org.wso2.maven carbon-p2-plugin diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf index a12c244131..1a8247162f 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf @@ -1,4 +1,5 @@ instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/database/,target:${installFolder}/../../../repository/database/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf/application-mgt.xml,target:${installFolder}/../../conf/application-mgt.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf/datasources/application-mgt-datasources.xml,target:${installFolder}/../../conf/datasources/application-mgt-datasources.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/dbscripts/cdm/application-mgt,target:${installFolder}/../../../dbscripts/cdm/application-mgt,overwrite:true);\ diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml new file mode 100755 index 0000000000..78db49688e --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/datasources/cdm-datasources.xml @@ -0,0 +1,65 @@ + + + + + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader + + + + DM_DS + The datasource used for CDM + + jdbc/DM_DS + + + + jdbc:h2:./repository/database/WSO2DM_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000 + wso2carbon + wso2carbon + org.h2.Driver + 50 + 60000 + true + SELECT 1 + 30000 + + + + + DM_ARCHIVAL_DS + The archival datasource used for CDM + + jdbc/DM_ARCHIVAL_DS + + + + jdbc:h2:./repository/database/WSO2DM_ARCHIVAL_DS;DB_CLOSE_ON_EXIT=FALSE + wso2carbon + wso2carbon + org.h2.Driver + 50 + 60000 + true + SELECT 1 + 30000 + + + + + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/p2.inf b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/p2.inf index 09ec420214..d373520aa0 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/p2.inf +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/p2.inf @@ -1,4 +1,5 @@ instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/conf/datasources/cdm-datasources.xml,target:${installFolder}/../../conf/datasources/cdm-datasources.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/conf/cdm-config.xml,target:${installFolder}/../../conf/cdm-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/conf/mdm-ui-config.xml,target:${installFolder}/../../conf/mdm-ui-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/conf/license-config.xml,target:${installFolder}/../../conf/etc/license-config.xml,overwrite:true);\ From 23b25fb54089ff4576dd4976255fd89b9e2f8105 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 18 May 2021 14:50:05 +0530 Subject: [PATCH 15/54] Templated configs --- .../conf/etc/webapp-publisher-config.xml.j2 | 56 ++++ .../src/main/resources/p2.inf | 1 + .../repository/conf/application-mgt.xml.j2 | 231 +++++++++++++ .../application-mgt-datasources.xml.j2 | 59 ++++ .../src/main/resources/p2.inf | 1 + .../repository/conf/certificate-config.xml.j2 | 47 +++ .../src/main/resources/p2.inf | 3 +- .../repository/conf/cdm-config.xml.j2 | 315 ++++++++++++++++++ .../conf/datasources/cdm-datasources.xml.j2 | 87 +++++ .../repository/conf/license-config.xml.j2 | 63 ++++ .../repository/conf/mdm-ui-config.xml.j2 | 211 ++++++++++++ .../conf/remote-appmanager-config.xml.j2 | 32 ++ .../src/main/resources/p2.inf | 3 +- .../datasources/heart-beat-datasources.xml.j2 | 57 ++++ .../repository/conf/heart-beat-config.xml.j2 | 61 ++++ .../src/main/resources/p2.inf | 1 + .../conf/email-sender-config.xml.j2 | 38 +++ .../src/main/resources/p2.inf | 3 +- .../repository/conf/sms-config.xml.j2 | 48 +++ .../src/main/resources/p2.inf | 1 + 20 files changed, 1314 insertions(+), 4 deletions(-) create mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-publisher-config.xml.j2 create mode 100644 features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 create mode 100644 features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/application-mgt-datasources.xml.j2 create mode 100755 features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/certificate-config.xml.j2 create mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2 create mode 100755 features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/cdm-datasources.xml.j2 create mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/license-config.xml.j2 create mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 create mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/remote-appmanager-config.xml.j2 create mode 100644 features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/heart-beat-datasources.xml.j2 create mode 100644 features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/conf_templates/templates/repository/conf/heart-beat-config.xml.j2 create mode 100644 features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/conf_templates/templates/repository/conf/email-sender-config.xml.j2 create mode 100644 features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-publisher-config.xml.j2 b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-publisher-config.xml.j2 new file mode 100644 index 0000000000..d8a0413ec8 --- /dev/null +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-publisher-config.xml.j2 @@ -0,0 +1,56 @@ + + + + + + + + {% if webapp_publisher_configs.host is defined %} + {{webapp_publisher_configs.host}} + {% else %} + https://${iot.core.host}:${iot.core.https.port} + {% endif %} + + + {% if webapp_publisher_configs.publish_api is defined %} + {{webapp_publisher_configs.publish_api}} + {% else %} + true + {% endif %} + + + {% if webapp_publisher_configs.enable_update_api is defined %} + {{webapp_publisher_configs.enable_update_api}} + {% else %} + true + {% endif %} + + + + default + {% if webapp_publisher_configs.profiles is defined %} + {%- for profile in webapp_publisher_configs.profiles -%} + {{profile}} + {% endfor %} + {% endif %} + + \ No newline at end of file diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/p2.inf b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/p2.inf index 3d6782a96f..8b5d94e410 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/p2.inf +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/p2.inf @@ -1,2 +1,3 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.apimgt.webapp.publisher_${feature.version}/conf/webapp-publisher-config.xml,target:${installFolder}/../../conf/etc/webapp-publisher-config.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.apimgt.webapp.publisher_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 new file mode 100644 index 0000000000..8774964271 --- /dev/null +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 @@ -0,0 +1,231 @@ + + + + + + jdbc/APPM_DS + + + + {% if application_mgt_conf.extension.application_manager is defined %} + {{application_mgt_conf.extension.application_manager}} + {% else %} + org.wso2.carbon.device.application.mgt.core.impl.ApplicationManagerImpl + {% endif %} + + + {% if application_mgt_conf.extension.review_manager is defined %} + {{application_mgt_conf.extension.review_manager}} + {% else %} + org.wso2.carbon.device.application.mgt.core.impl.ReviewManagerImpl + {% endif %} + + + {% if application_mgt_conf.extension.life_cycle_state_manager is defined %} + {{application_mgt_conf.extension.life_cycle_state_manager}} + {% else %} + org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager + {% endif %} + + + {% if application_mgt_conf.extension.subscription_manager is defined %} + {{application_mgt_conf.extension.subscription_manager}} + {% else %} + org.wso2.carbon.device.application.mgt.core.impl.SubscriptionManagerImpl + {% endif %} + + + {% if application_mgt_conf.extension.application_storage_manager is defined %} + {{application_mgt_conf.extension.application_storage_manager}} + {% if application_mgt_conf.extension.application_storage_manager.parameter_options is defined %} + + {% for property_name,property_value in application_mgt_conf.extension.application_storage_manager.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% endif %} + {% else %} + org.wso2.carbon.device.application.mgt.core.impl.ApplicationStorageManagerImpl + + repository/resources/apps/ + 6 + + {% endif %} + + + + + + + + + + true + true + true + /app-mgt/life-cycle/application/create + + In-Review + + + + /app-mgt/life-cycle/application/review + + Rejected + Approved + Created + + + + /app-mgt/life-cycle/application/approve + + In-Review + Published + + + + true + /app-mgt/life-cycle/application/reject + + In-Review + + + + true + /app-mgt/life-cycle/application/publish + + Blocked + Deprecated + + + + /app-mgt/life-cycle/application/block + + Published + Deprecated + + + + /app-mgt/life-cycle/application/deprecate + + Published + Retired + + + + true + /app-mgt/life-cycle/application/retire + + + + + EMM + IoT + Art & Design + Auto & Vehicles + Beauty + Books & Reference + Business + Comics + Communications + Dating + Education + Entertainment + Events + Finance + Food & Drink + Health & Fitness + House & Home + Libraries & Demo + Lifestyle + Maps & Navigation + Medical + Music & Audio + News & Magazines + Parenting + Personalization + Photography + Productivity + Shopping + Social + Sports + Tools + Travel & Local + Video Players & Editors + Weather + GooglePlaySyncedApp + {% if application_mgt_conf.app_categories is defined %} + {%- for app_category in application_mgt_conf.app_categories -%} + {{app_category}} + {% endfor %} + {% endif %} + + + + {% if application_mgt_conf.rating_conf.min_rating_value is defined %} + {{application_mgt_conf.rating_conf.min_rating_value}} + {% else %} + 1 + {% endif %} + {% if application_mgt_conf.rating_conf.max_rating_value is defined %} + {{application_mgt_conf.rating_conf.max_rating_value}} + {% else %} + 10 + {% endif %} + + + + {% if application_mgt_conf.mdm_conf.artifact_download_protocol is defined %} + {{application_mgt_conf.mdm_conf.artifact_download_protocol}} + {% else %} + http + {% endif %} + + {% if application_mgt_conf.mdm_conf.artifact_download_endpoint is defined %} + {{application_mgt_conf.mdm_conf.artifact_download_endpoint}} + {% else %} + /api/application-mgt/v1.0/artifact + {% endif %} + + diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/application-mgt-datasources.xml.j2 b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/application-mgt-datasources.xml.j2 new file mode 100644 index 0000000000..a25faf6511 --- /dev/null +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/application-mgt-datasources.xml.j2 @@ -0,0 +1,59 @@ + + + + + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader + + + + + + APPM_DS + The datasource used for CDM Application Management + + jdbc/APPM_DS + + + + {% if database.app_mgt is defined %} + {{database.app_mgt.url}} + {{database.app_mgt.username}} + {{database.app_mgt.password}} + {{database.app_mgt.driver}} + {{database.app_mgt.validationQuery}} + {% for property_name,property_value in database.app_mgt.pool_options.items() %} + <{{property_name}}>{{property_value}} + {% endfor %} + {% else %} + jdbc:h2:./repository/database/WSO2DM_APPM_DB;DB_CLOSE_ON_EXIT=FALSE + wso2carbon + wso2carbon + org.h2.Driver + 50 + 60000 + true + SELECT 1 + 30000 + {% endif %} + + + + + + diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf index 1a8247162f..360d6ef9f9 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf @@ -3,6 +3,7 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf/application-mgt.xml,target:${installFolder}/../../conf/application-mgt.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf/datasources/application-mgt-datasources.xml,target:${installFolder}/../../conf/datasources/application-mgt-datasources.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/dbscripts/cdm/application-mgt,target:${installFolder}/../../../dbscripts/cdm/application-mgt,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ instructions.unconfigure = \ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/datasources/application-mgt-datasources.xml);\ diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/certificate-config.xml.j2 b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/certificate-config.xml.j2 new file mode 100755 index 0000000000..2ffad144e2 --- /dev/null +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/certificate-config.xml.j2 @@ -0,0 +1,47 @@ + + + + {% if certificate_conf.certificate_keystore is defined %} + + {{certificate_conf.certificate_keystore.location}} + + {{certificate_conf.certificate_keystore.type}} + + {{certificate_conf.certificate_keystore.password}} + + {{certificate_conf.certificate_keystore.cacert_alias}} + + {{certificate_conf.certificate_keystore.cacert_password}} + + {{certificate_conf.certificate_keystore.racert_alias}} + + {{certificate_conf.certificate_keystore.racert_password}} + {% else %} + + ${carbon.home}/repository/resources/security/wso2certs.jks + + JKS + + wso2carbon + + cacert + + cacert + + racert + + racert + {% endif %} + + + + + + + jdbc/DM_DS + + + + + 10 + \ No newline at end of file diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/src/main/resources/p2.inf b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/src/main/resources/p2.inf index ef6d64fc87..345f751daa 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/src/main/resources/p2.inf +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/src/main/resources/p2.inf @@ -1,4 +1,5 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.certificate.mgt.server_${feature.version}/conf/wso2certs.jks,target:${installFolder}/../../resources/security/wso2certs.jks,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.certificate.mgt.server_${feature.version}/conf/certificate-config.xml,target:${installFolder}/../../conf/certificate-config.xml,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.certificate.mgt.server_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts,overwrite:true);\ \ No newline at end of file +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.certificate.mgt.server_${feature.version}/dbscripts/,target:${installFolder}/../../../dbscripts,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.certificate.mgt.server_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2 new file mode 100644 index 0000000000..214ad3f8a8 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2 @@ -0,0 +1,315 @@ + + + + + + + + jdbc/DM_DS + + + + + {% if device_mgt_conf.push_notification_conf is defined %} + {{device_mgt_conf.push_notification_conf.scheduler_batch_size}} + {{device_mgt_conf.push_notification_conf.scheduler_batch_delay_mills}} + {{device_mgt_conf.push_notification_conf.scheduler_task_initial_delay}} + {{device_mgt_conf.push_notification_conf.scheduler_task_enabled}} + {% else %} + 1000 + 60000 + 60000 + true + {% endif %} + + org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.FCMBasedPushNotificationProvider + org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.MQTTBasedPushNotificationProvider + org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.HTTPBasedPushNotificationProvider + org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.XMPPBasedPushNotificationProvider + {% if device_mgt_conf.push_notification_conf.push_notification_providers is defined %} + {%- for push_notification_provider in device_mgt_conf.push_notification_conf.push_notification_providers -%} + {{push_notification_provider}} + {% endfor %} + {% endif %} + + + + {% if device_mgt_conf.pull_notification_conf is defined %} + {{device_mgt_conf.pull_notification_conf.enabled}} + {% else %} + false + {% endif %} + + + {% if device_mgt_conf.identity_conf is defined %} + {{device_mgt_conf.identity_conf.server_url}} + {{device_mgt_conf.identity_conf.admin_username}} + {{device_mgt_conf.identity_conf.admin_password}} + {% else %} + https://localhost:9443 + admin + admin + {% endif %} + + + {% if device_mgt_conf.key_manager_conf is defined %} + {{device_mgt_conf.key_manager_conf.server_url}} + {{device_mgt_conf.key_manager_conf.admin_username}} + {{device_mgt_conf.key_manager_conf.admin_password}} + {% else %} + https://localhost:9443 + admin + admin + {% endif %} + + + {% if device_mgt_conf.policy_conf is defined %} + {{device_mgt_conf.policy_conf.monitoring_class}} + {{device_mgt_conf.policy_conf.monitoring_enable}} + {{device_mgt_conf.policy_conf.monitoring_frequency}} + {{device_mgt_conf.policy_conf.max_retries}} + {{device_mgt_conf.policy_conf.min_retries_to_mark_unreachable}} + {{device_mgt_conf.policy_conf.min_retries-to_mark_inactive}} + + + + {{device_mgt_conf.policy_conf.policy.evaluation_point}} + {{device_mgt_conf.policy_conf.cache_enable}} + {% else %} + org.wso2.carbon.policy.mgt + true + 60000 + 5 + 8 + 20 + + + + Simple + true + {% endif %} + + + + {% if device_mgt_conf.pagination_conf is defined %} + {{device_mgt_conf.pagination_conf.device_list_page_size}} + {{device_mgt_conf.pagination_conf.group_list_page_size}} + {{device_mgt_conf.pagination_conf.notification_list_page_size}} + {{device_mgt_conf.pagination_conf.activity_list_page_size}} + {{device_mgt_conf.pagination_conf.operation_list_page_size}} + {{device_mgt_conf.pagination_conf.topic_list_page_size}} + {{device_mgt_conf.pagination_conf.metadata_list_page_size}} + {% else %} + 20 + 20 + 20 + 20 + 20 + 20 + 20 + {% endif %} + + + + {% if device_mgt_conf.device_status_task_config is defined %} + {{device_mgt_conf.device_status_task_config.enable}} + {% else %} + true + {% endif %} + + + + {% if device_mgt_conf.device_cache_conf is defined %} + {{device_mgt_conf.device_cache_conf.enable}} + {{device_mgt_conf.device_cache_conf.expiry_time}} + + {{device_mgt_conf.device_cache_conf.capacity}} + {% else %} + true + 600 + + 10000 + {% endif %} + + + {% if device_mgt_conf.geo_fence_cache_conf is defined %} + {{device_mgt_conf.geo_fence_cache_conf.enable}} + {{device_mgt_conf.geo_fence_cache_conf.expiry_time}} + {{device_mgt_conf.geo_fence_cache_conf.capacity}} + {% else %} + true + 600 + 10000 + {% endif %} + + + {% if device_mgt_conf.event_operation_task_conf is defined %} + {{device_mgt_conf.event_operation_task_conf.enable}} + {% else %} + true + {% endif %} + + + {% if device_mgt_conf.certificate_cache_conf is defined %} + {{device_mgt_conf.certificate_cache_conf.enable}} + {{device_mgt_conf.certificate_cache_conf.expiry_time}} + {% else %} + true + 86400 + {% endif %} + + + + + jdbc/DM_ARCHIVAL_DS + + + + {% if device_mgt_conf.archival_conf.archival_task is defined %} + {{device_mgt_conf.archival_conf.archival_task.enabled}} + {{device_mgt_conf.archival_conf.archival_task.archival_pending_operations}} + + DM_DB + ARCHIVAL_DB + + {{device_mgt_conf.archival_conf.archival_task.task_class}} + + {{device_mgt_conf.archival_conf.archival_task.cron_expression}} + + {{device_mgt_conf.archival_conf.archival_task.retention_period}} + {{device_mgt_conf.archival_conf.archival_task.execution_batch_size}} + + {{device_mgt_conf.archival_conf.archival_task.purging_task.enabled}} + {{device_mgt_conf.archival_conf.archival_task.purging_task.task_class}} + + {{device_mgt_conf.archival_conf.archival_task.purging_task.cron_expression}} + + {{device_mgt_conf.archival_conf.archival_task.purging_task.retention_period}} + + {% else %} + false + false + + DM_DB + ARCHIVAL_DB + + org.wso2.carbon.device.mgt.core.task.impl.ArchivalTask + + 0 0 0 1/1 * ? * + + 30 + 1000 + + false + org.wso2.carbon.device.mgt.core.task.impl.ArchivedDataDeletionTask + + 0 0 3 1/1 * ? * + + 365 + + {% endif %} + + + + {% if device_mgt_conf.geo_location_conf is defined %} + {{device_mgt_conf.geo_location_conf.enabled}} + {% else %} + false + {% endif %} + + + false + false + + false + + + + + * + + + + + + {% if device_mgt_conf.remote_session_conf is defined %} + {{device_mgt_conf.remote_session_conf.enabled}} + {{device_mgt_conf.remote_session_conf.remote_session_server_url}} + {{device_mgt_conf.remote_session_conf.max_http_connection_per_host}} + {{device_mgt_conf.remote_session_conf.max_total_http_connections}} + {{device_mgt_conf.remote_session_conf.max_messages_per_second}} + {{device_mgt_conf.remote_session_conf.session_idle_timeout}} + {{device_mgt_conf.remote_session_conf.max_message_buffer.size}} + {% else %} + true + ws://localhost:9763 + 2 + 100 + 20 + 15 + 640 + {% endif %} + + {% if device_mgt_conf.default_groups_conf is defined %} + {{device_mgt_conf.default_groups_conf}} + {% else %} + BYOD,COPE + {% endif %} + + {% if device_mgt_conf.enrolement_notification_conf is defined %} + {{device_mgt_conf.enrolement_notification_conf.enabled}} + {{device_mgt_conf.enrolement_notification_conf.notify_through_extension}} + {{device_mgt_conf.enrolement_notification_conf.extension_class}} + {{device_mgt_conf.enrolement_notification_conf.notify_internal_host}} + {% else %} + false + false + org.wso2.carbon.device.mgt.common.enrollment.notification.EnrollmentNotifier + http://localhost:8280 + {% endif %} + + + {% if device_mgt_conf.default_roles is defined %} + {{device_mgt_conf.default_roles.enabled}} + {% else %} + false + {% endif %} + + + test_role + + /permission/admin/Login + + + + + + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/cdm-datasources.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/cdm-datasources.xml.j2 new file mode 100755 index 0000000000..e9105a8d3e --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/cdm-datasources.xml.j2 @@ -0,0 +1,87 @@ + + + + + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader + + + + DM_DS + The datasource used for CDM + + jdbc/DM_DS + + + + {% if database.device_mgt is defined %} + {{database.device_mgt.url}} + {{database.device_mgt.username}} + {{database.device_mgt.password}} + {{database.device_mgt.driver}} + {{database.device_mgt.validationQuery}} + {% for property_name,property_value in database.device_mgt.pool_options.items() %} + <{{property_name}}>{{property_value}} + {% endfor %} + {% else %} + jdbc:h2:./repository/database/WSO2DM_DB;DB_CLOSE_ON_EXIT=FALSE;AUTO_SERVER=TRUE;LOCK_TIMEOUT=60000 + wso2carbon + wso2carbon + org.h2.Driver + 50 + 60000 + true + SELECT 1 + 30000 + {% endif %} + + + + + DM_ARCHIVAL_DS + The archival datasource used for CDM + + jdbc/DM_ARCHIVAL_DS + + + + {% if database.device_mgt_archival is defined %} + {{database.device_mgt_archival.url}} + {{database.device_mgt_archival.username}} + {{database.device_mgt_archival.password}} + {{database.device_mgt_archival.driver}} + {{database.device_mgt_archival.validationQuery}} + {% for property_name,property_value in database.device_mgt_archival.pool_options.items() %} + <{{property_name}}>{{property_value}} + {% endfor %} + {% else %} + jdbc:h2:./repository/database/WSO2DM_ARCHIVAL_DS;DB_CLOSE_ON_EXIT=FALSE + wso2carbon + wso2carbon + org.h2.Driver + 50 + 60000 + true + SELECT 1 + 30000 + {% endif %} + + + + + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/license-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/license-config.xml.j2 new file mode 100644 index 0000000000..ab2e462b42 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/license-config.xml.j2 @@ -0,0 +1,63 @@ + + + + + + + wso2 + android + 1.0.0 + 1.0.0 + 01-01-2014 + 31-12-2035 + + + + wso2 + ios + 1.0.0 + 1.0.0 + 01-01-2014 + 31-12-2035 + + + + wso2 + windows + 1.0.0 + 1.0.0 + 01-01-2014 + 31-12-2035 + + + {% if license_conf.licenses is defined %} + {%- for license in license_conf.licenses -%} + + {{license.provider}} + {{license.name}} + {{license.version}} + {{license.language}} + {{license.valid_from}} + {{license.valid-to}} + {{license.text}} + + {% endfor %} + {% endif %} + + \ No newline at end of file diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 new file mode 100644 index 0000000000..64ccc89949 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 @@ -0,0 +1,211 @@ + + + + + {% if mdm_ui_conf.enable_oauth is defined %} + {{mdm_ui_conf.enable_oauth}} + {% else %} + true + {% endif %} + {% if mdm_ui_conf.enable_sso is defined %} + {{mdm_ui_conf.enable_sso}} + {% else %} + false + {% endif %} + + + application_management + device_management + subscription_management + review_management + {% if mdm_ui_conf.app_registration.tags is defined %} + {%- for tag in mdm_ui_conf.app_registration.tags -%} + {{tag}} + {% endfor %} + {% endif %} + + {% if mdm_ui_conf.app_registration.allow_to_all_domains is defined %} + {{mdm_ui_conf.app_registration.allow_to_all_domains}} + {% else %} + true + {% endif %} + + + perm:app:review:view + perm:app:review:update + perm:app:publisher:view + perm:app:publisher:update + perm:app:store:view + perm:app:subscription:install + perm:app:subscription:uninstall + perm:admin:app:review:update + perm:admin:app:review:view + perm:admin:app:publisher:update + perm:admin:app:review:update + perm:admin:app:subscription:view + perm:device-types:types + perm:enterprise:modify + perm:enterprise:view + perm:android-work:customer + perm:android-work:admin + perm:application-command:modify + perm:sign-csr + perm:admin:devices:view + perm:admin:topics:view + perm:roles:add + perm:roles:add-users + perm:roles:update + perm:roles:permissions + perm:roles:details + perm:roles:view + perm:roles:create-combined-role + perm:roles:delete + perm:dashboard:vulnerabilities + perm:dashboard:non-compliant-count + perm:dashboard:non-compliant + perm:dashboard:by-groups + perm:dashboard:device-counts + perm:dashboard:feature-non-compliant + perm:dashboard:count-overview + perm:dashboard:filtered-count + perm:dashboard:details + perm:get-activity + perm:devices:delete + perm:devices:applications + perm:devices:effective-policy + perm:devices:compliance-data + perm:devices:features + perm:devices:operations + perm:devices:search + perm:devices:details + perm:devices:update + perm:devices:view + perm:view-configuration + perm:manage-configuration + perm:policies:remove + perm:policies:priorities + perm:policies:deactivate + perm:policies:get-policy-details + perm:policies:manage + perm:policies:activate + perm:policies:update + perm:policies:changes + perm:policies:get-details + perm:users:add + perm:users:details + perm:users:count + perm:users:delete + perm:users:roles + perm:users:user-details + perm:users:credentials + perm:users:search + perm:users:is-exist + perm:users:update + perm:users:send-invitation + perm:admin-users:view + perm:admin:devices:update-enrollment + perm:groups:devices + perm:groups:update + perm:groups:add + perm:groups:device + perm:groups:devices-count + perm:groups:remove + perm:groups:groups + perm:groups:groups-view + perm:groups:share + perm:groups:count + perm:groups:roles + perm:groups:devices-remove + perm:groups:devices-add + perm:groups:assign + perm:device-types:configs + perm:device-types:features + perm:device-types:types + perm:applications:install + perm:applications:uninstall + perm:admin-groups:count + perm:admin-groups:view + perm:admin-groups:add + perm:notifications:mark-checked + perm:notifications:view + perm:admin:certificates:delete + perm:admin:certificates:details + perm:admin:certificates:view + perm:admin:certificates:add + perm:admin:certificates:verify + perm:admin + perm:devicetype:deployment + perm:device-types:events + perm:device-types:events:view + perm:admin:device-type + perm:admin:device-type:view + perm:admin:device-type:configs + perm:device:enroll + perm:geo-service:analytics-view + perm:geo-service:alerts-manage + appm:read + perm:devices:permanent-delete + perm:android:manage-configuration + perm:android:view-configuration + perm:user:permission-view + perm:ios:view-configuration + perm:ios:manage-configuration + perm:ios:dep-view + perm:ios:dep-add + perm:windows:view-configuration + perm:windows:manage-configuration + perm:android:lock-devices + perm:android:unlock-devices + perm:android:location + perm:android:clear-password + perm:android:control-camera + perm:android:enterprise-wipe + perm:android:wipe + perm:android:ring + perm:android:applications + perm:android:reboot + perm:android:change-LockTask + perm:android:mute + perm:android:configure-display-message + perm:android:send-app-restrictions + perm:android:file-transfer + perm:android:set-webclip + perm:android:set-password-policy + perm:android:change-lock-code + perm:android:upgrade-firmware + perm:android:send-notification + perm:geo-service:geo-fence + perm:metadata:view + perm:metadata:create + perm:metadata:update + {% if mdm_ui_conf.scopes is defined %} + {%- for scope in mdm_ui_conf.scopes -%} + {{scope}} + {% endfor %} + {% endif %} + + + {% if mdm_ui_conf.sso_conf is defined %} + {{mdm_ui_conf.sso_conf.issuer}} + {% else %} + device-mgt + {% endif %} + + + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/remote-appmanager-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/remote-appmanager-config.xml.j2 new file mode 100644 index 0000000000..5f752a4983 --- /dev/null +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/remote-appmanager-config.xml.j2 @@ -0,0 +1,32 @@ + + + + + {% if app_management_conf is defined %} + {{app_management_conf.enable}} + {{app_management_conf.app_manager_url}} + {{app_management_conf.consumer_key}} + {{app_management_conf.consumer_secret}} + {% else %} + true + http:/www.google.com + http:/www.google.com + http:/www.google.com + {% endif %} + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/p2.inf b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/p2.inf index d373520aa0..5ebad17202 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/p2.inf +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/p2.inf @@ -8,5 +8,4 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/rxts/license.rxt,target:${installFolder}/../../../repository/resources/rxts/license.rxt,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../../repository/resources/email-templates);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/email/templates,target:${installFolder}/../../../repository/resources/email-templates,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/apis/admin--OAuth2TokenManagement.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--OAuth2TokenManagement.xml,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/apis/admin--UserManagementValidateUser.xml,target:${installFolder}/../../deployment/server/synapse-configs/default/api/admin--UserManagementValidateUser.xml,overwrite:true);\ \ No newline at end of file +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.basics_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ diff --git a/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/heart-beat-datasources.xml.j2 b/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/heart-beat-datasources.xml.j2 new file mode 100644 index 0000000000..524f28c42a --- /dev/null +++ b/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/heart-beat-datasources.xml.j2 @@ -0,0 +1,57 @@ + + + + org.wso2.carbon.ndatasource.rdbms.RDBMSDataSourceReader + + + + HeartBeat_DS + The datasource Server Heart Beat + + jdbc/HeartBeat_DS + + + + {% if database.heart_beat is defined %} + {{database.heart_beat.url}} + {{database.heart_beat.username}} + {{database.heart_beat.password}} + {{database.heart_beat.driver}} + {{database.heart_beat.validationQuery}} + {% for property_name,property_value in database.heart_beat.pool_options.items() %} + <{{property_name}}>{{property_value}} + {% endfor %} + {% else %} + jdbc:mysql://localhost:3306/heart_beat + root + root + com.mysql.jdbc.Driver + 50 + 60000 + true + SELECT 1 + 30000 + {% endif %} + + + + + + diff --git a/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/conf_templates/templates/repository/conf/heart-beat-config.xml.j2 b/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/conf_templates/templates/repository/conf/heart-beat-config.xml.j2 new file mode 100644 index 0000000000..8d2776fc38 --- /dev/null +++ b/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/conf_templates/templates/repository/conf/heart-beat-config.xml.j2 @@ -0,0 +1,61 @@ + + + + + + + + + jdbc/HeartBeat_DS + + + {% if heart_beat_beacon_conf is defined %} + {{heart_beat_beacon_conf.enable}} + {{heart_beat_beacon_conf.notifier_initial_delay_in_seconds}} + {{heart_beat_beacon_conf.notifier_frequency_in_seconds}} + {{heart_beat_beacon_conf.time_skew_in_seconds}} + {{heart_beat_beacon_conf.sever_timeout_interval_in_seconds}} + {% else %} + false + 30 + 300 + 5 + 600 + {% endif %} + diff --git a/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/p2.inf b/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/p2.inf index 6add373677..55584ad49a 100644 --- a/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/p2.inf +++ b/features/heartbeat-management/io.entgra.server.heart.beat.feature/src/main/resources/p2.inf @@ -2,6 +2,7 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.server.heart.beat_${feature.version}/datasources/,target:${installFolder}/../../conf/datasources/,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.server.heart.beat_${feature.version}/conf/heart-beat-config.xml,target:${installFolder}/../../conf/heart-beat-config.xml,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.server.heart.beat_${feature.version}/dbscripts/heart-beat/,target:${installFolder}/../../../dbscripts/heart-beat,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.server.heart.beat_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ instructions.unconfigure = \ org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/datasources/heart-beat-datasources.xml);\ diff --git a/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/conf_templates/templates/repository/conf/email-sender-config.xml.j2 b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/conf_templates/templates/repository/conf/email-sender-config.xml.j2 new file mode 100644 index 0000000000..f59e8fbf53 --- /dev/null +++ b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/conf_templates/templates/repository/conf/email-sender-config.xml.j2 @@ -0,0 +1,38 @@ + + + + {% if email_sender_conf is defined %} + {{email_sender_conf.min_threads}} + + {{email_sender_conf.max_threads}} + + {{email_sender_conf.keep_alive_duration}} + + {{email_sender_conf.thread_queue_capacity}} + {% else %} + 8 + + 100 + + 20 + + 1000 + {% endif %} + + diff --git a/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/p2.inf b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/p2.inf index d4dadf6a1e..03d6cc09f9 100644 --- a/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/p2.inf +++ b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/src/main/resources/p2.inf @@ -1,3 +1,4 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.email.sender_${feature.version}/conf/email-sender-config.xml,target:${installFolder}/../../conf/etc/email-sender-config.xml,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.email.sender_${feature.version}/email/templates,target:${installFolder}/../../../repository/resources/email-templates,overwrite:true);\ \ No newline at end of file +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.email.sender_${feature.version}/email/templates,target:${installFolder}/../../../repository/resources/email-templates,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.email.sender_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 new file mode 100644 index 0000000000..7f8cd7359b --- /dev/null +++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 @@ -0,0 +1,48 @@ + + + + + + + + + + + sample + +94 + 160 + + + {% if sms_conf.gateways is defined %} + {%- for gateway in sms_conf.gateways -%} + + + sample + +94 + 160 + {% for property_name,property_value in gateway.properties_options.items() %} + {{property_value}} + {% endfor %} + + + {% endfor %} + {% endif %} + + diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/p2.inf b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/p2.inf index af486db59b..958e75d3ab 100644 --- a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/p2.inf +++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/p2.inf @@ -1,4 +1,5 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.transport.mgt.sms.handler.server_${feature.version}/conf/sms-config.xml,target:${installFolder}/../../conf/sms-config.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.transport.mgt.sms.handler.server_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ instructions.unconfigure = \ From 0162753d6aa3f71d4d503ef300d81788cf03f562 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Wed, 19 May 2021 11:16:22 +0530 Subject: [PATCH 16/54] Fixed SSO --- .../APIManagementProviderServiceImpl.java | 1 + .../ui/request/interceptor/LoginHandler.java | 68 +++++++------------ .../interceptor/SsoLoginCallbackHandler.java | 5 +- .../request/interceptor/SsoLoginHandler.java | 10 ++- .../interceptor/util/HandlerConstants.java | 4 +- .../src/main/resources/conf/mdm-ui-config.xml | 2 +- .../repository/conf/mdm-ui-config.xml.j2 | 2 +- .../src/main/resources/p2.inf | 1 + .../resources/payloads/get-app-request.xml | 8 +++ .../resources/payloads/update-app-request.xml | 55 +++++++++++++++ 10 files changed, 105 insertions(+), 51 deletions(-) create mode 100644 features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/get-app-request.xml create mode 100644 features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java index 40d13f7eda..99dde8d4b3 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/src/main/java/org/wso2/carbon/apimgt/application/extension/APIManagementProviderServiceImpl.java @@ -123,6 +123,7 @@ public class APIManagementProviderServiceImpl implements APIManagementProviderSe application = new Application(applicationName, subscriber); application.setTier(ApiApplicationConstants.DEFAULT_TIER); application.setGroupId(""); + application.setTokenType("OAUTH"); apiConsumer.addApplication(application, username); application = apiConsumer.getApplicationsByName(username, applicationName, ""); } else { diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java index 8843f507cc..ed106923b5 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java @@ -24,7 +24,6 @@ import com.google.gson.JsonObject; import com.google.gson.JsonParser; import com.google.gson.JsonSyntaxException; import io.entgra.ui.request.interceptor.beans.AuthData; -import io.entgra.ui.request.interceptor.beans.ProxyResponse; import io.entgra.ui.request.interceptor.exceptions.LoginException; import io.entgra.ui.request.interceptor.util.HandlerConstants; import io.entgra.ui.request.interceptor.util.HandlerUtil; @@ -35,12 +34,8 @@ import org.apache.http.HttpStatus; import org.apache.http.client.methods.HttpPost; import org.apache.http.entity.ContentType; import org.apache.http.entity.StringEntity; -import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; -import org.wso2.carbon.apimgt.application.extension.APIManagementProviderServiceImpl; -import org.wso2.carbon.apimgt.application.extension.constants.ApiApplicationConstants; -import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; -import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; -import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.apache.http.protocol.HTTP; +import io.entgra.ui.request.interceptor.beans.ProxyResponse; import javax.servlet.annotation.MultipartConfig; import javax.servlet.annotation.WebServlet; @@ -49,9 +44,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javax.servlet.http.HttpSession; import java.io.IOException; -import java.util.ArrayList; import java.util.Base64; -import java.util.List; @MultipartConfig @WebServlet("/login") @@ -76,38 +69,28 @@ public class LoginHandler extends HttpServlet { httpSession = req.getSession(true); //setting session to expiry in 5 minutes httpSession.setMaxInactiveInterval(Math.toIntExact(HandlerConstants.TIMEOUT)); - //todo: amalka do we need this remote call? + JsonObject uiConfigJsonObject = HandlerUtil.getUIConfigAndPersistInSession( uiConfigUrl, gatewayUrl, httpSession, resp); JsonArray tags = uiConfigJsonObject.get("appRegistration").getAsJsonObject().get("tags").getAsJsonArray(); JsonArray scopes = uiConfigJsonObject.get("scopes").getAsJsonArray(); - List list = new ArrayList(); - for(int i=0; i < tags.size(); i++) { - list.add(tags.get(i).getAsString()); - } - - String[] tagsAsStringArray = list.toArray(new String[list.size()]); + HttpPost apiRegEndpoint = new HttpPost(gatewayUrl + HandlerConstants.APP_REG_ENDPOINT); + apiRegEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + Base64.getEncoder() + .encodeToString((username + HandlerConstants.COLON + password).getBytes())); + apiRegEndpoint.setHeader(HTTP.CONTENT_TYPE, ContentType.APPLICATION_JSON.toString()); + apiRegEndpoint.setEntity(HandlerUtil.constructAppRegPayload( + tags, HandlerConstants.PUBLISHER_APPLICATION_NAME, username, password)); - String scopeString = HandlerUtil.getScopeString(scopes); + ProxyResponse clientAppResponse = HandlerUtil.execute(apiRegEndpoint); - if (scopeString != null) { - scopeString = scopeString.trim(); - } else { - scopeString = "default"; + if (clientAppResponse.getCode() == HttpStatus.SC_UNAUTHORIZED) { + HandlerUtil.handleError(resp, clientAppResponse); + return; } - - APIManagementProviderService apiManagementProviderService = new APIManagementProviderServiceImpl(); - ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys( - HandlerConstants.PUBLISHER_APPLICATION_NAME, - tagsAsStringArray, HandlerConstants.PRODUCTION_KEY, username, false, - ApiApplicationConstants.DEFAULT_VALIDITY_PERIOD); - - if (apiApplicationKey != null && getTokenAndPersistInSession(apiApplicationKey.getConsumerKey(), - apiApplicationKey.getConsumerSecret(), req, resp, scopes)) { - log.info("tenantDomain : " + PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain()); - log.info("username : " + PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername()); + if (clientAppResponse.getCode() == HttpStatus.SC_CREATED && getTokenAndPersistInSession(req, resp, + clientAppResponse.getData(), scopes)) { ProxyResponse proxyResponse = new ProxyResponse(); proxyResponse.setCode(HttpStatus.SC_OK); HandlerUtil.handleSuccess(resp, proxyResponse); @@ -120,8 +103,6 @@ public class LoginHandler extends HttpServlet { log.error("Error occurred while parsing the response. ", e); } catch (LoginException e) { log.error("Error occurred while getting token data. ", e); - } catch (APIManagerException e) { - log.error("Error occurred while creating application. ", e); } } @@ -129,15 +110,19 @@ public class LoginHandler extends HttpServlet { * Generates token from token endpoint and persists them inside the session * * @param req - {@link HttpServletRequest} -// * @param clientAppResult - clientAppResult + * @param clientAppResult - clientAppResult * @param scopes - scopes defied in the application-mgt.xml * @throws LoginException - login exception throws when getting token result */ - private boolean getTokenAndPersistInSession(String clientId, String clientSecret, HttpServletRequest req, - HttpServletResponse resp, JsonArray scopes) throws LoginException { + private boolean getTokenAndPersistInSession(HttpServletRequest req, HttpServletResponse resp, + String clientAppResult, JsonArray scopes) throws LoginException { JsonParser jsonParser = new JsonParser(); try { - if (clientId != null && clientSecret != null) { + JsonElement jClientAppResult = jsonParser.parse(clientAppResult); + if (jClientAppResult.isJsonObject()) { + JsonObject jClientAppResultAsJsonObject = jClientAppResult.getAsJsonObject(); + String clientId = jClientAppResultAsJsonObject.get("client_id").getAsString(); + String clientSecret = jClientAppResultAsJsonObject.get("client_secret").getAsString(); String encodedClientApp = Base64.getEncoder() .encodeToString((clientId + HandlerConstants.COLON + clientSecret).getBytes()); @@ -189,9 +174,6 @@ public class LoginHandler extends HttpServlet { if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { iotsCorePort = System.getProperty("iot.core.http.port"); } - - String keyManagerPort = System.getProperty("iot.keymanager.https.port"); - username = req.getParameter("username"); password = req.getParameter("password"); gatewayUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.gateway.host") @@ -199,8 +181,8 @@ public class LoginHandler extends HttpServlet { uiConfigUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") + HandlerConstants.COLON + iotsCorePort + HandlerConstants.UI_CONFIG_ENDPOINT; keyManagerUrl = HandlerConstants.HTTPS_PROTOCOL + HandlerConstants.SCHEME_SEPARATOR + - System.getProperty("iot.keymanager.host") + HandlerConstants.COLON + keyManagerPort; - + System.getProperty("iot.keymanager.host") + HandlerConstants.COLON + + System.getProperty("iot.keymanager.https.port"); if (username == null || password == null) { String msg = "Invalid login request. Username or Password is not received for login request."; log.error(msg); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java index 8ee6ec776b..e047b5ba73 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java @@ -60,8 +60,11 @@ public class SsoLoginCallbackHandler extends HttpServlet { + HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme()); String iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") + HandlerConstants.COLON + iotsCorePort; + String keyManagerUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + + System.getProperty("iot.keymanager.host") + HandlerConstants.COLON + + System.getProperty("iot.keymanager.https.port"); - HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(keyManagerUrl + HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + session.getAttribute("encodedClientApp")); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java index 1ade046d43..78b874ac68 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java @@ -69,6 +69,7 @@ public class SsoLoginHandler extends HttpServlet { private static String adminPassword; private static String gatewayUrl; private static String iotsCoreUrl; + private static String keyManagerUrl; private static String encodedAdminCredentials; private static String encodedClientApp; private static String applicationId; @@ -101,7 +102,7 @@ public class SsoLoginHandler extends HttpServlet { */ private void dynamicClientRegistration(HttpServletRequest req, HttpServletResponse resp) { try { - File userMgtConf = new File("conf/user-mgt.xml"); + File userMgtConf = new File("repository/conf/user-mgt.xml"); DocumentBuilderFactory dbFactory = DocumentBuilderFactory.newInstance(); DocumentBuilder dBuilder = dbFactory.newDocumentBuilder(); Document doc = dBuilder.parse(userMgtConf); @@ -123,6 +124,9 @@ public class SsoLoginHandler extends HttpServlet { iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") + HandlerConstants.COLON + iotsCorePort; String uiConfigUrl = iotsCoreUrl + HandlerConstants.UI_CONFIG_ENDPOINT; + keyManagerUrl = HandlerConstants.HTTPS_PROTOCOL + HandlerConstants.SCHEME_SEPARATOR + + System.getProperty("iot.keymanager.host") + HandlerConstants.COLON + + System.getProperty("iot.keymanager.https.port"); httpSession = req.getSession(false); if (httpSession != null) { @@ -211,7 +215,7 @@ public class SsoLoginHandler extends HttpServlet { ProxyResponse updateApplicationGrantTypesEndpointResponse = HandlerUtil.execute(updateApplicationGrantTypesEndpoint); // Update app as a SaaS app - this.updateSaasApp(applicationName); + this.updateSaasApp(applicationId); if (updateApplicationGrantTypesEndpointResponse.getCode() == HttpStatus.SC_UNAUTHORIZED) { HandlerUtil.handleError(resp, updateApplicationGrantTypesEndpointResponse); @@ -262,7 +266,7 @@ public class SsoLoginHandler extends HttpServlet { * @throws IOException IO exception throws if an error occurred when invoking token endpoint */ private ProxyResponse getTokenResult(String encodedClientApp) throws IOException { - HttpPost tokenEndpoint = new HttpPost(gatewayUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(keyManagerUrl + HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + encodedClientApp); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java index bedf62385c..636c5aceeb 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java @@ -25,7 +25,7 @@ public class HandlerConstants { public static final String TOKEN_ENDPOINT = "/oauth2/token"; public static final String INTROSPECT_ENDPOINT = "/oauth2/introspect"; public static final String AUTHORIZATION_ENDPOINT = "/oauth2/authorize"; - public static final String APIM_APPLICATIONS_ENDPOINT = "/api/am/store/v0.12/applications/"; + public static final String APIM_APPLICATIONS_ENDPOINT = "/api/am/devportal/v2/applications/"; public static final String IDENTITY_APP_MGT_ENDPOINT = "/services/IdentityApplicationManagementService.IdentityApplicationManagementServiceHttpsSoap11Endpoint"; public static final String LOGIN_PAGE = "/login"; public static final String SSO_LOGIN_CALLBACK = "/ssoLoginCallback"; @@ -67,7 +67,7 @@ public class HandlerConstants { public static final String OTP_HEADER = "one-time-token"; - public static final String AX_PREFIX = "ax2317:"; + public static final String AX_PREFIX = "ax2251:"; public static final String PAYLOADS_DIR = "repository/resources/payloads"; public static final String SOAP_ACTION_HEADER = "SOAPAction"; diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml index 5bbf9e040b..a0ba89e8b7 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml @@ -19,7 +19,7 @@ true - false + true application_management diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 index 64ccc89949..d15f23de86 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 @@ -26,7 +26,7 @@ {% if mdm_ui_conf.enable_sso is defined %} {{mdm_ui_conf.enable_sso}} {% else %} - false + true {% endif %} diff --git a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/p2.inf b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/p2.inf index 7887868228..d44e4112ef 100644 --- a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/p2.inf +++ b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/p2.inf @@ -4,3 +4,4 @@ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../featur org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.ui.request.interceptor_${feature.version}/webapps/ui-request-handler.war,target:${installFolder}/../../deployment/server/webapps/store-ui-request-handler.war,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.ui.request.interceptor_${feature.version}/webapps/ui-request-handler.war,target:${installFolder}/../../deployment/server/webapps/entgra-ui-request-handler.war,overwrite:true);\ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.ui.request.interceptor_${feature.version}/webapps/ui-request-handler.war,target:${installFolder}/../../deployment/server/webapps/mdm-reports-ui-request-handler.war,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.ui.request.interceptor_${feature.version}/payloads/,target:${installFolder}/../../resources/payloads/,overwrite:true);\ diff --git a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/get-app-request.xml b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/get-app-request.xml new file mode 100644 index 0000000000..45c2042031 --- /dev/null +++ b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/get-app-request.xml @@ -0,0 +1,8 @@ + + + + + ${applicationName} + + + diff --git a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml new file mode 100644 index 0000000000..4f608a9e55 --- /dev/null +++ b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml @@ -0,0 +1,55 @@ + + + + + + + ${applicationId} + ${applicationName} + + ${description} + + + + ${inboundAuthKey} + ${inboundAuthType} + ${inboundConfigType} + + + + + + ${tenantDomain} + ${userName} + ${userStoreDomain} + + ${saasApp} + + + displayName + ${displayName} + + + + + + + From af2f8155e57831d06d8da9e4ef138376bd96e319 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Fri, 21 May 2021 12:32:02 +0530 Subject: [PATCH 17/54] added webapp authenticator component --- .../pom.xml | 14 +-- .../repository/conf/application-mgt.xml.j2 | 10 +- .../conf/webapp-authenticator-config.xml.j2 | 118 ++++++++++++++++++ .../src/main/resources/p2.inf | 1 + pom.xml | 2 + 5 files changed, 133 insertions(+), 12 deletions(-) create mode 100644 features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/webapp-authenticator-config.xml.j2 diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 2d3df3e061..e88716313f 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -63,13 +63,13 @@ javax.xml.bind.annotation, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, javax.xml.validation, - org.apache.catalina, - org.apache.catalina.connector, - org.apache.catalina.util, + + + org.apache.commons.logging, - org.apache.coyote, - org.apache.tomcat.util.buf, - org.apache.tomcat.util.http, + + + org.osgi.service.component, org.osgi.framework, org.w3c.dom, @@ -106,7 +106,7 @@ org.apache.commons.pool.impl, org.apache.http.conn, org.apache.http.impl.conn, - javax.xml.soap; version="${javax.xml.soap.imp.pkg.version}", + javax.xml.stream, org.apache.axiom.*; version="${axiom.osgi.version.range}", org.wso2.carbon.registry.core.*, diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 index 8774964271..2550288629 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 @@ -195,11 +195,11 @@ Video Players & Editors Weather GooglePlaySyncedApp - {% if application_mgt_conf.app_categories is defined %} - {%- for app_category in application_mgt_conf.app_categories -%} - {{app_category}} - {% endfor %} - {% endif %} + {% if application_mgt_conf.app_categories is defined %} + {%- for app_category in application_mgt_conf.app_categories -%} + {{app_category}} + {% endfor %} + {% endif %} diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/webapp-authenticator-config.xml.j2 b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/webapp-authenticator-config.xml.j2 new file mode 100644 index 0000000000..187c9131fe --- /dev/null +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/webapp-authenticator-config.xml.j2 @@ -0,0 +1,118 @@ + + + + OAuth + {% if webapp_auth_conf.authenticator.oauth is defined %} + {{webapp_auth_conf.authenticator.oauth.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.oauth.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.OAuthAuthenticator + + false + https://${iot.keymanager.host}:${iot.keymanager.https.port} + admin + admin + 100 + 100 + + {% endif %} + + + BasicAuth + {% if webapp_auth_conf.authenticator.basic_auth is defined %} + {{webapp_auth_conf.authenticator.basic_auth.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.basic_auth.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.BasicAuthAuthenticator + {% endif %} + + + JWT + {% if webapp_auth_conf.authenticator.jwt is defined %} + {{webapp_auth_conf.authenticator.jwt.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.jwt.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.JWTAuthenticator + + + wso2carbon + wso2carbon + wso2carbon + wso2carbon + + {% endif %} + + + CertificateAuth + {% if webapp_auth_conf.authenticator.certificate_auth is defined %} + {{webapp_auth_conf.authenticator.certificate_auth.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.certificate_auth.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.CertificateAuthenticator + {% endif %} + + + OTPAuth + {% if webapp_auth_conf.authenticator.otpauth is defined %} + {{webapp_auth_conf.authenticator.otpauth.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.otpauth.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.OneTimeTokenAuthenticator + {% endif %} + + + BST + {% if webapp_auth_conf.authenticator.bst is defined %} + {{webapp_auth_conf.authenticator.bst.class_name}} + + {% for property_name,property_value in webapp_auth_conf.authenticator.bst.parameter_options.items() %} + {{property_value}} + {% endfor %} + + {% else %} + org.wso2.carbon.webapp.authenticator.framework.authenticator.BSTAuthenticator + + false + https://${iot.keymanager.host}:${iot.keymanager.https.port} + admin + admin + 100 + 100 + + {% endif %} + + {% if webapp_auth_conf.authenticators is defined %} + {%- for authenticator in webapp_auth_conf.authenticators -%} + + {{authenticator.name}} + {{authenticator.class_name}} + + {% for property_name,property_value in authenticator.parameter_options.items() %} + {{property_value}} + {% endfor %} + + + {% endfor %} + {% endif %} + + diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf index 7b1ad15df1..a526d71269 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/p2.inf @@ -1,2 +1,3 @@ instructions.configure = \ org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.webapp.authenticator.framework.server_${feature.version}/conf/webapp-authenticator-config.xml,target:${installFolder}/../../conf/etc/webapp-authenticator-config.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.webapp.authenticator.framework.server_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ diff --git a/pom.xml b/pom.xml index e3e7998167..afa35d50db 100644 --- a/pom.xml +++ b/pom.xml @@ -44,6 +44,7 @@ components/certificate-mgt components/ui-request-interceptor components/transport-mgt + components/webapp-authenticator-framework features/device-mgt features/apimgt-extensions features/application-mgt @@ -54,6 +55,7 @@ features/jwt-client features/device-mgt-extensions features/transport-mgt + features/webapp-authenticator-framework From b8935487ef5bced8114cd95374e9f13ded005afa Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 7 Jun 2021 15:20:49 +0530 Subject: [PATCH 18/54] updated sim-config j2 file --- .../conf_templates/templates/repository/conf/sms-config.xml.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 index 7f8cd7359b..61f7a16e45 100644 --- a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 +++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 @@ -22,7 +22,7 @@ - + sample From dfb4235a07107abfa413439070664eadcaa7b883 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 7 Jun 2021 17:37:20 +0530 Subject: [PATCH 19/54] fixed sms-config errors --- .../templates/repository/conf/sms-config.xml.j2 | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 index 61f7a16e45..0ffc635427 100644 --- a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 +++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/src/main/resources/conf_templates/templates/repository/conf/sms-config.xml.j2 @@ -22,7 +22,7 @@ - + sample @@ -34,9 +34,6 @@ {%- for gateway in sms_conf.gateways -%} - sample - +94 - 160 {% for property_name,property_value in gateway.properties_options.items() %} {{property_value}} {% endfor %} From 293b5f5a7bbb2bf8f218f6fe10a81d38e3b17a66 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 8 Jun 2021 12:15:48 +0530 Subject: [PATCH 20/54] updated pom versions to 5.0.0-SNAPSHOT --- .../org.wso2.carbon.apimgt.annotations/pom.xml | 3 +-- .../pom.xml | 3 +-- .../org.wso2.carbon.apimgt.application.extension/pom.xml | 3 +-- .../org.wso2.carbon.apimgt.handlers/pom.xml | 3 +-- .../org.wso2.carbon.apimgt.integration.client/pom.xml | 3 +-- .../pom.xml | 3 +-- .../org.wso2.carbon.apimgt.webapp.publisher/pom.xml | 3 +-- components/apimgt-extensions/pom.xml | 3 +-- .../org.wso2.carbon.device.application.mgt.addons/pom.xml | 3 +-- .../org.wso2.carbon.device.application.mgt.api/pom.xml | 3 +-- .../org.wso2.carbon.device.application.mgt.common/pom.xml | 3 +-- .../org.wso2.carbon.device.application.mgt.core/pom.xml | 3 +-- .../pom.xml | 3 +-- .../pom.xml | 3 +-- components/application-mgt/pom.xml | 3 +-- .../org.wso2.carbon.certificate.mgt.api/pom.xml | 2 +- .../pom.xml | 2 +- .../org.wso2.carbon.certificate.mgt.core/pom.xml | 3 +-- components/certificate-mgt/pom.xml | 3 +-- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 2 +- components/device-mgt-extensions/pom.xml | 2 +- .../io.entgra.carbon.device.mgt.config.api/pom.xml | 2 +- .../pom.xml | 2 +- .../org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml | 2 +- .../device-mgt/org.wso2.carbon.device.mgt.api/pom.xml | 8 +++++++- .../device-mgt/org.wso2.carbon.device.mgt.common/pom.xml | 2 +- .../device-mgt/org.wso2.carbon.device.mgt.core/pom.xml | 2 +- .../org.wso2.carbon.device.mgt.extensions/pom.xml | 2 +- .../device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml | 2 +- .../org.wso2.carbon.device.mgt.url.printer/pom.xml | 2 +- components/device-mgt/pom.xml | 2 +- .../io.entgra.server.bootup.heartbeat.beacon/pom.xml | 2 +- components/heartbeat-management/pom.xml | 2 +- .../org.wso2.carbon.device.mgt.oauth.extensions/pom.xml | 3 +-- .../pom.xml | 2 +- .../org.wso2.carbon.identity.jwt.client.extension/pom.xml | 2 +- components/identity-extensions/pom.xml | 2 +- .../org.wso2.carbon.complex.policy.decision.point/pom.xml | 3 +-- .../org.wso2.carbon.policy.decision.point/pom.xml | 3 +-- .../org.wso2.carbon.policy.information.point/pom.xml | 3 +-- .../policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml | 3 +-- .../policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml | 3 +-- components/policy-mgt/pom.xml | 3 +-- .../org.wso2.carbon.email.sender.core/pom.xml | 2 +- components/transport-mgt/email-sender/pom.xml | 2 +- components/transport-mgt/pom.xml | 2 +- .../io.entgra.transport.mgt.sms.handler.api/pom.xml | 2 +- .../io.entgra.transport.mgt.sms.handler.common/pom.xml | 2 +- .../io.entgra.transport.mgt.sms.handler.core/pom.xml | 2 +- components/transport-mgt/sms-handler/pom.xml | 2 +- .../io.entgra.ui.request.interceptor/pom.xml | 3 +-- components/ui-request-interceptor/pom.xml | 2 +- .../pom.xml | 3 +-- components/webapp-authenticator-framework/pom.xml | 3 +-- .../pom.xml | 3 +-- .../org.wso2.carbon.apimgt.handler.server.feature/pom.xml | 3 +-- .../pom.xml | 3 +-- .../pom.xml | 3 +-- features/apimgt-extensions/pom.xml | 3 +-- .../pom.xml | 3 +-- .../pom.xml | 3 +-- features/application-mgt/pom.xml | 3 +-- .../org.wso2.carbon.certificate.mgt.api.feature/pom.xml | 2 +- .../pom.xml | 2 +- .../pom.xml | 3 +-- features/certificate-mgt/pom.xml | 3 +-- .../pom.xml | 3 +-- .../pom.xml | 3 +-- .../pom.xml | 3 +-- .../pom.xml | 3 +-- .../pom.xml | 3 +-- features/device-mgt-extensions/pom.xml | 2 +- .../org.wso2.carbon.device.mgt.analytics.feature/pom.xml | 3 +-- .../org.wso2.carbon.device.mgt.api.feature/pom.xml | 2 +- .../org.wso2.carbon.device.mgt.basics.feature/pom.xml | 2 +- .../org.wso2.carbon.device.mgt.extensions.feature/pom.xml | 3 +-- .../device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml | 2 +- .../org.wso2.carbon.device.mgt.server.feature/pom.xml | 3 +-- .../org.wso2.carbon.device.mgt.ui.feature/pom.xml | 2 +- features/device-mgt/pom.xml | 2 +- .../io.entgra.server.heart.beat.feature/pom.xml | 2 +- features/heartbeat-management/pom.xml | 3 +-- .../pom.xml | 3 +-- features/jwt-client/pom.xml | 3 +-- .../pom.xml | 3 +-- features/oauth-extensions/pom.xml | 3 +-- .../org.wso2.carbon.policy.mgt.server.feature/pom.xml | 3 +-- features/policy-mgt/pom.xml | 3 +-- .../org.wso2.carbon.email.sender.feature/pom.xml | 3 +-- features/transport-mgt/email-sender/pom.xml | 3 +-- features/transport-mgt/pom.xml | 2 +- .../pom.xml | 3 +-- .../pom.xml | 3 +-- features/transport-mgt/sms-handler/pom.xml | 2 +- .../io.entgra.ui.request.interceptor.feature/pom.xml | 2 +- features/ui-request-interceptor/pom.xml | 2 +- .../pom.xml | 3 +-- features/webapp-authenticator-framework/pom.xml | 3 +-- pom.xml | 4 ++-- 104 files changed, 111 insertions(+), 163 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml index a530cbcfa1..aeb8e0168c 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml @@ -22,13 +22,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.annotations - 4.1.16-SNAPSHOT bundle WSO2 Carbon - API Management Annotations WSO2 Carbon - API Management Custom Annotation Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index c99c9d1988..6b0a02043b 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -21,12 +21,11 @@ apimgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 - 4.1.16-SNAPSHOT org.wso2.carbon.apimgt.application.extension.api war WSO2 Carbon - API Application Management API diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index 0282a89040..ae6c1076a2 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -22,12 +22,11 @@ apimgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 - 4.1.16-SNAPSHOT org.wso2.carbon.apimgt.application.extension bundle WSO2 Carbon - API Application Management diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml index 2fbd10211f..aa77bf7ecd 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml @@ -21,13 +21,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handlers - 4.1.16-SNAPSHOT bundle WSO2 Carbon - API Security Handler Component WSO2 Carbon - API Management Security Handler Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml index eeddf628a5..7980d20223 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml @@ -13,13 +13,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.client - 4.1.16-SNAPSHOT bundle WSO2 Carbon - API Management Integration Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml index 22c399e5b7..391979285e 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml @@ -13,13 +13,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.generated.client - 4.1.16-SNAPSHOT bundle WSO2 Carbon - API Management Integration Generated Client WSO2 Carbon - API Management Integration Client diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index b2b587bcd1..1934338712 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -22,13 +22,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher - 4.1.16-SNAPSHOT bundle WSO2 Carbon - API Management Webapp Publisher WSO2 Carbon - API Management Webapp Publisher diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index eea40219af..a692fbbf24 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -22,13 +22,12 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 apimgt-extensions - 4.1.16-SNAPSHOT pom WSO2 Carbon - API Management Extensions Component http://wso2.org diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml index e85664237d..059af5fb7e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml @@ -3,13 +3,12 @@ application-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.addons - 4.1.16-SNAPSHOT WSO2 Carbon - Application Management Add-Ons WSO2 Carbon - Application Management Add-Ons https://entgra.io diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/pom.xml index 591b2f46f1..6a84b225e1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.api/pom.xml @@ -22,13 +22,12 @@ application-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.api - 4.1.16-SNAPSHOT war WSO2 Carbon - Application Management API WSO2 Carbon - Application Management API diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml index 9ebaecc139..9bc4a1dcf4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml @@ -21,13 +21,12 @@ org.wso2.carbon.devicemgt application-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.common - 4.1.16-SNAPSHOT bundle WSO2 Carbon - Application Management Common WSO2 Carbon - Application Management Common diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml index e54526735e..1bf38faaaa 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml @@ -21,13 +21,12 @@ org.wso2.carbon.devicemgt application-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.core - 4.1.16-SNAPSHOT bundle WSO2 Carbon - Application Management Core WSO2 Carbon - Application Management Core diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml index cc88e04256..75586560be 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml @@ -22,13 +22,12 @@ application-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.publisher.api - 4.1.16-SNAPSHOT war WSO2 Carbon - Application Management Publisher API WSO2 Carbon - Application Management Publisher API diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml index c23da83cb2..480264b88a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml @@ -22,13 +22,12 @@ application-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.store.api - 4.1.16-SNAPSHOT war WSO2 Carbon - Application Management Store API WSO2 Carbon - Application Management Store API diff --git a/components/application-mgt/pom.xml b/components/application-mgt/pom.xml index 8d20275116..53a4256688 100644 --- a/components/application-mgt/pom.xml +++ b/components/application-mgt/pom.xml @@ -22,13 +22,12 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 application-mgt - 4.1.16-SNAPSHOT pom WSO2 Carbon - Application Management Component WSO2 Carbon - Application Management Component diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index f77e066ce5..2e4defe98c 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index 743227b322..d5e645e24f 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index 898f828dc5..b129c7affa 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -38,13 +38,12 @@ org.wso2.carbon.devicemgt certificate-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.core - 4.1.16-SNAPSHOT bundle WSO2 Carbon - Certificate Management Core WSO2 Carbon - Certificate Management Core diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml index df7948b53f..ebb7bae8ba 100644 --- a/components/certificate-mgt/pom.xml +++ b/components/certificate-mgt/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt - 4.1.16-SNAPSHOT pom WSO2 Carbon - Certificate Management Component http://wso2.org diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml index 698bba5d44..6116d38fc5 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml index e8f93ec911..ae6ddc3665 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml index a40a895622..821389cf34 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml index 994f41bfe5..4490ef70fa 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index 5b6766bb66..61f896e377 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index 2a60c2797e..9150709a6b 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml index d55cf9ea49..f76390dbee 100644 --- a/components/device-mgt-extensions/pom.xml +++ b/components/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml index 0629418662..85c915cd66 100644 --- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml +++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index d4849aceef..2606d543c8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml index bf9eedf2a7..4c495596d5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml @@ -20,7 +20,7 @@ device-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index 38bc2c001a..bae7d9e84a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml @@ -325,6 +325,12 @@ javax.ws.rs javax.ws.rs-api + provided + + + javax.ws.rs + jsr311-api + provided org.wso2.carbon.commons diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index dc6240b236..071ebfb39d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -21,7 +21,7 @@ device-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index 30a8d6fa76..8f78ea3064 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index 11c9471e76..3c17f25ec2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml index 402dedb384..cda668636f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml index 744abc8ba1..981a5383b3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml @@ -23,7 +23,7 @@ device-mgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index adb86890c8..0e362501db 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml index 2aab7d1cdd..2a660006e6 100644 --- a/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml +++ b/components/heartbeat-management/io.entgra.server.bootup.heartbeat.beacon/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt heartbeat-management - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/heartbeat-management/pom.xml b/components/heartbeat-management/pom.xml index 08477b29cb..dae6112b77 100644 --- a/components/heartbeat-management/pom.xml +++ b/components/heartbeat-management/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml index ae46c74805..2853017c24 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml @@ -22,13 +22,12 @@ org.wso2.carbon.devicemgt identity-extensions - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions - 4.1.16-SNAPSHOT bundle WSO2 Carbon - OAuth Extensions http://wso2.org diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml index 4adb6539ab..33286cd1e6 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml @@ -21,7 +21,7 @@ identity-extensions org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml index 7e171cd155..dcabec21e4 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt identity-extensions - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml index bbf1f08a4e..27d6a1bc79 100644 --- a/components/identity-extensions/pom.xml +++ b/components/identity-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml index 4823875d18..6e0f87666d 100644 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt policy-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.complex.policy.decision.point - 4.1.16-SNAPSHOT bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml index 0c3d56ebc2..8c43b569f9 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml @@ -3,14 +3,13 @@ org.wso2.carbon.devicemgt policy-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.decision.point - 4.1.16-SNAPSHOT bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml index 91e54e19ae..00a3b9c925 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt policy-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml @@ -11,7 +11,6 @@ 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.information.point - 4.1.16-SNAPSHOT bundle WSO2 Carbon - Policy Information Point WSO2 Carbon - Policy Information Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml index 7430fd3211..8aa6a91517 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt policy-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common - 4.1.16-SNAPSHOT bundle WSO2 Carbon - Policy Management Common WSO2 Carbon - Policy Management Common diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml index 38acfd2d93..2efdf89d5f 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml @@ -22,13 +22,12 @@ org.wso2.carbon.devicemgt policy-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.policy.mgt.core - 4.1.16-SNAPSHOT bundle WSO2 Carbon - Policy Management Core WSO2 Carbon - Policy Management Core diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml index e047aa2278..4f1db3f6ae 100644 --- a/components/policy-mgt/pom.xml +++ b/components/policy-mgt/pom.xml @@ -23,13 +23,12 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 policy-mgt - 4.1.16-SNAPSHOT pom WSO2 Carbon - Policy Management Component http://wso2.org diff --git a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml index 6ae1098d84..592564cc0a 100644 --- a/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml +++ b/components/transport-mgt/email-sender/org.wso2.carbon.email.sender.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt email-sender - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/transport-mgt/email-sender/pom.xml b/components/transport-mgt/email-sender/pom.xml index 61e795d747..da5fdb82a1 100644 --- a/components/transport-mgt/email-sender/pom.xml +++ b/components/transport-mgt/email-sender/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt transport-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/transport-mgt/pom.xml b/components/transport-mgt/pom.xml index b307febc12..fc1c94aaef 100644 --- a/components/transport-mgt/pom.xml +++ b/components/transport-mgt/pom.xml @@ -3,7 +3,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml index 8a8ae5ee3c..c4bdb628f5 100644 --- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml +++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt sms-handler - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml index 8edc2d7a44..ac4edf6955 100644 --- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml +++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.common/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt sms-handler - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml index 49eae641ab..f88e557184 100644 --- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml +++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt sms-handler - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/transport-mgt/sms-handler/pom.xml b/components/transport-mgt/sms-handler/pom.xml index 2f46ed8dfa..4c8815afc6 100644 --- a/components/transport-mgt/sms-handler/pom.xml +++ b/components/transport-mgt/sms-handler/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt transport-mgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml index d41942e3f6..0fcf6eee7d 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml @@ -21,12 +21,11 @@ ui-request-interceptor io.entgra.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 io.entgra.ui.request.interceptor - 4.1.16-SNAPSHOT war Entgra - Request Handling Proxy Servlet Proxy Service for Request Handling in Entgra EMM/IOT Server. diff --git a/components/ui-request-interceptor/pom.xml b/components/ui-request-interceptor/pom.xml index cfed28d8b0..6204dc57d3 100644 --- a/components/ui-request-interceptor/pom.xml +++ b/components/ui-request-interceptor/pom.xml @@ -21,7 +21,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index e88716313f..e041b45f83 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -21,14 +21,13 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.webapp.authenticator.framework - 4.1.16-SNAPSHOT bundle WSO2 Carbon - Web Application Authenticator Framework Bundle WSO2 Carbon - Web Application Authenticator Framework Bundle diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml index 4a3c39e174..922e3fdcf5 100644 --- a/components/webapp-authenticator-framework/pom.xml +++ b/components/webapp-authenticator-framework/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework - 4.1.16-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework http://wso2.org diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml index e97519888a..b1033f9963 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml @@ -21,14 +21,13 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.application.extension.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - API Management Application Extension Feature http://wso2.org This feature contains an implementation of a api application registration, which takes care of subscription diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml index 6e332ef23b..2bd2ef8468 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handler.server.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Device Management - APIM handler Server Feature http://wso2.org This feature contains the handler for the api authentications diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml index a934c7dc4c..8051e07759 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml @@ -21,13 +21,12 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.integration.client.feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - APIM Integration Client Feature http://wso2.org diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml index e9f713c97f..d8c6d64729 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml @@ -21,14 +21,13 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - API Management Webapp Publisher Feature http://wso2.org This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml index 3561b8c4d6..42650878ae 100644 --- a/features/apimgt-extensions/pom.xml +++ b/features/apimgt-extensions/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt apimgt-extensions-feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - API Management Extensions Feature http://wso2.org diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml index 44f13b7540..5bdf583f19 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml @@ -22,13 +22,12 @@ org.wso2.carbon.devicemgt application-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.api.feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - Application Management API Feature https://entgra.io diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml index dc53590a67..66d0322843 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt application-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.application.mgt.server.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Application Management Server Feature https://entgra.io diff --git a/features/application-mgt/pom.xml b/features/application-mgt/pom.xml index 86fe383b78..1aa070544a 100644 --- a/features/application-mgt/pom.xml +++ b/features/application-mgt/pom.xml @@ -22,13 +22,12 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 application-mgt-feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - Application Management Feature https://entgra.io diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml index 1988d44d71..c4894c3c43 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml index 1dfc80f494..5cbef9678b 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml index a7a9d89595..6792ce5d05 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.server.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Certificate Management Server Feature http://wso2.org This feature contains the core bundles required for back-end Certificate Management functionality diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml index 29ce4363df..7dceadff12 100644 --- a/features/certificate-mgt/pom.xml +++ b/features/certificate-mgt/pom.xml @@ -22,13 +22,12 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 certificate-mgt-feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - Certificate Management Feature http://wso2.org diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml index 367a9e97dd..aca2bf216d 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Device Type Deployer Feature http://wso2.org WSO2 Carbon - Device Type Deployer Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml index 3a9724ec93..e1caa4a07d 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - FCM Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml index 03ab72d6f5..489e36b2cd 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - MQTT Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml index 87c6f51c3e..4c025f8572 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - MQTT Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml index 7f49e2dd7a..f482a4874f 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - XMPP Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - XMPP Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml index 8f4033f2f0..063ed9e1c2 100644 --- a/features/device-mgt-extensions/pom.xml +++ b/features/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml index 4f2154e29d..411d4d0a2c 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt device-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.analytics.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains bundles related to device analytics data publisher and ws proxy diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml index 68ac18bdf9..c36f6b292c 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml index f315096d69..f96f388520 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml index 00d4a96a0b..d9969b9071 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml @@ -4,14 +4,13 @@ org.wso2.carbon.devicemgt device-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Device Management Extensions Feature http://wso2.org This feature contains common extensions used by key device management functionalities diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml index f986e520a0..2b919cccdf 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml index d5d7bf98f0..3e5bc9400e 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt device-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.server.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml index e00fa634c8..c4f70cf3be 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index 528051da15..d53543139b 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml index de26779b16..ceae78d430 100644 --- a/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml +++ b/features/heartbeat-management/io.entgra.server.heart.beat.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt heart-beat-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/features/heartbeat-management/pom.xml b/features/heartbeat-management/pom.xml index 2602548044..b034331e1b 100644 --- a/features/heartbeat-management/pom.xml +++ b/features/heartbeat-management/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt heart-beat-feature - 4.1.16-SNAPSHOT pom Entgra - Heart Beat Feature http://entgra.io diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml index 410cca6e21..4047e2295c 100644 --- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml +++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml @@ -23,14 +23,13 @@ org.wso2.carbon.devicemgt jwt-client-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.identity.jwt.client.extension.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - JWT Client Feature http://wso2.org This feature contains jwt client implementation from which we can get a access token using the jwt diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml index 75942261f7..994c462f6a 100644 --- a/features/jwt-client/pom.xml +++ b/features/jwt-client/pom.xml @@ -23,13 +23,12 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 jwt-client-feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - JWT Client Extension Feature http://wso2.org diff --git a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml index 1ca77e930c..bd943afb33 100644 --- a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml +++ b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml @@ -23,14 +23,13 @@ org.wso2.carbon.devicemgt oauth-extensions-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Device Mgt OAuth Extensions Feature http://wso2.org This feature contains devicemgt related OAuth extensions diff --git a/features/oauth-extensions/pom.xml b/features/oauth-extensions/pom.xml index 8e62605ea5..5e1d9ad26d 100644 --- a/features/oauth-extensions/pom.xml +++ b/features/oauth-extensions/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt oauth-extensions-feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - Device Management OAuth Extensions Feature http://wso2.org diff --git a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml index daffbc913c..57146156f9 100644 --- a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml +++ b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml @@ -23,14 +23,13 @@ org.wso2.carbon.devicemgt policy-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.policy.mgt.server.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Policy Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml index 3223326c5c..44dd54475a 100644 --- a/features/policy-mgt/pom.xml +++ b/features/policy-mgt/pom.xml @@ -23,14 +23,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt policy-mgt-feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - Policy Management Feature http://wso2.org diff --git a/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml index eaf13f69ff..52a2cc4730 100644 --- a/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml +++ b/features/transport-mgt/email-sender/org.wso2.carbon.email.sender.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt email-sender-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.email.sender.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Email Sender Feature http://wso2.org This feature contains the core bundles required for email sender related functionality diff --git a/features/transport-mgt/email-sender/pom.xml b/features/transport-mgt/email-sender/pom.xml index 3292c9ddd4..f44b2990b2 100644 --- a/features/transport-mgt/email-sender/pom.xml +++ b/features/transport-mgt/email-sender/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt transport-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt email-sender-feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - Email Sender Feature http://wso2.org diff --git a/features/transport-mgt/pom.xml b/features/transport-mgt/pom.xml index 1ad1049576..7f934bdd60 100644 --- a/features/transport-mgt/pom.xml +++ b/features/transport-mgt/pom.xml @@ -3,7 +3,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml index 9c33be06bb..a702d27095 100644 --- a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml +++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt sms-handler-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 io.entgra.transport.mgt.sms.handler.api.feature pom - 4.1.16-SNAPSHOT Entgra - SMS Handler API Feature https://entgra.io This feature contains the APIs required for SMS Handler diff --git a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml index e6555c2037..9fad844781 100644 --- a/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml +++ b/features/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.server.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt sms-handler-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 io.entgra.transport.mgt.sms.handler.server.feature pom - 4.1.16-SNAPSHOT Entgra - SMS Handler Server Feature https://entgra.io This feature contains the core bundles required for Back-end SMS Handler functionality diff --git a/features/transport-mgt/sms-handler/pom.xml b/features/transport-mgt/sms-handler/pom.xml index d5bf4be703..107357cbaf 100644 --- a/features/transport-mgt/sms-handler/pom.xml +++ b/features/transport-mgt/sms-handler/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt transport-mgt-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml diff --git a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml index b1df7b1684..364ce6a9f4 100644 --- a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml +++ b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/pom.xml @@ -21,7 +21,7 @@ ui-request-interceptor-feature io.entgra.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT 4.0.0 diff --git a/features/ui-request-interceptor/pom.xml b/features/ui-request-interceptor/pom.xml index 0ab46ec416..1e4441c810 100644 --- a/features/ui-request-interceptor/pom.xml +++ b/features/ui-request-interceptor/pom.xml @@ -21,7 +21,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml index a2448e6fff..7f825735f1 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.webapp.authenticator.framework.server.feature pom - 4.1.16-SNAPSHOT WSO2 Carbon - Webapp Authenticator Framework Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml index 264f071c9d..d399ea4680 100644 --- a/features/webapp-authenticator-framework/pom.xml +++ b/features/webapp-authenticator-framework/pom.xml @@ -22,14 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 4.1.16-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework Feature http://wso2.org diff --git a/pom.xml b/pom.xml index 885f41e130..5f6a2d8d1d 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt pom - 4.1.16-SNAPSHOT + 5.0.0-SNAPSHOT WSO2 Carbon - Device Management - Parent http://wso2.org WSO2 Connected Device Manager Components @@ -2093,7 +2093,7 @@ 1.2.11.wso2v10 - 4.1.16-SNAPSHOT + ${project.version} 4.7.35 From 23d2b9d767c15962a3509045d286921488f6380b Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Fri, 11 Jun 2021 10:48:33 +0530 Subject: [PATCH 21/54] added claim adding logic to SP --- .../resources/payloads/update-app-request.xml | 42 +++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml index 4f608a9e55..50e82b986c 100644 --- a/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml +++ b/features/ui-request-interceptor/io.entgra.ui.request.interceptor.feature/src/main/resources/payloads/update-app-request.xml @@ -8,6 +8,48 @@ ${applicationName} ${description} + + + + + + + + + + + + + http://wso2.org/claims/username + + + true + + + + + + http://testclaims/claims/username + + + true + + + + + + + + + + + + + + + + + From 51dd72ff794f7c701c6485b695bbed9bc23f7bee Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 22 Jun 2021 11:26:01 +0530 Subject: [PATCH 22/54] commented braking changes related to analytics --- .../org.wso2.carbon.device.mgt.api/pom.xml | 10 +- .../impl/GeoLocationBasedServiceImpl.java | 272 +++++++++--------- 2 files changed, 141 insertions(+), 141 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index bae7d9e84a..01c4ef7d00 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -363,11 +363,11 @@ ${carbon.identity.framework.version} provided - - org.wso2.carbon.analytics - org.wso2.carbon.analytics.dataservice.commons - provided - + + + + + org.wso2.carbon.analytics-common org.wso2.carbon.event.receiver.stub diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java index bafe13d742..2207957a2a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/GeoLocationBasedServiceImpl.java @@ -27,12 +27,12 @@ import org.apache.commons.logging.LogFactory; import org.apache.http.HttpStatus; import org.wso2.carbon.analytics.api.AnalyticsDataAPI; import org.wso2.carbon.analytics.api.AnalyticsDataAPIUtil; -import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; -import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; -import org.wso2.carbon.analytics.dataservice.commons.SortByField; -import org.wso2.carbon.analytics.dataservice.commons.SortType; -import org.wso2.carbon.analytics.datasource.commons.Record; -import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; +//import org.wso2.carbon.analytics.dataservice.commons.AnalyticsDataResponse; +//import org.wso2.carbon.analytics.dataservice.commons.SearchResultEntry; +//import org.wso2.carbon.analytics.dataservice.commons.SortByField; +//import org.wso2.carbon.analytics.dataservice.commons.SortType; +//import org.wso2.carbon.analytics.datasource.commons.Record; +//import org.wso2.carbon.analytics.datasource.commons.exception.AnalyticsException; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; @@ -120,40 +120,40 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { if (from != 0 || to != 0) { query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]"; } - try { - if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( - new DeviceIdentifier(deviceId, deviceType), - DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) { - return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); - } - List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField("timeStamp", SortType.ASC); - sortByFields.add(sortByField); +// try { +// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( +// new DeviceIdentifier(deviceId, deviceType), +// DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) { +// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); +// } +// List sortByFields = new ArrayList<>(); +// SortByField sortByField = new SortByField("timeStamp", SortType.ASC); +// sortByFields.add(sortByField); // this is the user who initiates the request - String authorizedUser = MultitenantUtils.getTenantAwareUsername( - CarbonContext.getThreadLocalCarbonContext().getUsername()); +// String authorizedUser = MultitenantUtils.getTenantAwareUsername( +// CarbonContext.getThreadLocalCarbonContext().getUsername()); - try { - String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); - int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); +// try { +// String tenantDomain = CarbonContext.getThreadLocalCarbonContext().getTenantDomain(); +// int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); - List searchResults = analyticsDataAPI.search(tenantId, tableName, query, - 0, - 100, - sortByFields); - List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), - searchResults); - return Response.ok().entity(events).build(); - } catch (AnalyticsException | UserStoreException e) { - log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); - throw DeviceMgtUtil.buildBadRequestException( - Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); - } - } catch (DeviceAccessAuthorizationException e) { - log.error(e.getErrorMessage()); +// List searchResults = analyticsDataAPI.search(tenantId, tableName, query, +// 0, +// 100, +// sortByFields); +// List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), +// searchResults); +// return Response.ok().entity(events).build(); +// } catch (AnalyticsException | UserStoreException e) { +// log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); +// throw DeviceMgtUtil.buildBadRequestException( +// Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); +// } +// } catch (DeviceAccessAuthorizationException e) { +// log.error(e.getErrorMessage()); return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build(); - } +// } } @Path("stats/device-locations") @@ -559,40 +559,40 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { if (from != 0 || to != 0) { query += " AND timeStamp : [" + fromDate + " TO " + toDate + "]"; } - try { - if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( - new DeviceIdentifier(deviceId, deviceType), - DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) { - return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); - } - List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField("timeStamp", SortType.ASC); - sortByFields.add(sortByField); +// try { +// if (!DeviceMgtAPIUtils.getDeviceAccessAuthorizationService().isUserAuthorized( +// new DeviceIdentifier(deviceId, deviceType), +// DeviceGroupConstants.Permissions.DEFAULT_STATS_MONITOR_PERMISSIONS)) { +// return Response.status(Response.Status.UNAUTHORIZED.getStatusCode()).build(); +// } +// List sortByFields = new ArrayList<>(); +// SortByField sortByField = new SortByField("timeStamp", SortType.ASC); +// sortByFields.add(sortByField); // this is the user who initiates the request - String authorizedUser = MultitenantUtils.getTenantAwareUsername( - CarbonContext.getThreadLocalCarbonContext().getUsername()); - - try { - String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); - int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); - AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); - List searchResults = analyticsDataAPI.search(tenantId, tableName, query, - 0, - 100, - sortByFields); - List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), - searchResults); - return Response.ok().entity(events).build(); - } catch (AnalyticsException | UserStoreException e) { - log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); - throw DeviceMgtUtil.buildBadRequestException( - Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); - } - } catch (DeviceAccessAuthorizationException e) { - log.error(e.getErrorMessage()); +// String authorizedUser = MultitenantUtils.getTenantAwareUsername( +// CarbonContext.getThreadLocalCarbonContext().getUsername()); + +// try { +// String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); +// int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); +// AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); +// List searchResults = analyticsDataAPI.search(tenantId, tableName, query, +// 0, +// 100, +// sortByFields); +// List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), +// searchResults); +// return Response.ok().entity(events).build(); +// } catch (AnalyticsException | UserStoreException e) { +// log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); +// throw DeviceMgtUtil.buildBadRequestException( +// Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); +// } +// } catch (DeviceAccessAuthorizationException e) { +// log.error(e.getErrorMessage()); return Response.status(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode()).build(); - } +// } } @Path("alerts/history") @@ -607,80 +607,80 @@ public class GeoLocationBasedServiceImpl implements GeoLocationBasedService { if (from != 0 || to != 0) { query = "timeStamp : [" + fromDate + " TO " + toDate + "]"; } - try { - List sortByFields = new ArrayList<>(); - SortByField sortByField = new SortByField("timeStamp", SortType.ASC); - sortByFields.add(sortByField); - - // this is the user who initiates the request - String authorizedUser = MultitenantUtils.getTenantAwareUsername( - CarbonContext.getThreadLocalCarbonContext().getUsername()); - - String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); - int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); - AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); - List searchResults = analyticsDataAPI.search(tenantId, tableName, query, - 0, - 100, - sortByFields); - List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), - searchResults); - return Response.ok().entity(events).build(); - - } catch (AnalyticsException | UserStoreException e) { - log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); +// try { +// List sortByFields = new ArrayList<>(); +// SortByField sortByField = new SortByField("timeStamp", SortType.ASC); +// sortByFields.add(sortByField); +// +// // this is the user who initiates the request +// String authorizedUser = MultitenantUtils.getTenantAwareUsername( +// CarbonContext.getThreadLocalCarbonContext().getUsername()); +// +// String tenantDomain = MultitenantUtils.getTenantDomain(authorizedUser); +// int tenantId = DeviceMgtAPIUtils.getRealmService().getTenantManager().getTenantId(tenantDomain); +// AnalyticsDataAPI analyticsDataAPI = DeviceMgtAPIUtils.getAnalyticsDataAPI(); +// List searchResults = analyticsDataAPI.search(tenantId, tableName, query, +// 0, +// 100, +// sortByFields); +// List events = getEventBeans(analyticsDataAPI, tenantId, tableName, new ArrayList(), +// searchResults); +// return Response.ok().entity(events).build(); +// +// } catch (AnalyticsException | UserStoreException e) { +// log.error("Failed to perform search on table: " + tableName + " : " + e.getMessage(), e); throw DeviceMgtUtil.buildBadRequestException( Constants.ErrorMessages.STATUS_BAD_REQUEST_MESSAGE_DEFAULT); - } - } - - private List getEventBeans(AnalyticsDataAPI analyticsDataAPI, int tenantId, String tableName, - List columns, - List searchResults) throws AnalyticsException { - List ids = getIds(searchResults); - List requiredColumns = (columns == null || columns.isEmpty()) ? null : columns; - AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, requiredColumns, ids); - List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response); - Map eventBeanMap = getEventBeanKeyedWithIds(records); - return getSortedEventBeans(eventBeanMap, searchResults); - } - - private List getSortedEventBeans(Map eventBeanMap, - List searchResults) { - List sortedRecords = new ArrayList<>(); - for (SearchResultEntry entry : searchResults) { - sortedRecords.add(eventBeanMap.get(entry.getId())); - } - return sortedRecords; +// } } - private Map getEventBeanKeyedWithIds(List records) { - Map eventBeanMap = new HashMap<>(); - for (Record record : records) { - Event event = getEventBean(record); - eventBeanMap.put(event.getId(), event); - } - return eventBeanMap; - } - - private List getIds(List searchResults) { - List ids = new ArrayList<>(); - if (searchResults != null) { - for (SearchResultEntry resultEntry : searchResults) { - ids.add(resultEntry.getId()); - } - } - return ids; - } - - private static Event getEventBean(Record record) { - Event eventBean = new Event(); - eventBean.setId(record.getId()); - eventBean.setTableName(record.getTableName()); - eventBean.setTimestamp(record.getTimestamp()); - eventBean.setValues(record.getValues()); - return eventBean; - } +// private List getEventBeans(AnalyticsDataAPI analyticsDataAPI, int tenantId, String tableName, +// List columns, +// List searchResults) throws AnalyticsException { +// List ids = getIds(searchResults); +// List requiredColumns = (columns == null || columns.isEmpty()) ? null : columns; +// AnalyticsDataResponse response = analyticsDataAPI.get(tenantId, tableName, 1, requiredColumns, ids); +// List records = AnalyticsDataAPIUtil.listRecords(analyticsDataAPI, response); +// Map eventBeanMap = getEventBeanKeyedWithIds(records); +// return getSortedEventBeans(eventBeanMap, searchResults); +// } +// +// private List getSortedEventBeans(Map eventBeanMap, +// List searchResults) { +// List sortedRecords = new ArrayList<>(); +// for (SearchResultEntry entry : searchResults) { +// sortedRecords.add(eventBeanMap.get(entry.getId())); +// } +// return sortedRecords; +// } +// +// private Map getEventBeanKeyedWithIds(List records) { +// Map eventBeanMap = new HashMap<>(); +// for (Record record : records) { +// Event event = getEventBean(record); +// eventBeanMap.put(event.getId(), event); +// } +// return eventBeanMap; +// } +// +// private List getIds(List searchResults) { +// List ids = new ArrayList<>(); +// if (searchResults != null) { +// for (SearchResultEntry resultEntry : searchResults) { +// ids.add(resultEntry.getId()); +// } +// } +// return ids; +// } +// +// private static Event getEventBean(Record record) { +// Event eventBean = new Event(); +// eventBean.setId(record.getId()); +// eventBean.setTableName(record.getTableName()); +// eventBean.setTimestamp(record.getTimestamp()); +// eventBean.setValues(record.getValues()); +// return eventBean; +// } @Path("/geo-fence") @POST From 94dd33ffa5de5ad877f7706245c64e42386b9e67 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Sat, 26 Jun 2021 13:45:27 +0530 Subject: [PATCH 23/54] scope-role-permission refactoring and webapp authorization --- .../carbon/apimgt/annotations/api/Scope.java | 2 + .../src/main/webapp/WEB-INF/web.xml | 2 +- .../publisher/APIPublisherServiceImpl.java | 122 ++++++++++++--- .../apimgt/webapp/publisher/dto/ApiScope.java | 8 + .../lifecycle/util/AnnotationProcessor.java | 17 ++- .../ApplicationManagementPublisherAPI.java | 2 + ...pplicationManagementPublisherAdminAPI.java | 1 + .../ReviewManagementPublisherAdminAPI.java | 2 + .../services/ApplicationManagementAPI.java | 1 + .../api/services/ReviewManagementAPI.java | 2 + .../services/SubscriptionManagementAPI.java | 7 +- .../admin/ReviewManagementStoreAdminAPI.java | 1 + .../admin/SubscriptionManagementAdminAPI.java | 1 + .../mgt/jaxrs/api/CertificateMgtService.java | 1 + .../CertificateManagementAdminService.java | 5 + .../DeviceManagementConfigService.java | 4 + .../DeviceManagementConfigServiceImpl.java | 15 +- .../config/jaxrs/util/DeviceMgtAPIUtils.java | 16 -- .../api/ActivityInfoProviderService.java | 1 + .../AnalyticsArtifactsManagementService.java | 8 + .../api/ConfigurationManagementService.java | 2 + .../jaxrs/service/api/DeviceAgentService.java | 5 + .../api/DeviceEventManagementService.java | 2 + .../service/api/DeviceManagementService.java | 11 ++ .../api/DeviceTypeManagementService.java | 4 + .../service/api/GeoLocationBasedService.java | 3 + .../service/api/GroupManagementService.java | 14 ++ .../jaxrs/service/api/MetadataService.java | 4 + .../api/NotificationManagementService.java | 2 + .../service/api/PolicyManagementService.java | 10 ++ .../service/api/RemoteSessionService.java | 1 + .../service/api/ReportManagementService.java | 1 + .../service/api/RoleManagementService.java | 8 + .../service/api/UserManagementService.java | 13 ++ .../ApplicationManagementAdminService.java | 2 + ...DeviceAccessAuthorizationAdminService.java | 1 + ...AnalyticsArtifactUploaderAdminService.java | 1 + .../admin/DeviceManagementAdminService.java | 3 + .../DeviceTypeManagementAdminService.java | 3 + .../admin/GroupManagementAdminService.java | 3 + .../api/admin/UserManagementAdminService.java | 2 + .../mgt/jaxrs/util/DeviceMgtAPIUtils.java | 11 -- .../mgt/common/permission/mgt/Permission.java | 12 +- .../mgt/PermissionManagerService.java | 20 +-- .../mgt/core/DeviceManagementConstants.java | 1 + .../cache/APIResourcePermissionCacheKey.java | 64 ++++++++ .../APIResourcePermissionCacheManager.java | 31 ++++ ...APIResourcePermissionCacheManagerImpl.java | 84 ++++++++++ .../permission/AnnotationProcessor.java | 16 +- .../mgt/core/config/permission/Scope.java | 9 ++ .../WebAppDeploymentLifecycleListener.java | 7 +- .../DeviceManagementServiceComponent.java | 6 +- .../mgt/PermissionManagerServiceImpl.java | 38 ++--- .../mgt/core/util/DeviceManagerUtil.java | 59 ++++++++ .../client/extension/util/JWTClientUtil.java | 22 +-- .../ConfigurationManagementService.java | 1 + .../pom.xml | 48 ++++-- .../AuthenticationFrameworkUtil.java | 2 +- .../framework/WebappAuthenticationValve.java | 34 +---- .../authorizer/MatchingResource.java | 30 ++++ .../authorizer/PermissionAuthorizer.java | 143 ++++++++++++++++++ pom.xml | 4 +- 62 files changed, 794 insertions(+), 161 deletions(-) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheKey.java create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheManager.java create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/impl/APIResourcePermissionCacheManagerImpl.java create mode 100644 components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/MatchingResource.java create mode 100644 components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/src/main/java/org/wso2/carbon/apimgt/annotations/api/Scope.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/src/main/java/org/wso2/carbon/apimgt/annotations/api/Scope.java index 701a6f183c..86d3b8f477 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/src/main/java/org/wso2/carbon/apimgt/annotations/api/Scope.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/src/main/java/org/wso2/carbon/apimgt/annotations/api/Scope.java @@ -20,4 +20,6 @@ public @interface Scope { String[] permissions(); + String[] roles(); + } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml index 823bf51d73..b2d4acf3c4 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml @@ -37,7 +37,7 @@ doAuthentication - true + false diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java index b1c7769768..a3cc0525a2 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -18,6 +18,8 @@ */ package org.wso2.carbon.apimgt.webapp.publisher; +import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiScope; +import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiUriTemplate; import org.wso2.carbon.apimgt.api.APIManagementException; import org.wso2.carbon.apimgt.api.APIProvider; import org.wso2.carbon.apimgt.api.FaultGatewaysException; @@ -32,7 +34,6 @@ import org.wso2.carbon.apimgt.api.model.URITemplate; import org.wso2.carbon.apimgt.impl.APIConstants; import org.wso2.carbon.apimgt.impl.APIManagerFactory; import org.wso2.carbon.apimgt.webapp.publisher.config.WebappPublisherConfig; -import org.wso2.carbon.apimgt.webapp.publisher.dto.ApiUriTemplate; import org.wso2.carbon.apimgt.webapp.publisher.exception.APIManagerPublisherException; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.utils.multitenancy.MultitenantUtils; @@ -61,11 +62,26 @@ public class APIPublisherServiceImpl implements APIPublisherService { PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true); PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(apiConfig.getOwner()); + int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); try { APIProvider apiProvider = API_MANAGER_FACTORY.getAPIProvider(apiConfig.getOwner()); - API api = getAPI(apiConfig); + APIIdentifier apiIdentifier = new APIIdentifier(apiConfig.getOwner(), apiConfig.getName(), apiConfig.getVersion()); + + if (!apiProvider.isAPIAvailable(apiIdentifier)) { - if (!apiProvider.isAPIAvailable(api.getId())) { + // add new scopes as shared scopes + Set allSharedScopeKeys = apiProvider.getAllSharedScopeKeys(tenantDomain); + for (ApiScope apiScope : apiConfig.getScopes()) { + if (!allSharedScopeKeys.contains(apiScope.getKey())) { + Scope scope = new Scope(); + scope.setName(apiScope.getName()); + scope.setDescription(apiScope.getDescription()); + scope.setKey(apiScope.getKey()); + scope.setRoles(apiScope.getRoles()); + apiProvider.addSharedScope(scope, tenantDomain); + } + } + API api = getAPI(apiConfig, true); API createdAPI = apiProvider.addAPI(api); if (CREATED_STATUS.equals(createdAPI.getStatus())) { apiProvider.changeLifeCycleStatus(tenantDomain, createdAPI.getUuid(), PUBLISH_ACTION, null); @@ -73,6 +89,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { apiRevision.setApiUUID(createdAPI.getUuid()); apiRevision.setDescription("Initial Revision"); String apiRevisionId = apiProvider.addAPIRevision(apiRevision, tenantDomain); + APIRevisionDeployment apiRevisionDeployment = new APIRevisionDeployment(); apiRevisionDeployment.setDeployment(API_PUBLISH_ENVIRONMENT); apiRevisionDeployment.setVhost("localhost"); @@ -85,14 +102,83 @@ public class APIPublisherServiceImpl implements APIPublisherService { } } else { if (WebappPublisherConfig.getInstance().isEnabledUpdateApi()) { - API existingAPI = apiProvider.getAPI(api.getId()); + + // With 4.x to 5.x upgrade + // - there cannot be same local scope assigned in 2 different APIs + // - local scopes will be deprecated in the future, so need to move all scopes as shared scopes + + // if an api scope is not available as shared scope, but already assigned as local scope -> that means, the scopes available for this API has not moved as shared scopes + // in order to do that : + // 1. update the same API removing scopes from URI templates + // 2. add scopes as shared scopes + // 3. update the API again adding scopes for the URI Templates + + // if an api scope is not available as shared scope, and not assigned as local scope -> that means, there are new scopes + // 1. add new scopes as shared scopes + // 2. update the API adding scopes for the URI Templates + + Set allSharedScopeKeys = apiProvider.getAllSharedScopeKeys(tenantDomain); + Set scopesToMoveAsSharedScopes = new HashSet<>(); + for (ApiScope apiScope : apiConfig.getScopes()) { + // if the scope is not available as shared scope and it is assigned to an API as a local scope + // need remove the local scope and add as a shared scope + if (!allSharedScopeKeys.contains(apiScope.getKey())) { + if (apiProvider.isScopeKeyAssignedLocally(apiIdentifier, apiScope.getKey(), tenantId)) { + // collect scope to move as shared scopes + scopesToMoveAsSharedScopes.add(apiScope); + } else { + // if new scope add as shared scope + Scope scope = new Scope(); + scope.setName(apiScope.getName()); + scope.setDescription(apiScope.getDescription()); + scope.setKey(apiScope.getKey()); + scope.setRoles(apiScope.getRoles()); + apiProvider.addSharedScope(scope, tenantDomain); + } + } else { + // if already available as shared scope -> update + Scope scope = new Scope(); + scope.setName(apiScope.getName()); + scope.setDescription(apiScope.getDescription()); + scope.setKey(apiScope.getKey()); + scope.setRoles(apiScope.getRoles()); + apiProvider.updateSharedScope(scope, tenantDomain); + } + } + + // Get existing API + API existingAPI = apiProvider.getAPI(apiIdentifier); + + if (scopesToMoveAsSharedScopes.size() > 0) { + // update API to remove local scopes + API api = getAPI(apiConfig, false); + api.setStatus(existingAPI.getStatus()); + apiProvider.updateAPI(api); + + for (ApiScope apiScope : scopesToMoveAsSharedScopes) { + Scope scope = new Scope(); + scope.setName(apiScope.getName()); + scope.setDescription(apiScope.getDescription()); + scope.setKey(apiScope.getKey()); + scope.setRoles(apiScope.getRoles()); + apiProvider.addSharedScope(scope, tenantDomain); + } + } + + existingAPI = apiProvider.getAPI(apiIdentifier); + API api = getAPI(apiConfig, true); api.setStatus(existingAPI.getStatus()); apiProvider.updateAPI(api); - if (api.getId().getName().equals(existingAPI.getId().getName()) && - api.getId().getVersion().equals(existingAPI.getId().getVersion())) { - if (CREATED_STATUS.equals(existingAPI.getStatus())) { - apiProvider.changeLifeCycleStatus(tenantDomain, existingAPI.getUuid(), PUBLISH_ACTION, null); - } + + if (CREATED_STATUS.equals(existingAPI.getStatus())) { + apiProvider.changeLifeCycleStatus(tenantDomain, existingAPI.getUuid(), PUBLISH_ACTION, null); + APIRevision apiRevision = new APIRevision(); + apiRevision.setApiUUID(existingAPI.getUuid()); + apiRevision.setDescription("Updated Revision"); + String apiRevisionId = apiProvider.addAPIRevision(apiRevision, tenantDomain); + + List apiRevisionDeploymentList = apiProvider.getAPIRevisionDeploymentList(apiRevisionId); + apiProvider.deployAPIRevision(existingAPI.getUuid(), apiRevisionId, apiRevisionDeploymentList); } } } @@ -105,7 +191,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { } } - private API getAPI(APIConfig config) { + private API getAPI(APIConfig config, boolean includeScopes) { APIIdentifier apiIdentifier = new APIIdentifier(config.getOwner(), config.getName(), config.getVersion()); API api = new API(apiIdentifier); @@ -129,13 +215,15 @@ public class APIPublisherServiceImpl implements APIPublisherService { uriTemplate.setHTTPVerb(apiUriTemplate.getHttpVerb()); uriTemplate.setResourceURI(apiUriTemplate.getResourceURI()); uriTemplate.setUriTemplate(apiUriTemplate.getUriTemplate()); - Scope scope = new Scope(); - if (apiUriTemplate.getScope() != null) { - scope.setName(apiUriTemplate.getScope().getName()); - scope.setDescription(apiUriTemplate.getScope().getDescription()); - scope.setKey(apiUriTemplate.getScope().getKey()); - scope.setRoles(apiUriTemplate.getScope().getRoles()); - uriTemplate.setScope(scope); + if (includeScopes) { + Scope scope = new Scope(); + if (apiUriTemplate.getScope() != null) { + scope.setName(apiUriTemplate.getScope().getName()); + scope.setDescription(apiUriTemplate.getScope().getDescription()); + scope.setKey(apiUriTemplate.getScope().getKey()); + scope.setRoles(apiUriTemplate.getScope().getRoles()); + uriTemplate.setScopes(scope); + } } uriTemplates.add(uriTemplate); } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/dto/ApiScope.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/dto/ApiScope.java index 016dbff37f..5578ea05df 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/dto/ApiScope.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/dto/ApiScope.java @@ -23,6 +23,7 @@ public class ApiScope { String key; String name; String roles; + String permissions; String description; int id; @@ -61,4 +62,11 @@ public class ApiScope { this.description = description; } + public String getPermissions() { + return permissions; + } + + public void setPermissions(String permissions) { + this.permissions = permissions; + } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java index 9cac3ca45a..0836018a0c 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java @@ -70,6 +70,7 @@ public class AnnotationProcessor { private static final String SWAGGER_ANNOTATIONS_PROPERTIES_DESCRIPTION = "description"; private static final String SWAGGER_ANNOTATIONS_PROPERTIES_KEY = "key"; private static final String SWAGGER_ANNOTATIONS_PROPERTIES_PERMISSIONS = "permissions"; + private static final String SWAGGER_ANNOTATIONS_PROPERTIES_ROLES = "roles"; private static final String SWAGGER_ANNOTATIONS_PROPERTIES_VERSION = "version"; private static final String SWAGGER_ANNOTATIONS_PROPERTIES_CONTEXT = "context"; private static final String SWAGGER_ANNOTATIONS_PROPERTIES_VALUE = "value"; @@ -78,6 +79,7 @@ public class AnnotationProcessor { private static final String DEFAULT_SCOPE_NAME = "default admin scope"; private static final String DEFAULT_SCOPE_KEY = "perm:admin"; private static final String DEFAULT_SCOPE_PERMISSION = "/permision/device-mgt"; + private static final String DEFAULT_SCOPE_ROLE = "admin"; private static final String PERMISSION_PREFIX = "/permission/admin"; @@ -217,8 +219,11 @@ public class AnnotationProcessor { ApiScope scope; String permissions[]; StringBuilder aggregatedPermissions; + String roles[]; + StringBuilder aggregatedRoles; for(int i=0; i permissions) { - PermissionManagerService permissionService = DeviceMgtAPIUtils.getPermissionManagerService(); - org.wso2.carbon.device.mgt.common.permission.mgt.Permission permission = new org - .wso2.carbon.device.mgt.common.permission.mgt.Permission(); +// PermissionManagerService permissionService = DeviceMgtAPIUtils.getPermissionManagerService(); +// org.wso2.carbon.device.mgt.common.permission.mgt.Permission permission = new org +// .wso2.carbon.device.mgt.common.permission.mgt.Permission(); for (String path : permissions) { - permission.setPath(path); - permission.setUrl(path); +// permission.setPath(path); +// permission.setUrl(path); try { - permissionService.addPermission(permission); + PermissionUtils.putPermission(path); +// permissionService.addPermission(permission); } catch (PermissionManagementException e) { String msg = "Error occurred adding permission"; log.error(msg, e); diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/util/DeviceMgtAPIUtils.java index 96ef7c0cbc..cf098c6edc 100644 --- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/util/DeviceMgtAPIUtils.java +++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/util/DeviceMgtAPIUtils.java @@ -21,7 +21,6 @@ package io.entgra.carbon.device.mgt.config.jaxrs.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagerService; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.user.core.service.RealmService; @@ -33,7 +32,6 @@ public class DeviceMgtAPIUtils { private static final Log log = LogFactory.getLog(DeviceMgtAPIUtils.class); private static DeviceManagementProviderService deviceManagementProviderService = null; - private static PermissionManagerService permissionManagerService = null; private static RealmService realmService = null; public static DeviceManagementProviderService getDeviceManagementService() { @@ -50,20 +48,6 @@ public class DeviceMgtAPIUtils { return deviceManagementProviderService; } - public static PermissionManagerService getPermissionManagerService() { - if (permissionManagerService == null) { - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - permissionManagerService = - (PermissionManagerService) ctx.getOSGiService(PermissionManagerService.class, null); - if (permissionManagerService == null) { - String msg = "Permission Management provider service has not initialized."; - log.error(msg); - throw new IllegalStateException(msg); - } - } - return permissionManagerService; - } - public static RealmService getRealmService() { if (realmService == null) { PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java index 18241eab75..4219f6b669 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java @@ -76,6 +76,7 @@ import javax.ws.rs.core.Response; name = "Get activities", description = "Get activities", key = "perm:get-activity", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/AnalyticsArtifactsManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/AnalyticsArtifactsManagementService.java index 9ff8ecc44d..b6783010ac 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/AnalyticsArtifactsManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/AnalyticsArtifactsManagementService.java @@ -68,41 +68,49 @@ import javax.ws.rs.core.Response; name = "Create Event Stream Artifact", description = "Create Event Stream Artifact", key = "perm:analytics:artifacts:stream", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/analytics/artifacts/stream/add"}), @Scope( name = "Delete Stream Artifact", description = "Delete Stream Artifact", key = "perm:analytics:artifacts:stream:delete", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/analytics/artifacts/stream/delete"}), @Scope( name = "Create Event Receiver Artifact", description = "Create Event Receiver Artifact", key = "perm:analytics:artifacts:receiver", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/analytics/artifacts/receiver/add"}), @Scope( name = "Delete Receiver Artifact", description = "Delete Receiver Artifact", key = "perm:analytics:artifacts:receiver:delete", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/analytics/artifacts/receiver/delete"}), @Scope( name = "Create Event Publisher Artifact", description = "Create Event Publisher Artifact", key = "perm:analytics:artifacts:publisher", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/analytics/artifacts/publisher/add"}), @Scope( name = "Delete Publisher Artifact", description = "Delete Publisher Artifact", key = "perm:analytics:artifacts:publisher:delete", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/analytics/artifacts/publisher/delete"}), @Scope( name = "Create Siddhi Script Artifact", description = "Create Siddhi Script Artifact", key = "perm:analytics:artifacts:siddhi", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/analytics/artifacts/siddhi-script/add"}), @Scope( name = "Delete Siddhi Script Artifact", description = "Delete Siddhi Script Artifact", key = "perm:analytics:artifacts:siddhi:delete", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/analytics/artifacts/siddhi-script/delete"}) } ) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java index ce744e42bb..92e1f9a473 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java @@ -69,12 +69,14 @@ import javax.ws.rs.core.Response; name = "View configurations", description = "", key = "perm:view-configuration", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/platform-configurations/view"} ), @Scope( name = "Manage configurations", description = "", key = "perm:manage-configuration", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/platform-configurations/manage"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java index 0cf94395f7..66d8da7eab 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java @@ -77,30 +77,35 @@ import java.util.Map; name = "Enroll Device", description = "Register a device", key = "perm:device:enroll", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/add"} ), @Scope( name = "Modify Device", description = "Modify a device", key = "perm:device:modify", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/modify"} ), @Scope( name = "Disenroll Device", description = "Disenroll a device", key = "perm:device:disenroll", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/remove"} ), @Scope( name = "Publish Event", description = "publish device event", key = "perm:device:publish-event", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/event"} ), @Scope( name = "Getting Device Operation Details", description = "Getting Device Operation Details", key = "perm:device:operations", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java index 205f1b8ee2..2f91595d38 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java @@ -51,12 +51,14 @@ import javax.ws.rs.core.Response; name = "Add or Delete Event Definition for device type", description = "Add or Delete Event Definition for device type", key = "perm:device-types:events", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/device-type/add"} ), @Scope( name = "Get Events Details of a Device Type", description = "Get Events Details of a Device Type", key = "perm:device-types:events:view", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index 01145b05ec..075061a253 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -107,66 +107,77 @@ import java.util.List; name = "Getting Details of Registered Devices", description = "Getting Details of Registered Devices", key = "perm:devices:view", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Details of a Device", description = "Getting Details of a Device", key = "perm:devices:details", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Update the device specified by device id", description = "Update the device specified by device id", key = "perm:devices:update", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Delete the device specified by device id", description = "Delete the device specified by device id", key = "perm:devices:delete", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Feature Details of a Device", description = "Getting Feature Details of a Device", key = "perm:devices:features", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Advanced Search for Devices", description = "Advanced Search for Devices", key = "perm:devices:search", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Installed Application Details of a Device", description = "Getting Installed Application Details of a Device", key = "perm:devices:applications", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Device Operation Details", description = "Getting Device Operation Details", key = "perm:devices:operations", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Get the details of the policy that is enforced on a device.", description = "Get the details of the policy that is enforced on a device.", key = "perm:devices:effective-policy", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Policy Compliance Details of a Device", description = "Getting Policy Compliance Details of a Device", key = "perm:devices:compliance-data", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Change device status.", description = "Change device status.", key = "perm:devices:change-status", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/change-status"} ), } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java index c328433596..0d9adb0197 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java @@ -87,24 +87,28 @@ import javax.ws.rs.core.Response; name = "Getting the Supported Device Platforms", description = "Getting the Supported Device Platforms", key = "perm:device-types:types", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/device-type/view"} ), @Scope( name = "Get Feature Details of a Device Type", description = "Get Feature Details of a Device Type", key = "perm:device-types:features", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/device-type/features/view"} ), @Scope( name = "Get Config Details of a Device Type", description = "Get Config Details of a Device Type", key = "perm:device-types:configs", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/device-type/config/view"} ), @Scope( name = "Getting Details of Policies", description = "Getting Details of Policies", key = "perm:policies:get-details", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java index a0cd0854c4..775f5c9e82 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java @@ -73,18 +73,21 @@ import java.util.List; name = "View Analytics", description = "", key = "perm:geo-service:analytics-view", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view-analytics"} ), @Scope( name = "Manage Alerts", description = "", key = "perm:geo-service:alerts-manage", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/manage-alerts"} ), @Scope( name = "Manage Geo Fences", description = "", key = "perm:geo-service:geo-fence", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/manage-geo-fence"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java index f61d212493..0d90f3dfd4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java @@ -82,84 +82,98 @@ import java.util.List; name = "Get the list of groups belongs to current user.", description = "Get the list of groups belongs to current user.", key = "perm:groups:groups", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/view"} ), @Scope( name = "Get the count of groups belongs to current user.", description = "Get the count of groups belongs to current user.", key = "perm:groups:count", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/view"} ), @Scope( name = "Add new device group to the system.", description = "Add new device group to the system.", key = "perm:groups:add", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/add"} ), @Scope( name = "View group specified", description = "View group specified", key = "perm:groups:groups-view", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/view"} ), @Scope( name = "Update a group", description = "Update a group", key = "perm:groups:update", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/update"} ), @Scope( name = "Delete a group", description = "Delete a group", key = "perm:groups:remove", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/remove"} ), @Scope( name = "Manage group sharing with a user", description = "Manage group sharing with a user", key = "perm:groups:share", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/share"} ), @Scope( name = "View list of roles of a device group", description = "View list of roles of a device group", key = "perm:groups:roles", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/roles/view"} ), @Scope( name = "View list of devices in the device group", description = "View list of devices in the device group", key = "perm:groups:devices", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/devices/view"} ), @Scope( name = "View list of device count in the device group", description = "View list of device count in the device group", key = "perm:groups:devices-count", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/devices/view"} ), @Scope( name = "Add devices to group", description = "Add devices to group", key = "perm:groups:devices-add", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/devices/add"} ), @Scope( name = "Remove devices from group", description = "Remove devices from group", key = "perm:groups:devices-remove", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/devices/remove"} ), @Scope( name = "Assign devices to groups", description = "Assign devices to groups", key = "perm:groups:assign", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/devices/add"} ), @Scope( name = "List of groups that have the device", description = "List of groups that have the device", key = "perm:groups:device", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/groups/devices/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/MetadataService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/MetadataService.java index 3a22364ed5..7f6ab365df 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/MetadataService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/MetadataService.java @@ -73,24 +73,28 @@ import javax.ws.rs.core.Response; name = "View metadata records", description = "View metadata records", key = "perm:metadata:view", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/metadata/view"} ), @Scope( name = "Create a metadata record", description = "Create a metadata record", key = "perm:metadata:create", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/metadata/create"} ), @Scope( name = "Update a metadata record", description = "Updating a specified metadata record", key = "perm:metadata:update", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/metadata/update"} ), @Scope( name = "Delete a metadata record", description = "Delete a specified metadata record", key = "perm:metadata:remove", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/metadata/remove"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java index 71d173c11f..9d36d1067f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java @@ -73,12 +73,14 @@ import javax.ws.rs.core.Response; name = "Getting All Device Notification Details", description = "Getting All Device Notification Details", key = "perm:notifications:view", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/notifications/view"} ), @Scope( name = "Updating the Device Notification Status", description = "Updating the Device Notification Status", key = "perm:notifications:mark-checked", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/notifications/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java index 607a4a8ef0..4db3de0ab5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java @@ -79,60 +79,70 @@ import java.util.List; name = "Adding a Policy", description = "Adding a Policy", key = "perm:policies:manage", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Getting Details of Policies", description = "Getting Details of Policies", key = "perm:policies:get-details", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/view"} ), @Scope( name = "Getting Details of a Policy", description = "Getting Details of a Policy", key = "perm:policies:get-policy-details", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/view"} ), @Scope( name = "Updating a Policy", description = "Updating a Policy", key = "perm:policies:update", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Removing Multiple Policies", description = "Removing Multiple Policies", key = "perm:policies:remove", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Activating Policies", description = "Activating Policies", key = "perm:policies:activate", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Deactivating Policies", description = "Deactivating Policies", key = "perm:policies:deactivate", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Applying Changes on Policies", description = "Applying Changes on Policies", key = "perm:policies:changes", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Updating the Policy Priorities", description = "Updating the Policy Priorities", key = "perm:policies:priorities", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Fetching the Effective Policy", description = "Fetching the Effective Policy", key = "perm:policies:effective-policy", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/policies/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java index 9717ce1c27..f52a9f1aa7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java @@ -61,6 +61,7 @@ import javax.ws.rs.core.Response; name = "Remote Session Connection", description = "", key = "perm:remote-session-service:connect", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/remote-session"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java index 3f1f88a6c6..41364f8afd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java @@ -66,6 +66,7 @@ import java.util.List; name = "Getting Details of Registered Devices", description = "Getting Details of Registered Devices", key = "perm:devices:view", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java index ebc4c49984..d3cbb88469 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java @@ -53,48 +53,56 @@ import java.util.List; name = "Getting the List of Roles", description = "Getting the List of Roles", key = "perm:roles:view", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/roles/view"} ), @Scope( name = "Getting Permission Details of a Role", description = "Getting Permission Details of a Role", key = "perm:roles:permissions", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/roles/view"} ), @Scope( name = "Getting the List of Roles", description = "Getting the List of Roles", key = "perm:roles:details", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/roles/view"} ), @Scope( name = "Adding a Role", description = "Adding a Role", key = "perm:roles:add", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/roles/manage"} ), @Scope( name = "Adding a combined Role", description = "Adding a combined Role", key = "perm:roles:create-combined-role", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/roles/manage"} ), @Scope( name = "Updating Role Details", description = "Updating Role Details", key = "perm:roles:update", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/roles/manage"} ), @Scope( name = "Deleting a Role", description = "Deleting a Role", key = "perm:roles:delete", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/roles/manage"} ), @Scope( name = "Adding Users to a Role", description = "Adding Users to a Role", key = "perm:roles:add-users", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/roles/manage"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index 5e580f6a06..5be208a448 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -97,78 +97,91 @@ import javax.ws.rs.core.Response; name = "Adding a User", description = "Adding a User", key = "perm:users:add", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Getting Details of a User", description = "Getting Details of a User", key = "perm:users:details", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Updating Details of a User", description = "Updating Details of a User", key = "perm:users:update", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Deleting a User", description = "Deleting a User", key = "perm:users:delete", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Getting the Role Details of a User", description = "Getting the Role Details of a User", key = "perm:users:roles", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Getting Details of Users", description = "Getting Details of Users", key = "perm:users:user-details", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Getting the User Count", description = "Getting the User Count", key = "perm:users:count", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Getting the User existence status", description = "Getting the User existence status", key = "perm:users:is-exist", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Searching for a User Name", description = "Searching for a User Name", key = "perm:users:search", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Changing the User Password", description = "Adding a User", key = "perm:users:credentials", + roles = {"Internal/everyone"}, permissions = {"/login"} ), @Scope( name = "Sending Enrollment Invitations to Users", description = "Sending Enrollment Invitations to Users", key = "perm:users:send-invitation", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Get activities", description = "Get activities", key = "perm:get-activity", + roles = {"Internal/everyone"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting the Permissions of the User", description = "Getting the Permissions of the User", key = "perm:user:permission-view", + roles = {"Internal/everyone"}, permissions = {"/login"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/ApplicationManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/ApplicationManagementAdminService.java index 92c42bfb3b..2ff9bf9783 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/ApplicationManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/ApplicationManagementAdminService.java @@ -67,12 +67,14 @@ import javax.ws.rs.core.Response; name = "Installing an Application (Internal API)", description = "Installing an Application (Internal API)", key = "perm:applications:install", + roles = {"admin"}, permissions = {"/device-mgt/applications/manage"} ), @Scope( name = "Uninstalling an Application (Internal API)", description = "Uninstalling an Application (Internal API)", key = "perm:applications:uninstall", + roles = {"admin"}, permissions = {"/device-mgt/applications/manage"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java index 6a4b12d72e..cb23896ea4 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java @@ -67,6 +67,7 @@ import javax.ws.rs.core.Response; name = "Verify device authorization", description = "Verify device authorization", key = "perm:authorization:verify", + roles = {"admin"}, permissions = {"/device-mgt/authorization/verify"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java index 94220ef8cd..8722e0cae0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java @@ -57,6 +57,7 @@ import javax.ws.rs.core.Response; name = "Devicetype deployment", description = "Deploy devicetype", key = "perm:devicetype:deployment", + roles = {"admin"}, permissions = {"/device-mgt/devicetype/deploy"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java index a5d8adf59c..eb4b10fc41 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java @@ -94,18 +94,21 @@ import java.util.List; name = "Getting Details of a Device", description = "Getting Details of a Device", key = "perm:admin:devices:view", + roles = {"admin"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Update the Device Owner", description = "Update the ownership of the device", key = "perm:admin:devices:update-enrollment", + roles = {"admin"}, permissions = {"/device-mgt/admin/devices/update-enrollment"} ), @Scope( name = "Permanently Delete the device specified by device id", description = "Permanently Delete the device specified by device id", key = "perm:devices:permanent-delete", + roles = {"admin"}, permissions = {"/device-mgt/admin/devices/permanent-delete"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java index 899f84ec70..17224c605e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java @@ -92,18 +92,21 @@ import javax.ws.rs.core.Response; name = "Manage a Device Type", description = "Add, Edit or View a Device Type", key = "perm:admin:device-type", + roles = {"admin"}, permissions = {"/device-mgt/admin/device-type"} ), @Scope( name = "Getting Details of a Device Type", description = "Getting Details of a Device Type", key = "perm:admin:device-type:view", + roles = {"admin"}, permissions = {"/device-mgt/admin/device-type/view"} ), @Scope( name = "Add Device Type Config", description = "Add Platform Config of a Device Type", key = "perm:admin:device-type:configs", + roles = {"admin"}, permissions = {"/device-mgt/admin/device-type/config"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/GroupManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/GroupManagementAdminService.java index f631b1dc51..30f2da5714 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/GroupManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/GroupManagementAdminService.java @@ -70,18 +70,21 @@ import javax.ws.rs.core.Response; name = "View groups", description = "", key = "perm:admin-groups:view", + roles = {"admin"}, permissions = {"/device-mgt/admin/groups/view"} ), @Scope( name = "Count groups", description = "", key = "perm:admin-groups:count", + roles = {"admin"}, permissions = {"/device-mgt/admin/groups/view"} ), @Scope( name = "Add groups", description = "", key = "perm:admin-groups:add", + roles = {"admin"}, permissions = {"/device-mgt/admin/groups/add"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java index bbe64367c4..9dbfbbc6f8 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java @@ -53,12 +53,14 @@ import javax.ws.rs.core.Response; name = "View Users", description = "View Users", key = "perm:admin-users:view", + roles = {"admin"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Delete Users Device Information", description = "Delete users device details", key = "perm:admin-users:remove", + roles = {"admin"}, permissions = {"/device-mgt/users/manage"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java index 49a734cdee..4f45ea3980 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java @@ -74,7 +74,6 @@ import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; import org.wso2.carbon.device.mgt.common.metadata.mgt.MetadataManagementService; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementService; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; -import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagerService; import org.wso2.carbon.device.mgt.common.report.mgt.ReportManagementService; import org.wso2.carbon.device.mgt.common.spi.DeviceTypeGeneratorService; import org.wso2.carbon.device.mgt.common.spi.OTPManagementService; @@ -549,16 +548,6 @@ public class DeviceMgtAPIUtils { return searchManagerService; } - public static PermissionManagerService getPermissionManagerService() { - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - PermissionManagerService PermissionManagerService = - (PermissionManagerService) ctx.getOSGiService(PermissionManagerService.class, null); - if (PermissionManagerService == null) { - throw new IllegalStateException("Permission manager service is not initialized."); - } - return PermissionManagerService; - } - public static GeoLocationProviderService getGeoService() { PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); GeoLocationProviderService diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/permission/mgt/Permission.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/permission/mgt/Permission.java index ff194a7b86..241d8039e3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/permission/mgt/Permission.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/permission/mgt/Permission.java @@ -18,9 +18,6 @@ package org.wso2.carbon.device.mgt.common.permission.mgt; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - /** * This class represents the information related to permission. */ @@ -30,6 +27,7 @@ public class Permission { private String path; // permission string private String url; // url of the resource private String method; // http method + private String urlPattern; public String getUrl() { return url; @@ -62,4 +60,12 @@ public class Permission { public void setPath(String path) { this.path = path; } + + public String getUrlPattern() { + return urlPattern; + } + + public void setUrlPattern(String urlPattern) { + this.urlPattern = urlPattern; + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/permission/mgt/PermissionManagerService.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/permission/mgt/PermissionManagerService.java index 68b81a9de4..2c765c6824 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/permission/mgt/PermissionManagerService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/permission/mgt/PermissionManagerService.java @@ -18,7 +18,7 @@ package org.wso2.carbon.device.mgt.common.permission.mgt; -import java.util.Properties; +import java.util.List; /** * This represents the Permission management functionality which should be implemented by @@ -26,22 +26,8 @@ import java.util.Properties; */ public interface PermissionManagerService { - /** - * Adds a permission. - * - * @param permission - Permission to be added - * @return A boolean indicating the status of the operation. - * @throws PermissionManagementException If some unusual behaviour is observed while adding the permission. - */ - boolean addPermission(Permission permission) throws PermissionManagementException; + boolean addPermission(String context, List permissions) throws PermissionManagementException; - /** - * Fetches a given permission. - * - * @param properties - Properties of the permission to be fetched. - * @return The matched Permission object. - * @throws PermissionManagementException If some unusual behaviour is observed while fetching the permission. - */ - Permission getPermission(Properties properties) throws PermissionManagementException; + List getPermission(String context) throws PermissionManagementException; } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java index f29afccfcf..1d0f581451 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java @@ -42,6 +42,7 @@ public final class DeviceManagementConstants { public static final String DM_CACHE_MANAGER = "DM_CACHE_MANAGER"; public static final String DEVICE_CACHE = "DEVICE_CACHE"; + public static final String API_RESOURCE_PERMISSION_CACHE = "API_RESOURCE_CACHE_CACHE"; public static final String GEOFENCE_CACHE = "GEOFENCE_CACHE"; public static final String ENROLLMENT_NOTIFICATION_API_ENDPOINT = "/api/device-mgt/enrollment-notification"; public static final String URL_SEPERATOR = "/"; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheKey.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheKey.java new file mode 100644 index 0000000000..2db061a6d0 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheKey.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.core.cache; + +import java.util.Objects; + +public class APIResourcePermissionCacheKey { + + private String context; + private volatile int hashCode; + + public APIResourcePermissionCacheKey(String context) { + this.context = context; + } + + + public String getContext() { + return context; + } + + public void setContext(String context) { + this.context = context; + } + + @Override + public boolean equals(Object obj) { + if (obj == null) { + return false; + } + if (!APIResourcePermissionCacheKey.class.isAssignableFrom(obj.getClass())) { + return false; + } + final APIResourcePermissionCacheKey other = (APIResourcePermissionCacheKey) obj; + String thisId = this.context; + String otherId = other.context; + if (!thisId.equals(otherId)) { + return false; + } + return true; + } + + @Override + public int hashCode() { + if (hashCode == 0) { + hashCode = Objects.hash(context); + } + return hashCode; + } +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheManager.java new file mode 100644 index 0000000000..4dac439cc4 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheManager.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.core.cache; + +import org.wso2.carbon.device.mgt.common.permission.mgt.Permission; + +import java.util.List; + +public interface APIResourcePermissionCacheManager { + + void addAPIResourcePermissionToCache(APIResourcePermissionCacheKey cacheKey, List permissions); + + void updateAPIResourcePermissionInCache(APIResourcePermissionCacheKey cacheKey, List permissions); + + List getAPIResourceRermissionFromCache(APIResourcePermissionCacheKey cacheKey); +} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/impl/APIResourcePermissionCacheManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/impl/APIResourcePermissionCacheManagerImpl.java new file mode 100644 index 0000000000..3b08a8d8b2 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/impl/APIResourcePermissionCacheManagerImpl.java @@ -0,0 +1,84 @@ +/* + * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.core.cache.impl; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.permission.mgt.Permission; +import org.wso2.carbon.device.mgt.core.cache.APIResourcePermissionCacheKey; +import org.wso2.carbon.device.mgt.core.cache.APIResourcePermissionCacheManager; +import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; + +import javax.cache.Cache; +import java.util.List; + +public class APIResourcePermissionCacheManagerImpl implements APIResourcePermissionCacheManager { + + + private static final Log log = LogFactory.getLog(APIResourcePermissionCacheManagerImpl.class); + + private static APIResourcePermissionCacheManagerImpl apiResourceCacgeManager; + + private APIResourcePermissionCacheManagerImpl() { + } + + public static APIResourcePermissionCacheManagerImpl getInstance() { + if (apiResourceCacgeManager == null) { + synchronized (APIResourcePermissionCacheManagerImpl.class) { + if (apiResourceCacgeManager == null) { + apiResourceCacgeManager = new APIResourcePermissionCacheManagerImpl(); + } + } + } + return apiResourceCacgeManager; + } + + + @Override + public void addAPIResourcePermissionToCache(APIResourcePermissionCacheKey cacheKey, List permissions) { + Cache> lCache = DeviceManagerUtil.getAPIResourcePermissionCache(); + if (lCache != null) { + if (lCache.containsKey(cacheKey)) { + this.updateAPIResourcePermissionInCache(cacheKey, permissions); + } else { + lCache.put(cacheKey, permissions); + } + } + } + + @Override + public void updateAPIResourcePermissionInCache(APIResourcePermissionCacheKey cacheKey, List permissions) { + + Cache> lCache = DeviceManagerUtil.getAPIResourcePermissionCache(); + if (lCache != null) { + if (lCache.containsKey(cacheKey)) { + lCache.replace(cacheKey, permissions); + } + } + + } + + @Override + public List getAPIResourceRermissionFromCache(APIResourcePermissionCacheKey cacheKey) { + Cache> lCache = DeviceManagerUtil.getAPIResourcePermissionCache(); + if (lCache != null) { + return lCache.get(cacheKey); + } + return null; + } +} 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 d6a6a84118..e60b14eee9 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 @@ -67,6 +67,7 @@ public class AnnotationProcessor { private static final String SWAGGER_ANNOTATIONS_PROPERTIES_DESCRIPTION = "description"; private static final String SWAGGER_ANNOTATIONS_PROPERTIES_KEY = "key"; private static final String SWAGGER_ANNOTATIONS_PROPERTIES_PERMISSIONS = "permissions"; + private static final String SWAGGER_ANNOTATIONS_PROPERTIES_ROLES = "roles"; private static final String ANNOTATIONS_SCOPES = "scopes"; private static final String ANNOTATIONS_SCOPE = "scope"; private static final String DEFAULT_PERM_NAME = "default"; @@ -239,6 +240,7 @@ public class AnnotationProcessor { subCtx = makeContextURLReady(resourceRootContext) + makeContextURLReady(subCtx); } permission.setUrl(replaceDynamicPathVariables(subCtx)); + permission.setUrlPattern(permission.getUrl().replace("*", "[a-zA-Z0-9-_]+")); String httpMethod; for (int i = 0; i < annotations.length; i++) { httpMethod = getHTTPMethodAnnotation(annotations[i]); @@ -398,7 +400,7 @@ public class AnnotationProcessor { if (scope != null) { permission.setName(scope.getName()); //TODO: currently permission tree supports only adding one permission per API point. - permission.setPath(scope.getRoles().split(" ")[0]); + permission.setPath(scope.getPermissions().split(" ")[0]); } else { log.warn("No Scope mapping is done for scope key: " + scopeKey); permission.setName(DEFAULT_PERM_NAME); @@ -420,8 +422,11 @@ public class AnnotationProcessor { Scope scope; String permissions[]; StringBuilder aggregatedPermissions; + String roles[]; + StringBuilder aggregatedRoles; for(int i=0; i permissions = annotationProcessor.extractPermissions(annotatedAPIClasses); PermissionManagerService permissionManagerService = PermissionManagerServiceImpl.getInstance(); - if (permissions != null) { - for (Permission permission : permissions) { - permissionManagerService.addPermission(permission); - } - } + permissionManagerService.addPermission(contextPath, permissions); + } catch (PermissionManagementException e) { log.error("Exception occurred while adding the permissions from webapp : " + servletContext.getContextPath(), e); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java index 5bd7a3730b..9bbb385b20 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java @@ -22,11 +22,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.device.mgt.common.event.config.EventConfigurationProviderService; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; +import org.wso2.carbon.device.mgt.common.event.config.EventConfigurationProviderService; +import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.common.geo.service.GeoLocationProviderService; import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; import org.wso2.carbon.device.mgt.common.metadata.mgt.MetadataManagementService; @@ -48,6 +48,7 @@ import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig; import org.wso2.carbon.device.mgt.core.config.datasource.DataSourceConfig; import org.wso2.carbon.device.mgt.core.config.tenant.PlatformConfigurationManagementServiceImpl; +import org.wso2.carbon.device.mgt.core.config.ui.UIConfigurationManager; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; import org.wso2.carbon.device.mgt.core.dao.GroupManagementDAOFactory; import org.wso2.carbon.device.mgt.core.device.details.mgt.DeviceInformationManager; @@ -75,7 +76,6 @@ import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderServiceIm import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderService; import org.wso2.carbon.device.mgt.core.service.GroupManagementProviderServiceImpl; import org.wso2.carbon.device.mgt.core.task.DeviceTaskManagerService; -import org.wso2.carbon.device.mgt.core.config.ui.UIConfigurationManager; import org.wso2.carbon.device.mgt.core.util.DeviceManagementSchemaInitializer; import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; import org.wso2.carbon.device.mgt.core.util.DeviceMgtTenantMgtListener; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java index 07865c5095..c2591a1df6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java @@ -18,13 +18,16 @@ package org.wso2.carbon.device.mgt.core.permission.mgt; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.permission.mgt.Permission; import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagementException; import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagerService; +import org.wso2.carbon.device.mgt.core.cache.APIResourcePermissionCacheKey; +import org.wso2.carbon.device.mgt.core.cache.impl.APIResourcePermissionCacheManagerImpl; -import java.util.HashSet; +import java.util.List; import java.util.Properties; -import java.util.Set; /** * This class will add, update custom permissions defined in permission.xml in webapps and it will @@ -32,10 +35,7 @@ import java.util.Set; */ public class PermissionManagerServiceImpl implements PermissionManagerService { - public static final String URL_PROPERTY = "URL"; - public static final String HTTP_METHOD_PROPERTY = "HTTP_METHOD"; private static PermissionManagerServiceImpl registryBasedPermissionManager; - private static PermissionTree permissionTree; // holds the permissions at runtime. private PermissionManagerServiceImpl() { } @@ -45,7 +45,6 @@ public class PermissionManagerServiceImpl implements PermissionManagerService { synchronized (PermissionManagerServiceImpl.class) { if (registryBasedPermissionManager == null) { registryBasedPermissionManager = new PermissionManagerServiceImpl(); - permissionTree = new PermissionTree(); } } } @@ -53,21 +52,22 @@ public class PermissionManagerServiceImpl implements PermissionManagerService { } @Override - public boolean addPermission(Permission permission) throws PermissionManagementException { - // adding a permission to the tree - permission.setPath(permission.getPath()); - permissionTree.addPermission(permission); - return PermissionUtils.putPermission(permission); + public boolean addPermission(String context, List permissions) throws PermissionManagementException { + try { + for (Permission permission : permissions) { + PermissionUtils.putPermission(permission); + } + APIResourcePermissionCacheManagerImpl.getInstance().addAPIResourcePermissionToCache( + new APIResourcePermissionCacheKey(context), permissions); + } catch (PermissionManagementException e) { + return false; + } + return true; } @Override - public Permission getPermission(Properties properties) throws PermissionManagementException { - String url = (String) properties.get(URL_PROPERTY); - String httpMethod = (String) properties.get(HTTP_METHOD_PROPERTY); - - if (url == null || url.isEmpty() || httpMethod == null || httpMethod.isEmpty()) { - throw new PermissionManagementException("Resource URI/HTTP method is empty"); - } - return permissionTree.getPermission(url, httpMethod); + public List getPermission(String context) throws PermissionManagementException { + return APIResourcePermissionCacheManagerImpl.getInstance().getAPIResourceRermissionFromCache( + new APIResourcePermissionCacheKey(context)); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java index 0a2932e930..4415acec60 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java @@ -73,8 +73,10 @@ import org.wso2.carbon.device.mgt.common.group.mgt.DeviceGroup; import org.wso2.carbon.device.mgt.common.group.mgt.GroupManagementException; import org.wso2.carbon.device.mgt.common.notification.mgt.NotificationManagementException; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; +import org.wso2.carbon.device.mgt.common.permission.mgt.Permission; import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import org.wso2.carbon.device.mgt.core.DeviceManagementConstants; +import org.wso2.carbon.device.mgt.core.cache.APIResourcePermissionCacheKey; import org.wso2.carbon.device.mgt.core.cache.DeviceCacheKey; import org.wso2.carbon.device.mgt.core.cache.GeoCacheKey; import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; @@ -136,6 +138,7 @@ public final class DeviceManagerUtil { public static final String GENERAL_CONFIG_RESOURCE_PATH = "general"; private static boolean isDeviceCacheInitialized = false; + private static boolean isAPIResourcePermissionCacheInitialized = false; private static boolean isGeoFenceCacheInitialized = false; public static Document convertToDocument(File file) throws DeviceManagementException { @@ -663,6 +666,44 @@ public final class DeviceManagerUtil { } } + public static void initializeAPIResourcePermissionCache() { +// DeviceManagementConfig config = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); +// int deviceCacheExpiry = config.getDeviceCacheConfiguration().getExpiryTime(); +// long deviceCacheCapacity = config.getDeviceCacheConfiguration().getCapacity(); + CacheManager manager = getCacheManager(); +// if (config.getDeviceCacheConfiguration().isEnabled()) { + if(!isDeviceCacheInitialized) { + isDeviceCacheInitialized = true; + if (manager != null) { +// if (deviceCacheExpiry > 0) { +// manager.createCacheBuilder(DeviceManagementConstants.DEVICE_CACHE). +// setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, +// deviceCacheExpiry)).setExpiry(CacheConfiguration.ExpiryType.ACCESSED, new CacheConfiguration. +// Duration(TimeUnit.SECONDS, deviceCacheExpiry)).setStoreByValue(true).build(); +// if(deviceCacheCapacity > 0 ) { +// ((CacheImpl) manager.getCache(DeviceManagementConstants.DEVICE_CACHE)). +// setCapacity(deviceCacheCapacity); +// } +// } else { + manager.getCache(DeviceManagementConstants.API_RESOURCE_PERMISSION_CACHE); +// } + } else { +// if (deviceCacheExpiry > 0) { +// Caching.getCacheManager(). +// createCacheBuilder(DeviceManagementConstants.DEVICE_CACHE). +// setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, +// deviceCacheExpiry)).setExpiry(CacheConfiguration.ExpiryType.ACCESSED, new CacheConfiguration. +// Duration(TimeUnit.SECONDS, deviceCacheExpiry)).setStoreByValue(true).build(); +// ((CacheImpl)(manager.getCache(DeviceManagementConstants.DEVICE_CACHE))). +// setCapacity(deviceCacheCapacity); +// } else { + Caching.getCacheManager().getCache(DeviceManagementConstants.API_RESOURCE_PERMISSION_CACHE); +// } + } + } +// } + } + /** * Enable Geofence caching according to the configurations proviced by cdm-config.xml */ @@ -722,6 +763,24 @@ public final class DeviceManagerUtil { return deviceCache; } + public static Cache> getAPIResourcePermissionCache() { +// DeviceManagementConfig config = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); + CacheManager manager = getCacheManager(); + Cache> apiResourcePermissionCache = null; +// if (config.getDeviceCacheConfiguration().isEnabled()) { + if(!isAPIResourcePermissionCacheInitialized) { + initializeAPIResourcePermissionCache(); + } + if (manager != null) { + apiResourcePermissionCache = manager.getCache(DeviceManagementConstants.API_RESOURCE_PERMISSION_CACHE); + } else { + apiResourcePermissionCache = Caching.getCacheManager(DeviceManagementConstants.DM_CACHE_MANAGER) + .getCache(DeviceManagementConstants.API_RESOURCE_PERMISSION_CACHE); + } +// } + return apiResourcePermissionCache; + } + /** * Get geofence cache object * @return {@link Cache} diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/util/JWTClientUtil.java b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/util/JWTClientUtil.java index 93f6e6fd17..f9980d2122 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/util/JWTClientUtil.java +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/src/main/java/org/wso2/carbon/identity/jwt/client/extension/util/JWTClientUtil.java @@ -232,18 +232,18 @@ public class JWTClientUtil { } List aud = jwtConfig.getAudiences(); //set up the basic claims - JWTClaimsSet claimsSet = new JWTClaimsSet(); - claimsSet.setIssueTime(new Date(iat)); - claimsSet.setExpirationTime(new Date(exp)); - claimsSet.setIssuer(iss); - claimsSet.setSubject(username); - claimsSet.setNotBeforeTime(new Date(nbf)); - claimsSet.setJWTID(jti); - claimsSet.setAudience(aud); - claimsSet.setClaim(SIGNED_JWT_AUTH_USERNAME, username); + JWTClaimsSet.Builder claimsSet = new JWTClaimsSet.Builder(); + claimsSet.issueTime(new Date(iat)); + claimsSet.expirationTime(new Date(exp)); + claimsSet.issuer(iss); + claimsSet.subject(username); + claimsSet.notBeforeTime(new Date(nbf)); + claimsSet.jwtID(jti); + claimsSet.audience(aud); + claimsSet.claim(SIGNED_JWT_AUTH_USERNAME, username); if (customClaims != null && !customClaims.isEmpty()) { for (String key : customClaims.keySet()) { - claimsSet.setClaim(key, customClaims.get(key)); + claimsSet.claim(key, customClaims.get(key)); } } @@ -280,7 +280,7 @@ public class JWTClientUtil { } } JWSSigner signer = new RSASSASigner(rsaPrivateKey); - SignedJWT signedJWT = new SignedJWT(new JWSHeader(JWSAlgorithm.RS256), claimsSet); + SignedJWT signedJWT = new SignedJWT(new JWSHeader(JWSAlgorithm.RS256), claimsSet.build()); signedJWT.sign(signer); String assertion = signedJWT.serialize(); return assertion; diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/java/io/entgra/transport/mgt/sms/handler/api/service/ConfigurationManagementService.java b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/java/io/entgra/transport/mgt/sms/handler/api/service/ConfigurationManagementService.java index 3a771222c7..3d4f1d9e0f 100644 --- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/java/io/entgra/transport/mgt/sms/handler/api/service/ConfigurationManagementService.java +++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/java/io/entgra/transport/mgt/sms/handler/api/service/ConfigurationManagementService.java @@ -64,6 +64,7 @@ import javax.ws.rs.core.Response; name = "View configurations", description = "", key = "perm:sms-handler:view-configuration", + roles = {"Internal/everyone"}, permissions = {"/sms-handler/platform-configurations/view"} ) }) diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index e041b45f83..a7d96cbd94 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -55,22 +55,22 @@ org.wso2.carbon.webapp.authenticator.framework.* - com.nimbusds.jose, - com.nimbusds.jose.crypto, - com.nimbusds.jwt, + com.nimbusds.jose;version="${nimbus.orbit.version.range}", + com.nimbusds.jose.crypto;version="${nimbus.orbit.version.range}", + com.nimbusds.jwt;version="${nimbus.orbit.version.range}", javax.xml.bind, javax.xml.bind.annotation, javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, javax.xml.validation, - - - + org.apache.catalina;version="9.0", + org.apache.catalina.connector;version="9.0", + org.apache.catalina.util;version="9.0", org.apache.commons.logging, - - - - org.osgi.service.component, - org.osgi.framework, + org.apache.coyote;version="9.0", + org.apache.tomcat.util.buf;version="9.0", + org.apache.tomcat.util.http;version="9.0", + org.osgi.framework.*;version="${imp.package.version.osgi.framework}", + org.osgi.service.*;version="${imp.package.version.osgi.service}", org.w3c.dom, org.wso2.carbon.context, org.wso2.carbon.core.util, @@ -85,15 +85,15 @@ org.wso2.carbon.utils, org.wso2.carbon.utils.multitenancy, org.xml.sax, - com.google.gson.*, + javax.servlet, javax.servlet.http, javax.xml, org.apache.axis2.transport.http, org.wso2.carbon.certificate.mgt.core.*, - org.wso2.carbon.device.mgt.core.permission.mgt, + org.wso2.carbon.device.mgt.core.permission.mgt.*, org.wso2.carbon.device.mgt.common.*, - org.wso2.carbon.device.mgt.common.permission.mgt, + org.wso2.carbon.device.mgt.common.permission.mgt.*, org.apache.axis2, org.apache.axis2.client, org.apache.commons.codec.binary;version="${commons-codec.wso2.osgi.version.range}", @@ -114,6 +114,9 @@ org.wso2.carbon.base, org.owasp.encoder + + + @@ -194,6 +197,22 @@ org.wso2.carbon.identity.inbound.auth.oauth2 org.wso2.carbon.identity.oauth + + + + org.wso2.orbit.com.nimbusds + nimbus-jose-jwt + + + + + com.nimbusds + nimbus-jose-jwt + + + + + org.wso2.carbon @@ -202,6 +221,7 @@ org.wso2.orbit.com.nimbusds nimbus-jose-jwt + compile org.wso2.carbon.devicemgt diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/AuthenticationFrameworkUtil.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/AuthenticationFrameworkUtil.java index 7c506737e7..c6d12b9286 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/AuthenticationFrameworkUtil.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/AuthenticationFrameworkUtil.java @@ -73,7 +73,7 @@ public class AuthenticationFrameworkUtil { } } - static boolean isUserAuthorized(int tenantId, String tenantDomain, String username, String + public static boolean isUserAuthorized(int tenantId, String tenantDomain, String username, String permission) throws AuthenticationException { boolean tenantFlowStarted = false; diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java index 897bba0812..6547c48f35 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java @@ -18,11 +18,9 @@ */ package org.wso2.carbon.webapp.authenticator.framework; -import com.google.gson.Gson; import org.apache.catalina.Context; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; -import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.owasp.encoder.Encode; @@ -33,6 +31,7 @@ import org.wso2.carbon.user.api.Tenant; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; import org.wso2.carbon.webapp.authenticator.framework.authenticator.WebappAuthenticator; +import org.wso2.carbon.webapp.authenticator.framework.authorizer.PermissionAuthorizer; import org.wso2.carbon.webapp.authenticator.framework.authorizer.WebappTenantAuthorizer; import javax.servlet.http.HttpServletResponse; @@ -48,9 +47,6 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { private static final Log log = LogFactory.getLog(WebappAuthenticationValve.class); private static final TreeMap nonSecuredEndpoints = new TreeMap<>(); - private static final String PERMISSION_PREFIX = "/permission/admin"; - public static final String AUTHORIZE_PERMISSION = "Authorize-Permission"; - private static InetAddress inetAddress = null; @Override @@ -81,8 +77,7 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { } } - if ((this.isContextSkipped(request) || this.skipAuthentication(request)) - && (StringUtils.isEmpty(request.getHeader(AUTHORIZE_PERMISSION)))) { + if ((this.isContextSkipped(request) || this.skipAuthentication(request))) { this.getNext().invoke(request, response, compositeValve); return; } @@ -103,29 +98,12 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { // This section will allow to validate a given access token is authenticated to access given // resource(permission) if (request.getCoyoteRequest() != null - && StringUtils.isNotEmpty(request.getHeader(AUTHORIZE_PERMISSION)) && (authenticationInfo.getStatus() == WebappAuthenticator.Status.CONTINUE || authenticationInfo.getStatus() == WebappAuthenticator.Status.SUCCESS)) { boolean isAllowed; - try { - isAllowed = AuthenticationFrameworkUtil.isUserAuthorized( - authenticationInfo.getTenantId(), authenticationInfo.getTenantDomain(), - authenticationInfo.getUsername(), - PERMISSION_PREFIX + request.getHeader (AUTHORIZE_PERMISSION)); - } catch (AuthenticationException e) { - String msg = "Could not authorize permission"; - log.error(msg); - AuthenticationFrameworkUtil.handleResponse(request, response, - HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg); - return; - } - - if (isAllowed) { - Gson gson = new Gson(); - AuthenticationFrameworkUtil.handleResponse(request, response, HttpServletResponse.SC_OK, - gson.toJson(authenticationInfo)); - return; - } else { + WebappAuthenticator.Status authorizeStatus = PermissionAuthorizer.authorize(request, authenticationInfo); + isAllowed = WebappAuthenticator.Status.SUCCESS == authorizeStatus; + if (!isAllowed) { log.error("Unauthorized message from user " + authenticationInfo.getUsername()); AuthenticationFrameworkUtil.handleResponse(request, response, HttpServletResponse.SC_FORBIDDEN, "Unauthorized to access the API"); @@ -133,7 +111,7 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { } } - Tenant tenant = null; + Tenant tenant = null; if (authenticationInfo.getTenantId() != -1) { try { PrivilegedCarbonContext.startTenantFlow(); diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/MatchingResource.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/MatchingResource.java new file mode 100644 index 0000000000..0c24986171 --- /dev/null +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/MatchingResource.java @@ -0,0 +1,30 @@ +package org.wso2.carbon.webapp.authenticator.framework.authorizer; + +/** + * Created by amalka on 6/26/21. + */ +public class MatchingResource { + private String urlPattern; + private String permission; + + public MatchingResource(String urlPattern, String permission) { + this.urlPattern = urlPattern; + this.permission = permission; + } + + public String getUrlPattern() { + return urlPattern; + } + + public void setUrlPattern(String urlPattern) { + this.urlPattern = urlPattern; + } + + public String getPermission() { + return permission; + } + + public void setPermission(String permission) { + this.permission = permission; + } +} diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java new file mode 100644 index 0000000000..dd3e8cceff --- /dev/null +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.webapp.authenticator.framework.authorizer; + +import org.apache.catalina.connector.Request; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.device.mgt.common.permission.mgt.Permission; +import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagementException; +import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagerService; +import org.wso2.carbon.device.mgt.core.permission.mgt.PermissionManagerServiceImpl; +import org.wso2.carbon.webapp.authenticator.framework.AuthenticationException; +import org.wso2.carbon.webapp.authenticator.framework.AuthenticationFrameworkUtil; +import org.wso2.carbon.webapp.authenticator.framework.AuthenticationInfo; +import org.wso2.carbon.webapp.authenticator.framework.authenticator.WebappAuthenticator; + +import java.util.ArrayList; +import java.util.List; +import java.util.StringTokenizer; + +public class PermissionAuthorizer { + + private static final Log log = LogFactory.getLog(PermissionAuthorizer.class); + + public static WebappAuthenticator.Status authorize(Request request, AuthenticationInfo authenticationInfo) { + String requestUri = request.getRequestURI(); + String requestMethod = request.getMethod(); + String context = request.getContextPath(); + + if (requestUri == null || requestUri.isEmpty() || requestMethod == null || requestMethod.isEmpty()) { + return WebappAuthenticator.Status.CONTINUE; + } + + PermissionManagerService registryBasedPermissionManager = + PermissionManagerServiceImpl.getInstance(); + List matchingPermissions = null; + try { + matchingPermissions = registryBasedPermissionManager.getPermission(context); + } catch (PermissionManagementException e) { + log.error( + "Error occurred while fetching the permission for URI : " + requestUri + + ", msg = " + e.getMessage()); + } + + if (matchingPermissions == null) { + if (log.isDebugEnabled()) { + log.debug("Permission to request '" + requestUri + "' is not defined in the configuration"); + } + return WebappAuthenticator.Status.FAILURE; + } + + String requiredPermission = null; + List matchingResources = new ArrayList<>(); + for (Permission permission : matchingPermissions) { + if (requestMethod.equals(permission.getMethod()) && requestUri.matches(permission.getUrlPattern())) { + if (requestUri.equals(permission.getUrl())) { // is there a exact match + requiredPermission = permission.getPath(); + break; + } else { // all templated urls add to a list + matchingResources.add(new MatchingResource(permission.getUrlPattern().replace(context, ""), permission.getPath())); + } + } + } + + if (requiredPermission == null) { + if (matchingResources.size() == 1) { // only 1 templated url found + requiredPermission = matchingResources.get(0).getPermission(); + } + + if (matchingResources.size() > 1) { // more than 1 templated urls found + String urlWithoutContext = requestUri.replace(context, ""); + StringTokenizer st = new StringTokenizer(urlWithoutContext, "/"); + int tokenPosition = 1; + while (st.hasMoreTokens()) { + List tempList = new ArrayList<>(); + String currentToken = st.nextToken(); + for (MatchingResource matchingResource : matchingResources) { + StringTokenizer stmr = new StringTokenizer(matchingResource.getUrlPattern(), "/"); + int internalTokenPosition = 1; + while (stmr.hasMoreTokens()) { + String internalToken = stmr.nextToken(); + if ((tokenPosition == internalTokenPosition) && currentToken.equals(internalToken)) { + tempList.add(matchingResource); + } + internalTokenPosition++; + if (tokenPosition < internalTokenPosition) { + break; + } + } + } + if (tempList.size() == 1) { + requiredPermission = tempList.get(0).getPermission(); + break; + } + tokenPosition++; + } + } + } + + if (requiredPermission == null) { + if (log.isDebugEnabled()) { + log.debug("Matching permission not found for " + requestUri); + } + return WebappAuthenticator.Status.FAILURE; + } + + boolean isUserAuthorized; + try { + isUserAuthorized = AuthenticationFrameworkUtil.isUserAuthorized( + authenticationInfo.getTenantId(), authenticationInfo.getTenantDomain(), + authenticationInfo.getUsername(), requiredPermission); + } catch (AuthenticationException e) { + log.error("Error occurred while retrieving user store. " + e.getMessage()); + return WebappAuthenticator.Status.FAILURE; + } + + if (isUserAuthorized) { + return WebappAuthenticator.Status.SUCCESS; + } else { + return WebappAuthenticator.Status.FAILURE; + } + + } + +} + + + diff --git a/pom.xml b/pom.xml index ea11339d6e..eacfe8acda 100644 --- a/pom.xml +++ b/pom.xml @@ -2175,8 +2175,8 @@ 1.0.2 - 2.26.1.wso2v3 - [2.26.1, 3.0.0) + 7.3.0.wso2v1 + [7.3, 8) 2.0.1 From 30a1d92fde4864dd814969951f32c4e451418642 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Sat, 26 Jun 2021 13:48:26 +0530 Subject: [PATCH 24/54] scope-role-permission refactoring and webapp authorization --- .../service/impl/DeviceManagementConfigServiceImpl.java | 7 ------- 1 file changed, 7 deletions(-) diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java index ac9112da31..4f13273e21 100644 --- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java +++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/impl/DeviceManagementConfigServiceImpl.java @@ -274,16 +274,9 @@ public class DeviceManagementConfigServiceImpl implements DeviceManagementConfig @Path("/permissions") @Produces({MediaType.APPLICATION_JSON}) public Response addPermission(List permissions) { -// PermissionManagerService permissionService = DeviceMgtAPIUtils.getPermissionManagerService(); -// org.wso2.carbon.device.mgt.common.permission.mgt.Permission permission = new org -// .wso2.carbon.device.mgt.common.permission.mgt.Permission(); - for (String path : permissions) { -// permission.setPath(path); -// permission.setUrl(path); try { PermissionUtils.putPermission(path); -// permissionService.addPermission(permission); } catch (PermissionManagementException e) { String msg = "Error occurred adding permission"; log.error(msg, e); From c558cec88e8c7aa44f8e809fd02bfff36f83ee0f Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Sat, 26 Jun 2021 13:53:33 +0530 Subject: [PATCH 25/54] scope-role-permission refactoring and webapp authorization --- .../mgt/core/util/DeviceManagerUtil.java | 46 +------------------ .../pom.xml | 9 ---- 2 files changed, 2 insertions(+), 53 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java index 4415acec60..f83e19c62f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java @@ -599,19 +599,6 @@ public final class DeviceManagerUtil { return Caching.getCacheManagerFactory().getCacheManager(DeviceManagementConstants.DM_CACHE_MANAGER); } - //todo:amalka -// public static EventsPublisherService getEventPublisherService() { -// PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); -// EventsPublisherService eventsPublisherService = -// (EventsPublisherService) ctx.getOSGiService(EventsPublisherService.class, null); -// if (eventsPublisherService == null) { -// String msg = "Event Publisher service has not initialized."; -// log.error(msg); -// throw new IllegalStateException(msg); -// } -// return eventsPublisherService; -// } - /** * Retrieve EventConfigurationProviderService osgi service component * @return {@link EventConfigurationProviderService} service component @@ -667,41 +654,15 @@ public final class DeviceManagerUtil { } public static void initializeAPIResourcePermissionCache() { -// DeviceManagementConfig config = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); -// int deviceCacheExpiry = config.getDeviceCacheConfiguration().getExpiryTime(); -// long deviceCacheCapacity = config.getDeviceCacheConfiguration().getCapacity(); CacheManager manager = getCacheManager(); -// if (config.getDeviceCacheConfiguration().isEnabled()) { - if(!isDeviceCacheInitialized) { - isDeviceCacheInitialized = true; + if(!isAPIResourcePermissionCacheInitialized) { + isAPIResourcePermissionCacheInitialized = true; if (manager != null) { -// if (deviceCacheExpiry > 0) { -// manager.createCacheBuilder(DeviceManagementConstants.DEVICE_CACHE). -// setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, -// deviceCacheExpiry)).setExpiry(CacheConfiguration.ExpiryType.ACCESSED, new CacheConfiguration. -// Duration(TimeUnit.SECONDS, deviceCacheExpiry)).setStoreByValue(true).build(); -// if(deviceCacheCapacity > 0 ) { -// ((CacheImpl) manager.getCache(DeviceManagementConstants.DEVICE_CACHE)). -// setCapacity(deviceCacheCapacity); -// } -// } else { manager.getCache(DeviceManagementConstants.API_RESOURCE_PERMISSION_CACHE); -// } } else { -// if (deviceCacheExpiry > 0) { -// Caching.getCacheManager(). -// createCacheBuilder(DeviceManagementConstants.DEVICE_CACHE). -// setExpiry(CacheConfiguration.ExpiryType.MODIFIED, new CacheConfiguration.Duration(TimeUnit.SECONDS, -// deviceCacheExpiry)).setExpiry(CacheConfiguration.ExpiryType.ACCESSED, new CacheConfiguration. -// Duration(TimeUnit.SECONDS, deviceCacheExpiry)).setStoreByValue(true).build(); -// ((CacheImpl)(manager.getCache(DeviceManagementConstants.DEVICE_CACHE))). -// setCapacity(deviceCacheCapacity); -// } else { Caching.getCacheManager().getCache(DeviceManagementConstants.API_RESOURCE_PERMISSION_CACHE); -// } } } -// } } /** @@ -764,10 +725,8 @@ public final class DeviceManagerUtil { } public static Cache> getAPIResourcePermissionCache() { -// DeviceManagementConfig config = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); CacheManager manager = getCacheManager(); Cache> apiResourcePermissionCache = null; -// if (config.getDeviceCacheConfiguration().isEnabled()) { if(!isAPIResourcePermissionCacheInitialized) { initializeAPIResourcePermissionCache(); } @@ -777,7 +736,6 @@ public final class DeviceManagerUtil { apiResourcePermissionCache = Caching.getCacheManager(DeviceManagementConstants.DM_CACHE_MANAGER) .getCache(DeviceManagementConstants.API_RESOURCE_PERMISSION_CACHE); } -// } return apiResourcePermissionCache; } diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index a7d96cbd94..2bf0318675 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -114,9 +114,6 @@ org.wso2.carbon.base, org.owasp.encoder - - - @@ -199,18 +196,12 @@ org.wso2.carbon.identity.oauth - org.wso2.orbit.com.nimbusds nimbus-jose-jwt - - com.nimbusds nimbus-jose-jwt - - - From f9a9cff0b9bc14148d8acdc0c16e03528e2512fc Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 28 Jun 2021 13:04:13 +0530 Subject: [PATCH 26/54] updated user roles --- .../ApplicationManagementPublisherAPI.java | 4 +- ...pplicationManagementPublisherAdminAPI.java | 2 +- .../ReviewManagementPublisherAdminAPI.java | 4 +- .../services/ApplicationManagementAPI.java | 2 +- .../api/services/ReviewManagementAPI.java | 4 +- .../services/SubscriptionManagementAPI.java | 4 +- .../admin/ReviewManagementStoreAdminAPI.java | 2 +- .../admin/SubscriptionManagementAdminAPI.java | 2 +- .../mgt/jaxrs/api/CertificateMgtService.java | 2 +- .../CertificateManagementAdminService.java | 10 +-- .../DeviceManagementConfigService.java | 8 +-- .../api/ActivityInfoProviderService.java | 2 +- .../AnalyticsArtifactsManagementService.java | 16 ++--- .../api/ConfigurationManagementService.java | 4 +- .../jaxrs/service/api/DeviceAgentService.java | 10 +-- .../api/DeviceEventManagementService.java | 4 +- .../service/api/DeviceManagementService.java | 22 +++---- .../api/DeviceTypeManagementService.java | 8 +-- .../service/api/GeoLocationBasedService.java | 6 +- .../service/api/GroupManagementService.java | 28 ++++---- .../jaxrs/service/api/MetadataService.java | 8 +-- .../api/NotificationManagementService.java | 4 +- .../service/api/PolicyManagementService.java | 20 +++--- .../service/api/RemoteSessionService.java | 2 +- .../service/api/ReportManagementService.java | 2 +- .../service/api/RoleManagementService.java | 16 ++--- .../service/api/UserManagementService.java | 26 ++++---- .../ApplicationManagementAdminService.java | 4 +- ...DeviceAccessAuthorizationAdminService.java | 2 +- ...AnalyticsArtifactUploaderAdminService.java | 2 +- .../admin/DeviceManagementAdminService.java | 6 +- .../DeviceTypeManagementAdminService.java | 6 +- .../admin/GroupManagementAdminService.java | 6 +- .../api/admin/UserManagementAdminService.java | 4 +- .../DeviceManagementServiceComponent.java | 4 ++ .../core/internal/UserRoleCreateObserver.java | 64 +++++++++++++++++++ .../ConfigurationManagementService.java | 2 +- 37 files changed, 195 insertions(+), 127 deletions(-) create mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java index 342552a230..19bf82f0f0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java @@ -86,14 +86,14 @@ import javax.ws.rs.core.Response; name = "Get ApplicationDTO Details", description = "Get application details", key = "perm:app:publisher:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/app-mgt/publisher/application/view"} ), @Scope( name = "Update an ApplicationDTO", description = "Update an application", key = "perm:app:publisher:update", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/app-mgt/publisher/application/update"} ) } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java index b967577d8b..bbf92d37eb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java @@ -68,7 +68,7 @@ import java.util.List; name = "Delete Application Release", description = "Delete Application Release", key = "perm:admin:app:publisher:update", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/app-mgt/publisher/admin/application/update"} ) } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java index 5a10d06872..73a1ccb636 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java @@ -65,14 +65,14 @@ scopes = { name = "Update a Review", description = "Update a Review of application.", key = "perm:admin:app:review:update", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/app-mgt/publisher/admin/review/update"} ), @Scope( name = "Get Review Details", description = "Get review details of application.", key = "perm:admin:app:review:view", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/app-mgt/publisher/admin/review/view"} ) } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java index 8d0e1bb1fb..eaf5380ddf 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java @@ -68,7 +68,7 @@ import javax.ws.rs.core.Response; name = "Get Application Details", description = "Get application details", key = "perm:app:store:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/app-mgt/store/application/view"} ) } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPI.java index 330579effe..a620045426 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPI.java @@ -73,14 +73,14 @@ import java.util.List; name = "Get Review Details", description = "Get review details from application store.", key = "perm:app:review:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/app-mgt/store/review/view"} ), @Scope( name = "Update a Review", description = "Update a Review from the application store.", key = "perm:app:review:update", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/app-mgt/store/review/update"} ), } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/SubscriptionManagementAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/SubscriptionManagementAPI.java index 3d96b242fc..42b20140d0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/SubscriptionManagementAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/SubscriptionManagementAPI.java @@ -70,14 +70,14 @@ import java.util.List; name = "Install an ApplicationDTO", description = "Install an application", key = "perm:app:subscription:install", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/app-mgt/store/subscription/install"} ), @Scope( name = "Uninstall an Application", description = "Uninstall an application", key = "perm:app:subscription:uninstall", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/app-mgt/store/subscription/uninstall"} ) } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java index 9b26fa939f..cfaf91a5cc 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java @@ -63,7 +63,7 @@ scopes = { name = "Update a Review", description = "Update a Review of applications.", key = "perm:admin:app:review:update", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/app-mgt/store/admin/review/update"} ) } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java index 66c39e29a3..d46594d6cc 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java +++ b/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java @@ -67,7 +67,7 @@ import java.util.List; name = "View Application Subscriptions", description = "View Application Subscriptions.", key = "perm:admin:app:subscription:view", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/app-mgt/store/admin/subscription/view"} ) } diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/java/org/wso2/carbon/certificate/mgt/jaxrs/api/CertificateMgtService.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/java/org/wso2/carbon/certificate/mgt/jaxrs/api/CertificateMgtService.java index a061b57d82..b6ec9993fe 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/java/org/wso2/carbon/certificate/mgt/jaxrs/api/CertificateMgtService.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/java/org/wso2/carbon/certificate/mgt/jaxrs/api/CertificateMgtService.java @@ -41,7 +41,7 @@ import javax.ws.rs.core.Response; name = "Sign CSR", description = "Sign CSR", key = "perm:sign-csr", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/certificates/manage"} ) } diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java index 87b6bb04fe..5204205dc1 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java @@ -45,35 +45,35 @@ import javax.ws.rs.core.Response; name = "Adding a new SSL certificate", description = "Adding a new SSL certificate", key = "perm:admin:certificates:add", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/certificates/add"} ), @Scope( name = "Getting Details of an SSL Certificate", description = "Getting Details of an SSL Certificate", key = "perm:admin:certificates:details", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/certificates/details"} ), @Scope( name = "Getting Details of Certificates", description = "Getting Details of Certificates", key = "perm:admin:certificates:view", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/certificates/view"} ), @Scope( name = "Deleting an SSL Certificate", description = "Deleting an SSL Certificate", key = "perm:admin:certificates:delete", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/certificates/delete"} ), @Scope( name = "Verify SSL certificate", description = "Verify SSL certificate", key = "perm:admin:certificates:verify", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/certificates/verify"} ) } diff --git a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/DeviceManagementConfigService.java b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/DeviceManagementConfigService.java index c4bdc58b17..d5fe117a63 100644 --- a/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/DeviceManagementConfigService.java +++ b/components/device-mgt/io.entgra.carbon.device.mgt.config.api/src/main/java/io/entgra/carbon/device/mgt/config/jaxrs/service/DeviceManagementConfigService.java @@ -71,28 +71,28 @@ import java.util.List; name = "View configurations", description = "", key = "perm:view-configuration", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/platform-configurations/view"} ), @Scope( name = "Manage configurations", description = "", key = "perm:manage-configuration", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/platform-configurations/manage"} ), @Scope( name = "Getting Details of Device tenants", description = "Getting Details of Device tenants", key = "perm:admin:tenant:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/tenants/view"} ), @Scope( name = "Add a permission to the permission tree", description = "Add a permission to the permission tree", key = "perm:admin:permissions:add", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/permissions/add"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java index 4219f6b669..43bd7e847b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ActivityInfoProviderService.java @@ -76,7 +76,7 @@ import javax.ws.rs.core.Response; name = "Get activities", description = "Get activities", key = "perm:get-activity", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/AnalyticsArtifactsManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/AnalyticsArtifactsManagementService.java index b6783010ac..608d19fb92 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/AnalyticsArtifactsManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/AnalyticsArtifactsManagementService.java @@ -68,49 +68,49 @@ import javax.ws.rs.core.Response; name = "Create Event Stream Artifact", description = "Create Event Stream Artifact", key = "perm:analytics:artifacts:stream", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/analytics/artifacts/stream/add"}), @Scope( name = "Delete Stream Artifact", description = "Delete Stream Artifact", key = "perm:analytics:artifacts:stream:delete", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/analytics/artifacts/stream/delete"}), @Scope( name = "Create Event Receiver Artifact", description = "Create Event Receiver Artifact", key = "perm:analytics:artifacts:receiver", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/analytics/artifacts/receiver/add"}), @Scope( name = "Delete Receiver Artifact", description = "Delete Receiver Artifact", key = "perm:analytics:artifacts:receiver:delete", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/analytics/artifacts/receiver/delete"}), @Scope( name = "Create Event Publisher Artifact", description = "Create Event Publisher Artifact", key = "perm:analytics:artifacts:publisher", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/analytics/artifacts/publisher/add"}), @Scope( name = "Delete Publisher Artifact", description = "Delete Publisher Artifact", key = "perm:analytics:artifacts:publisher:delete", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/analytics/artifacts/publisher/delete"}), @Scope( name = "Create Siddhi Script Artifact", description = "Create Siddhi Script Artifact", key = "perm:analytics:artifacts:siddhi", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/analytics/artifacts/siddhi-script/add"}), @Scope( name = "Delete Siddhi Script Artifact", description = "Delete Siddhi Script Artifact", key = "perm:analytics:artifacts:siddhi:delete", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/analytics/artifacts/siddhi-script/delete"}) } ) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java index 92e1f9a473..fe328f9f8c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ConfigurationManagementService.java @@ -69,14 +69,14 @@ import javax.ws.rs.core.Response; name = "View configurations", description = "", key = "perm:view-configuration", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/platform-configurations/view"} ), @Scope( name = "Manage configurations", description = "", key = "perm:manage-configuration", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/platform-configurations/manage"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java index 66d8da7eab..467ae522a2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceAgentService.java @@ -77,35 +77,35 @@ import java.util.Map; name = "Enroll Device", description = "Register a device", key = "perm:device:enroll", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/add"} ), @Scope( name = "Modify Device", description = "Modify a device", key = "perm:device:modify", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/modify"} ), @Scope( name = "Disenroll Device", description = "Disenroll a device", key = "perm:device:disenroll", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/remove"} ), @Scope( name = "Publish Event", description = "publish device event", key = "perm:device:publish-event", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/event"} ), @Scope( name = "Getting Device Operation Details", description = "Getting Device Operation Details", key = "perm:device:operations", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java index 2f91595d38..dbba4be604 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceEventManagementService.java @@ -51,14 +51,14 @@ import javax.ws.rs.core.Response; name = "Add or Delete Event Definition for device type", description = "Add or Delete Event Definition for device type", key = "perm:device-types:events", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/device-type/add"} ), @Scope( name = "Get Events Details of a Device Type", description = "Get Events Details of a Device Type", key = "perm:device-types:events:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index 075061a253..de81d28918 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -107,77 +107,77 @@ import java.util.List; name = "Getting Details of Registered Devices", description = "Getting Details of Registered Devices", key = "perm:devices:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Details of a Device", description = "Getting Details of a Device", key = "perm:devices:details", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Update the device specified by device id", description = "Update the device specified by device id", key = "perm:devices:update", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Delete the device specified by device id", description = "Delete the device specified by device id", key = "perm:devices:delete", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Feature Details of a Device", description = "Getting Feature Details of a Device", key = "perm:devices:features", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Advanced Search for Devices", description = "Advanced Search for Devices", key = "perm:devices:search", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Installed Application Details of a Device", description = "Getting Installed Application Details of a Device", key = "perm:devices:applications", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Device Operation Details", description = "Getting Device Operation Details", key = "perm:devices:operations", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Get the details of the policy that is enforced on a device.", description = "Get the details of the policy that is enforced on a device.", key = "perm:devices:effective-policy", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting Policy Compliance Details of a Device", description = "Getting Policy Compliance Details of a Device", key = "perm:devices:compliance-data", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Change device status.", description = "Change device status.", key = "perm:devices:change-status", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/change-status"} ), } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java index 0d9adb0197..933ce64517 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceTypeManagementService.java @@ -87,28 +87,28 @@ import javax.ws.rs.core.Response; name = "Getting the Supported Device Platforms", description = "Getting the Supported Device Platforms", key = "perm:device-types:types", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/device-type/view"} ), @Scope( name = "Get Feature Details of a Device Type", description = "Get Feature Details of a Device Type", key = "perm:device-types:features", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/device-type/features/view"} ), @Scope( name = "Get Config Details of a Device Type", description = "Get Config Details of a Device Type", key = "perm:device-types:configs", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/device-type/config/view"} ), @Scope( name = "Getting Details of Policies", description = "Getting Details of Policies", key = "perm:policies:get-details", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java index 775f5c9e82..75fb07ef87 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GeoLocationBasedService.java @@ -73,21 +73,21 @@ import java.util.List; name = "View Analytics", description = "", key = "perm:geo-service:analytics-view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view-analytics"} ), @Scope( name = "Manage Alerts", description = "", key = "perm:geo-service:alerts-manage", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/manage-alerts"} ), @Scope( name = "Manage Geo Fences", description = "", key = "perm:geo-service:geo-fence", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/manage-geo-fence"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java index 0d90f3dfd4..fc2bfadc56 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/GroupManagementService.java @@ -82,98 +82,98 @@ import java.util.List; name = "Get the list of groups belongs to current user.", description = "Get the list of groups belongs to current user.", key = "perm:groups:groups", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/view"} ), @Scope( name = "Get the count of groups belongs to current user.", description = "Get the count of groups belongs to current user.", key = "perm:groups:count", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/view"} ), @Scope( name = "Add new device group to the system.", description = "Add new device group to the system.", key = "perm:groups:add", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/add"} ), @Scope( name = "View group specified", description = "View group specified", key = "perm:groups:groups-view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/view"} ), @Scope( name = "Update a group", description = "Update a group", key = "perm:groups:update", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/update"} ), @Scope( name = "Delete a group", description = "Delete a group", key = "perm:groups:remove", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/remove"} ), @Scope( name = "Manage group sharing with a user", description = "Manage group sharing with a user", key = "perm:groups:share", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/share"} ), @Scope( name = "View list of roles of a device group", description = "View list of roles of a device group", key = "perm:groups:roles", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/roles/view"} ), @Scope( name = "View list of devices in the device group", description = "View list of devices in the device group", key = "perm:groups:devices", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/devices/view"} ), @Scope( name = "View list of device count in the device group", description = "View list of device count in the device group", key = "perm:groups:devices-count", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/devices/view"} ), @Scope( name = "Add devices to group", description = "Add devices to group", key = "perm:groups:devices-add", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/devices/add"} ), @Scope( name = "Remove devices from group", description = "Remove devices from group", key = "perm:groups:devices-remove", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/devices/remove"} ), @Scope( name = "Assign devices to groups", description = "Assign devices to groups", key = "perm:groups:assign", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/devices/add"} ), @Scope( name = "List of groups that have the device", description = "List of groups that have the device", key = "perm:groups:device", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/groups/devices/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/MetadataService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/MetadataService.java index 7f6ab365df..446944729b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/MetadataService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/MetadataService.java @@ -73,28 +73,28 @@ import javax.ws.rs.core.Response; name = "View metadata records", description = "View metadata records", key = "perm:metadata:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/metadata/view"} ), @Scope( name = "Create a metadata record", description = "Create a metadata record", key = "perm:metadata:create", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/metadata/create"} ), @Scope( name = "Update a metadata record", description = "Updating a specified metadata record", key = "perm:metadata:update", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/metadata/update"} ), @Scope( name = "Delete a metadata record", description = "Delete a specified metadata record", key = "perm:metadata:remove", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/metadata/remove"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java index 9d36d1067f..7de2265e59 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/NotificationManagementService.java @@ -73,14 +73,14 @@ import javax.ws.rs.core.Response; name = "Getting All Device Notification Details", description = "Getting All Device Notification Details", key = "perm:notifications:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/notifications/view"} ), @Scope( name = "Updating the Device Notification Status", description = "Updating the Device Notification Status", key = "perm:notifications:mark-checked", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/notifications/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java index 4db3de0ab5..a84d4e7f03 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java @@ -79,70 +79,70 @@ import java.util.List; name = "Adding a Policy", description = "Adding a Policy", key = "perm:policies:manage", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Getting Details of Policies", description = "Getting Details of Policies", key = "perm:policies:get-details", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/view"} ), @Scope( name = "Getting Details of a Policy", description = "Getting Details of a Policy", key = "perm:policies:get-policy-details", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/view"} ), @Scope( name = "Updating a Policy", description = "Updating a Policy", key = "perm:policies:update", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Removing Multiple Policies", description = "Removing Multiple Policies", key = "perm:policies:remove", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Activating Policies", description = "Activating Policies", key = "perm:policies:activate", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Deactivating Policies", description = "Deactivating Policies", key = "perm:policies:deactivate", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Applying Changes on Policies", description = "Applying Changes on Policies", key = "perm:policies:changes", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Updating the Policy Priorities", description = "Updating the Policy Priorities", key = "perm:policies:priorities", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/manage"} ), @Scope( name = "Fetching the Effective Policy", description = "Fetching the Effective Policy", key = "perm:policies:effective-policy", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/policies/view"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java index f52a9f1aa7..010e7ffeca 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RemoteSessionService.java @@ -61,7 +61,7 @@ import javax.ws.rs.core.Response; name = "Remote Session Connection", description = "", key = "perm:remote-session-service:connect", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/remote-session"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java index 41364f8afd..00929b71b0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/ReportManagementService.java @@ -66,7 +66,7 @@ import java.util.List; name = "Getting Details of Registered Devices", description = "Getting Details of Registered Devices", key = "perm:devices:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java index d3cbb88469..d0e8f0d201 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/RoleManagementService.java @@ -53,56 +53,56 @@ import java.util.List; name = "Getting the List of Roles", description = "Getting the List of Roles", key = "perm:roles:view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/roles/view"} ), @Scope( name = "Getting Permission Details of a Role", description = "Getting Permission Details of a Role", key = "perm:roles:permissions", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/roles/view"} ), @Scope( name = "Getting the List of Roles", description = "Getting the List of Roles", key = "perm:roles:details", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/roles/view"} ), @Scope( name = "Adding a Role", description = "Adding a Role", key = "perm:roles:add", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/roles/manage"} ), @Scope( name = "Adding a combined Role", description = "Adding a combined Role", key = "perm:roles:create-combined-role", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/roles/manage"} ), @Scope( name = "Updating Role Details", description = "Updating Role Details", key = "perm:roles:update", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/roles/manage"} ), @Scope( name = "Deleting a Role", description = "Deleting a Role", key = "perm:roles:delete", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/roles/manage"} ), @Scope( name = "Adding Users to a Role", description = "Adding Users to a Role", key = "perm:roles:add-users", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/roles/manage"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index 5be208a448..f27d740099 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -97,91 +97,91 @@ import javax.ws.rs.core.Response; name = "Adding a User", description = "Adding a User", key = "perm:users:add", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Getting Details of a User", description = "Getting Details of a User", key = "perm:users:details", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Updating Details of a User", description = "Updating Details of a User", key = "perm:users:update", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Deleting a User", description = "Deleting a User", key = "perm:users:delete", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Getting the Role Details of a User", description = "Getting the Role Details of a User", key = "perm:users:roles", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Getting Details of Users", description = "Getting Details of Users", key = "perm:users:user-details", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Getting the User Count", description = "Getting the User Count", key = "perm:users:count", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Getting the User existence status", description = "Getting the User existence status", key = "perm:users:is-exist", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Searching for a User Name", description = "Searching for a User Name", key = "perm:users:search", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/view"} ), @Scope( name = "Changing the User Password", description = "Adding a User", key = "perm:users:credentials", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/login"} ), @Scope( name = "Sending Enrollment Invitations to Users", description = "Sending Enrollment Invitations to Users", key = "perm:users:send-invitation", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Get activities", description = "Get activities", key = "perm:get-activity", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Getting the Permissions of the User", description = "Getting the Permissions of the User", key = "perm:user:permission-view", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/login"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/ApplicationManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/ApplicationManagementAdminService.java index 2ff9bf9783..f87d256ef5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/ApplicationManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/ApplicationManagementAdminService.java @@ -67,14 +67,14 @@ import javax.ws.rs.core.Response; name = "Installing an Application (Internal API)", description = "Installing an Application (Internal API)", key = "perm:applications:install", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/applications/manage"} ), @Scope( name = "Uninstalling an Application (Internal API)", description = "Uninstalling an Application (Internal API)", key = "perm:applications:uninstall", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/applications/manage"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java index cb23896ea4..45a8fe606b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java @@ -67,7 +67,7 @@ import javax.ws.rs.core.Response; name = "Verify device authorization", description = "Verify device authorization", key = "perm:authorization:verify", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/authorization/verify"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java index 8722e0cae0..0deeafb2b5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAnalyticsArtifactUploaderAdminService.java @@ -57,7 +57,7 @@ import javax.ws.rs.core.Response; name = "Devicetype deployment", description = "Deploy devicetype", key = "perm:devicetype:deployment", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devicetype/deploy"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java index eb4b10fc41..3079dd4ad3 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceManagementAdminService.java @@ -94,21 +94,21 @@ import java.util.List; name = "Getting Details of a Device", description = "Getting Details of a Device", key = "perm:admin:devices:view", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/devices/owning-device/view"} ), @Scope( name = "Update the Device Owner", description = "Update the ownership of the device", key = "perm:admin:devices:update-enrollment", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/devices/update-enrollment"} ), @Scope( name = "Permanently Delete the device specified by device id", description = "Permanently Delete the device specified by device id", key = "perm:devices:permanent-delete", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/devices/permanent-delete"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java index 17224c605e..4449f1e60d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceTypeManagementAdminService.java @@ -92,21 +92,21 @@ import javax.ws.rs.core.Response; name = "Manage a Device Type", description = "Add, Edit or View a Device Type", key = "perm:admin:device-type", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/device-type"} ), @Scope( name = "Getting Details of a Device Type", description = "Getting Details of a Device Type", key = "perm:admin:device-type:view", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/device-type/view"} ), @Scope( name = "Add Device Type Config", description = "Add Platform Config of a Device Type", key = "perm:admin:device-type:configs", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/device-type/config"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/GroupManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/GroupManagementAdminService.java index 30f2da5714..e430611e90 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/GroupManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/GroupManagementAdminService.java @@ -70,21 +70,21 @@ import javax.ws.rs.core.Response; name = "View groups", description = "", key = "perm:admin-groups:view", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/groups/view"} ), @Scope( name = "Count groups", description = "", key = "perm:admin-groups:count", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/groups/view"} ), @Scope( name = "Add groups", description = "", key = "perm:admin-groups:add", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/admin/groups/add"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java index 9dbfbbc6f8..29260f31e0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/UserManagementAdminService.java @@ -53,14 +53,14 @@ import javax.ws.rs.core.Response; name = "View Users", description = "View Users", key = "perm:admin-users:view", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/users/manage"} ), @Scope( name = "Delete Users Device Information", description = "Delete users device details", key = "perm:admin-users:remove", - roles = {"admin"}, + roles = {"Internal/devicemgt-admin"}, permissions = {"/device-mgt/users/manage"} ) } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java index 9bbb385b20..859659bdf5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/DeviceManagementServiceComponent.java @@ -22,6 +22,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; +import org.wso2.carbon.core.ServerStartupObserver; import org.wso2.carbon.device.mgt.common.app.mgt.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.authorization.DeviceAccessAuthorizationService; import org.wso2.carbon.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService; @@ -291,6 +292,9 @@ public class DeviceManagementServiceComponent { TenantCreateObserver listener = new TenantCreateObserver(); bundleContext.registerService(Axis2ConfigurationContextObserver.class.getName(), listener, null); + UserRoleCreateObserver userRoleCreateObserver = new UserRoleCreateObserver(); + bundleContext.registerService(ServerStartupObserver.class.getName(), userRoleCreateObserver, null); + /* Registering Device Management Service */ DeviceManagementProviderService deviceManagementProvider = new DeviceManagementProviderServiceImpl(); DeviceManagementDataHolder.getInstance().setDeviceManagementProvider(deviceManagementProvider); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java new file mode 100644 index 0000000000..779dd69191 --- /dev/null +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java @@ -0,0 +1,64 @@ +/* + * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. + * + * WSO2 Inc. licenses this file to you under the Apache License, + * Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ +package org.wso2.carbon.device.mgt.core.internal; + +import org.apache.commons.logging.Log; +import org.apache.commons.logging.LogFactory; +import org.wso2.carbon.core.ServerStartupObserver; +import org.wso2.carbon.device.mgt.core.DeviceManagementConstants; +import org.wso2.carbon.user.api.UserStoreException; +import org.wso2.carbon.user.api.UserStoreManager; +import org.wso2.carbon.utils.multitenancy.MultitenantConstants; + +public class UserRoleCreateObserver implements ServerStartupObserver { + private static final Log log = LogFactory.getLog(UserRoleCreateObserver.class); + @Override + public void completingServerStartup() { + + } + + @Override + public void completedServerStartup() { + String tenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME; + String tenantAdminName = "admin"; + + try { + UserStoreManager userStoreManager = + DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm( + MultitenantConstants.SUPER_TENANT_ID).getUserStoreManager(); + userStoreManager.addRole( + DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN, + new String[]{tenantAdminName}, + DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_ADMIN); + userStoreManager.addRole( + DeviceManagementConstants.User.DEFAULT_DEVICE_USER, null, + DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_USER); + + if (log.isDebugEnabled()) { + log.debug("Device management roles: " + DeviceManagementConstants.User.DEFAULT_DEVICE_USER + ", " + + DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN + " created for the tenant:" + tenantDomain + "." + ); + log.debug("Tenant administrator: " + tenantAdminName + "@" + tenantDomain + + " is assigned to the role:" + DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN + "." + ); + } + } catch (UserStoreException e) { + log.error("Error occurred while creating roles for the tenant: " + tenantDomain + "."); + } + } +} diff --git a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/java/io/entgra/transport/mgt/sms/handler/api/service/ConfigurationManagementService.java b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/java/io/entgra/transport/mgt/sms/handler/api/service/ConfigurationManagementService.java index 3d4f1d9e0f..18d295b53a 100644 --- a/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/java/io/entgra/transport/mgt/sms/handler/api/service/ConfigurationManagementService.java +++ b/components/transport-mgt/sms-handler/io.entgra.transport.mgt.sms.handler.api/src/main/java/io/entgra/transport/mgt/sms/handler/api/service/ConfigurationManagementService.java @@ -64,7 +64,7 @@ import javax.ws.rs.core.Response; name = "View configurations", description = "", key = "perm:sms-handler:view-configuration", - roles = {"Internal/everyone"}, + roles = {"Internal/devicemgt-user"}, permissions = {"/sms-handler/platform-configurations/view"} ) }) From 52c0e55b07a7f17e670b3e5f9748a9da3bb8554e Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Mon, 28 Jun 2021 14:06:23 +0530 Subject: [PATCH 27/54] adding user roles --- .../carbon/device/mgt/core/internal/TenantCreateObserver.java | 2 +- .../device/mgt/core/internal/UserRoleCreateObserver.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/TenantCreateObserver.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/TenantCreateObserver.java index ffc3724a81..79a5309296 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/TenantCreateObserver.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/TenantCreateObserver.java @@ -49,7 +49,7 @@ public class TenantCreateObserver extends AbstractAxis2ConfigurationContextObser DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm(tenantId) .getUserStoreManager(); String tenantAdminName = userRealm.getRealmConfiguration().getAdminUserName(); - userStoreManager.addRole(User.DEFAULT_DEVICE_USER, null, User.PERMISSIONS_FOR_DEVICE_USER); + userStoreManager.addRole(User.DEFAULT_DEVICE_USER, new String[]{tenantAdminName}, User.PERMISSIONS_FOR_DEVICE_USER); userStoreManager.addRole(User.DEFAULT_DEVICE_ADMIN, new String[]{tenantAdminName}, User.PERMISSIONS_FOR_DEVICE_ADMIN); if (log.isDebugEnabled()) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java index 779dd69191..ce16866524 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java @@ -46,7 +46,8 @@ public class UserRoleCreateObserver implements ServerStartupObserver { new String[]{tenantAdminName}, DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_ADMIN); userStoreManager.addRole( - DeviceManagementConstants.User.DEFAULT_DEVICE_USER, null, + DeviceManagementConstants.User.DEFAULT_DEVICE_USER, + new String[]{tenantAdminName}, DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_USER); if (log.isDebugEnabled()) { From 510a90a59f5efbf3618d83a69d1b25c174462b92 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Fri, 9 Jul 2021 14:46:28 +0530 Subject: [PATCH 28/54] bug fixing authorize flow --- .../cache/APIResourcePermissionCacheKey.java | 64 -------------- ...APIResourcePermissionCacheManagerImpl.java | 84 ------------------- .../core/internal/UserRoleCreateObserver.java | 42 ++++++++-- .../mgt/APIResourcePermissions.java} | 23 +++-- .../mgt/PermissionManagerServiceImpl.java | 14 +--- .../mgt/core/util/DeviceManagerUtil.java | 16 ---- .../framework/WebappAuthenticationValve.java | 4 +- .../authorizer/PermissionAuthorizer.java | 4 + 8 files changed, 60 insertions(+), 191 deletions(-) delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheKey.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/impl/APIResourcePermissionCacheManagerImpl.java rename components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/{cache/APIResourcePermissionCacheManager.java => permission/mgt/APIResourcePermissions.java} (50%) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheKey.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheKey.java deleted file mode 100644 index 2db061a6d0..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheKey.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.carbon.device.mgt.core.cache; - -import java.util.Objects; - -public class APIResourcePermissionCacheKey { - - private String context; - private volatile int hashCode; - - public APIResourcePermissionCacheKey(String context) { - this.context = context; - } - - - public String getContext() { - return context; - } - - public void setContext(String context) { - this.context = context; - } - - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (!APIResourcePermissionCacheKey.class.isAssignableFrom(obj.getClass())) { - return false; - } - final APIResourcePermissionCacheKey other = (APIResourcePermissionCacheKey) obj; - String thisId = this.context; - String otherId = other.context; - if (!thisId.equals(otherId)) { - return false; - } - return true; - } - - @Override - public int hashCode() { - if (hashCode == 0) { - hashCode = Objects.hash(context); - } - return hashCode; - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/impl/APIResourcePermissionCacheManagerImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/impl/APIResourcePermissionCacheManagerImpl.java deleted file mode 100644 index 3b08a8d8b2..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/impl/APIResourcePermissionCacheManagerImpl.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2021, WSO2 Inc. (http://www.wso2.org) All Rights Reserved. - * - * WSO2 Inc. licenses this file to you under the Apache License, - * Version 2.0 (the "License"); you may not use this file except - * in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ -package org.wso2.carbon.device.mgt.core.cache.impl; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.common.permission.mgt.Permission; -import org.wso2.carbon.device.mgt.core.cache.APIResourcePermissionCacheKey; -import org.wso2.carbon.device.mgt.core.cache.APIResourcePermissionCacheManager; -import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; - -import javax.cache.Cache; -import java.util.List; - -public class APIResourcePermissionCacheManagerImpl implements APIResourcePermissionCacheManager { - - - private static final Log log = LogFactory.getLog(APIResourcePermissionCacheManagerImpl.class); - - private static APIResourcePermissionCacheManagerImpl apiResourceCacgeManager; - - private APIResourcePermissionCacheManagerImpl() { - } - - public static APIResourcePermissionCacheManagerImpl getInstance() { - if (apiResourceCacgeManager == null) { - synchronized (APIResourcePermissionCacheManagerImpl.class) { - if (apiResourceCacgeManager == null) { - apiResourceCacgeManager = new APIResourcePermissionCacheManagerImpl(); - } - } - } - return apiResourceCacgeManager; - } - - - @Override - public void addAPIResourcePermissionToCache(APIResourcePermissionCacheKey cacheKey, List permissions) { - Cache> lCache = DeviceManagerUtil.getAPIResourcePermissionCache(); - if (lCache != null) { - if (lCache.containsKey(cacheKey)) { - this.updateAPIResourcePermissionInCache(cacheKey, permissions); - } else { - lCache.put(cacheKey, permissions); - } - } - } - - @Override - public void updateAPIResourcePermissionInCache(APIResourcePermissionCacheKey cacheKey, List permissions) { - - Cache> lCache = DeviceManagerUtil.getAPIResourcePermissionCache(); - if (lCache != null) { - if (lCache.containsKey(cacheKey)) { - lCache.replace(cacheKey, permissions); - } - } - - } - - @Override - public List getAPIResourceRermissionFromCache(APIResourcePermissionCacheKey cacheKey) { - Cache> lCache = DeviceManagerUtil.getAPIResourcePermissionCache(); - if (lCache != null) { - return lCache.get(cacheKey); - } - return null; - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java index ce16866524..5fb9509629 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/UserRoleCreateObserver.java @@ -21,6 +21,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.core.ServerStartupObserver; import org.wso2.carbon.device.mgt.core.DeviceManagementConstants; +import org.wso2.carbon.user.api.AuthorizationManager; +import org.wso2.carbon.user.api.Permission; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; import org.wso2.carbon.utils.multitenancy.MultitenantConstants; @@ -35,20 +37,42 @@ public class UserRoleCreateObserver implements ServerStartupObserver { @Override public void completedServerStartup() { String tenantDomain = MultitenantConstants.SUPER_TENANT_DOMAIN_NAME; - String tenantAdminName = "admin"; try { UserStoreManager userStoreManager = DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm( MultitenantConstants.SUPER_TENANT_ID).getUserStoreManager(); - userStoreManager.addRole( - DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN, - new String[]{tenantAdminName}, - DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_ADMIN); - userStoreManager.addRole( - DeviceManagementConstants.User.DEFAULT_DEVICE_USER, - new String[]{tenantAdminName}, - DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_USER); + String tenantAdminName = + DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm( + MultitenantConstants.SUPER_TENANT_ID).getRealmConfiguration().getAdminUserName(); + AuthorizationManager authorizationManager = DeviceManagementDataHolder.getInstance().getRealmService() + .getTenantUserRealm(MultitenantConstants.SUPER_TENANT_ID).getAuthorizationManager(); + + if (!userStoreManager.isExistingRole(DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN)) { + userStoreManager.addRole( + DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN, + null, + DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_ADMIN); + } else { + for (Permission permission : DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_ADMIN) { + authorizationManager.authorizeRole(DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN, + permission.getResourceId(), permission.getAction()); + } + } + if (!userStoreManager.isExistingRole(DeviceManagementConstants.User.DEFAULT_DEVICE_USER)) { + userStoreManager.addRole( + DeviceManagementConstants.User.DEFAULT_DEVICE_USER, + null, + DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_USER); + } else { + for (Permission permission : DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_USER) { + authorizationManager.authorizeRole(DeviceManagementConstants.User.DEFAULT_DEVICE_USER, + permission.getResourceId(), permission.getAction()); + } + } + userStoreManager.updateRoleListOfUser(tenantAdminName, null, + new String[] {DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN, + DeviceManagementConstants.User.DEFAULT_DEVICE_USER}); if (log.isDebugEnabled()) { log.debug("Device management roles: " + DeviceManagementConstants.User.DEFAULT_DEVICE_USER + ", " + diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/APIResourcePermissions.java similarity index 50% rename from components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheManager.java rename to components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/APIResourcePermissions.java index 4dac439cc4..703d9f6eda 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/cache/APIResourcePermissionCacheManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/APIResourcePermissions.java @@ -4,9 +4,9 @@ * WSO2 Inc. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except * in compliance with the License. - * You may obtain a copy of the License at + * you may obtain a copy of the License at * - * http://www.apache.org/licenses/LICENSE-2.0 + * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an @@ -15,17 +15,26 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.mgt.core.cache; +package org.wso2.carbon.device.mgt.core.permission.mgt; import org.wso2.carbon.device.mgt.common.permission.mgt.Permission; +import java.util.HashMap; import java.util.List; +import java.util.Map; -public interface APIResourcePermissionCacheManager { +public class APIResourcePermissions { + private Map> apiResourcePermissions; - void addAPIResourcePermissionToCache(APIResourcePermissionCacheKey cacheKey, List permissions); + public APIResourcePermissions() { + apiResourcePermissions = new HashMap<>(); + } - void updateAPIResourcePermissionInCache(APIResourcePermissionCacheKey cacheKey, List permissions); + public void addPermissionList(String context, List permissions){ + apiResourcePermissions.put(context, permissions); + } - List getAPIResourceRermissionFromCache(APIResourcePermissionCacheKey cacheKey); + public List getPermissions(String context) { + return apiResourcePermissions.get(context); + } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java index c2591a1df6..8a222ea3f1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java @@ -18,16 +18,11 @@ package org.wso2.carbon.device.mgt.core.permission.mgt; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.mgt.common.permission.mgt.Permission; import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagementException; import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagerService; -import org.wso2.carbon.device.mgt.core.cache.APIResourcePermissionCacheKey; -import org.wso2.carbon.device.mgt.core.cache.impl.APIResourcePermissionCacheManagerImpl; import java.util.List; -import java.util.Properties; /** * This class will add, update custom permissions defined in permission.xml in webapps and it will @@ -36,7 +31,7 @@ import java.util.Properties; public class PermissionManagerServiceImpl implements PermissionManagerService { private static PermissionManagerServiceImpl registryBasedPermissionManager; - + private static APIResourcePermissions apiResourcePermissions; private PermissionManagerServiceImpl() { } @@ -45,6 +40,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerService { synchronized (PermissionManagerServiceImpl.class) { if (registryBasedPermissionManager == null) { registryBasedPermissionManager = new PermissionManagerServiceImpl(); + apiResourcePermissions = new APIResourcePermissions(); } } } @@ -57,8 +53,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerService { for (Permission permission : permissions) { PermissionUtils.putPermission(permission); } - APIResourcePermissionCacheManagerImpl.getInstance().addAPIResourcePermissionToCache( - new APIResourcePermissionCacheKey(context), permissions); + apiResourcePermissions.addPermissionList(context, permissions); } catch (PermissionManagementException e) { return false; } @@ -67,7 +62,6 @@ public class PermissionManagerServiceImpl implements PermissionManagerService { @Override public List getPermission(String context) throws PermissionManagementException { - return APIResourcePermissionCacheManagerImpl.getInstance().getAPIResourceRermissionFromCache( - new APIResourcePermissionCacheKey(context)); + return apiResourcePermissions.getPermissions(context); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java index f83e19c62f..d13a0bebe0 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java @@ -76,7 +76,6 @@ import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementExcept import org.wso2.carbon.device.mgt.common.permission.mgt.Permission; import org.wso2.carbon.device.mgt.common.type.mgt.DeviceTypeMetaDefinition; import org.wso2.carbon.device.mgt.core.DeviceManagementConstants; -import org.wso2.carbon.device.mgt.core.cache.APIResourcePermissionCacheKey; import org.wso2.carbon.device.mgt.core.cache.DeviceCacheKey; import org.wso2.carbon.device.mgt.core.cache.GeoCacheKey; import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; @@ -724,21 +723,6 @@ public final class DeviceManagerUtil { return deviceCache; } - public static Cache> getAPIResourcePermissionCache() { - CacheManager manager = getCacheManager(); - Cache> apiResourcePermissionCache = null; - if(!isAPIResourcePermissionCacheInitialized) { - initializeAPIResourcePermissionCache(); - } - if (manager != null) { - apiResourcePermissionCache = manager.getCache(DeviceManagementConstants.API_RESOURCE_PERMISSION_CACHE); - } else { - apiResourcePermissionCache = Caching.getCacheManager(DeviceManagementConstants.DM_CACHE_MANAGER) - .getCache(DeviceManagementConstants.API_RESOURCE_PERMISSION_CACHE); - } - return apiResourcePermissionCache; - } - /** * Get geofence cache object * @return {@link Cache} diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java index 6547c48f35..9e73d08ffb 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java @@ -21,6 +21,7 @@ package org.wso2.carbon.webapp.authenticator.framework; import org.apache.catalina.Context; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; +import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.owasp.encoder.Encode; @@ -194,7 +195,8 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { ctx = tokenizer.nextToken(); } } - return ("carbon".equalsIgnoreCase(ctx) || "services".equalsIgnoreCase(ctx)); + return ("carbon".equalsIgnoreCase(ctx) || "services".equalsIgnoreCase(ctx) + || "oauth2".equalsIgnoreCase(ctx)); } private boolean isNonSecuredEndPoint(Request request) { diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java index dd3e8cceff..eb09e815df 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authorizer/PermissionAuthorizer.java @@ -46,6 +46,10 @@ public class PermissionAuthorizer { return WebappAuthenticator.Status.CONTINUE; } + if (requestUri.endsWith("/")) { + requestUri = requestUri.substring(0, requestUri.length() - 1); + } + PermissionManagerService registryBasedPermissionManager = PermissionManagerServiceImpl.getInstance(); List matchingPermissions = null; From fc9a9ca2107915a2bb2a6f2614d3f5ffa7c54f77 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 13 Jul 2021 09:28:30 +0530 Subject: [PATCH 29/54] fixed permission issues --- .../mgt/jaxrs/service/api/DeviceManagementService.java | 7 +++++++ .../carbon/device/mgt/core/DeviceManagementConstants.java | 1 + 2 files changed, 8 insertions(+) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index de81d28918..eb1d952491 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -180,6 +180,13 @@ import java.util.List; roles = {"Internal/devicemgt-user"}, permissions = {"/device-mgt/devices/change-status"} ), + @Scope( + name = "Enroll Device", + description = "Register a device", + key = "perm:device:enroll", + roles = {"Internal/devicemgt-user"}, + permissions = {"/device-mgt/devices/owning-device/add"} + ), } ) @Path("/devices") diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java index 1d0f581451..e9cfa13398 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/DeviceManagementConstants.java @@ -167,6 +167,7 @@ public final class DeviceManagementConstants { new Permission("/permission/admin/device-mgt/devices/enroll", "ui.execute"), new Permission("/permission/admin/device-mgt/devices/disenroll", "ui.execute"), new Permission("/permission/admin/device-mgt/devices/owning-device/view", "ui.execute"), + new Permission("/permission/admin/device-mgt/metadata", "ui.execute"), new Permission("/permission/admin/manage/portal", "ui.execute") }; From bdb01a0098a6fca849565b608357838470d7b0da Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 13 Jul 2021 22:33:18 +0530 Subject: [PATCH 30/54] bug fixing --- .../mgt/core/config/permission/AnnotationProcessor.java | 2 +- .../src/main/resources/jwt.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) 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 e60b14eee9..6c680babaa 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 @@ -240,7 +240,7 @@ public class AnnotationProcessor { subCtx = makeContextURLReady(resourceRootContext) + makeContextURLReady(subCtx); } permission.setUrl(replaceDynamicPathVariables(subCtx)); - permission.setUrlPattern(permission.getUrl().replace("*", "[a-zA-Z0-9-_]+")); + permission.setUrlPattern(permission.getUrl().replace("*", "[a-zA-Z0-9-_.]+")); String httpMethod; for (int i = 0; i < annotations.length; i++) { httpMethod = getHTTPMethodAnnotation(annotations[i]); diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties index 0c9641fa2d..be3fa54494 100644 --- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties +++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties @@ -17,13 +17,13 @@ # #issuer of the JWT -iss=wso2.org/products/iot +iss=https://localhost:9443/oauth2/token TokenEndpoint=https://${iot.gateway.host}:${iot.gateway.https.port}/token?tenantDomain=carbon.super #audience of JWT claim #comma seperated values -aud=devicemgt +aud=https://localhost:9443/oauth2/token #expiration time of JWT (number of minutes from the current time) exp=1000 From f3720e49ff9a1dc502ef8eab45b48e73aa82a455 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Thu, 15 Jul 2021 11:14:20 +0530 Subject: [PATCH 31/54] added scripts and updated config reading --- .../identity/IdentityConfigurations.java | 6 ++- .../keymanager/KeyManagerConfigurations.java | 6 ++- .../mgt/core/util/DeviceManagerUtil.java | 53 +++++++++++++++++++ .../authenticator/framework/Utils/Utils.java | 5 +- .../src/main/resources/conf/cdm-config.xml | 8 +-- .../repository/conf/cdm-config.xml.j2 | 8 +-- .../conf/webapp-authenticator-config.xml | 8 +-- .../etc/webapp-authenticator-config.xml.j2 | 8 +-- 8 files changed, 80 insertions(+), 22 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/identity/IdentityConfigurations.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/identity/IdentityConfigurations.java index fe7a7c7ae6..5e88ed0f77 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/identity/IdentityConfigurations.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/identity/IdentityConfigurations.java @@ -17,6 +17,8 @@ */ package org.wso2.carbon.device.mgt.core.config.identity; +import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; + import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -31,7 +33,7 @@ public class IdentityConfigurations { @XmlElement(name = "AdminUsername", required = true) public String getAdminUsername() { - return adminUsername; + return DeviceManagerUtil.replaceSystemProperty(adminUsername); } public void setAdminUsername(String adminUsername) { @@ -40,7 +42,7 @@ public class IdentityConfigurations { @XmlElement(name = "AdminPassword", required = true) public String getAdminPassword() { - return adminPassword; + return DeviceManagerUtil.replaceSystemProperty(adminPassword); } public void setAdminPassword(String adminPassword) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/keymanager/KeyManagerConfigurations.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/keymanager/KeyManagerConfigurations.java index b76f932e5b..8774941acc 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/keymanager/KeyManagerConfigurations.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/keymanager/KeyManagerConfigurations.java @@ -17,6 +17,8 @@ */ package org.wso2.carbon.device.mgt.core.config.keymanager; +import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; + import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; @@ -31,7 +33,7 @@ public class KeyManagerConfigurations { @XmlElement(name = "AdminUsername", required = true) public String getAdminUsername() { - return adminUsername; + return DeviceManagerUtil.replaceSystemProperty(adminUsername); } public void setAdminUsername(String adminUsername) { @@ -40,7 +42,7 @@ public class KeyManagerConfigurations { @XmlElement(name = "AdminPassword", required = true) public String getAdminPassword() { - return adminPassword; + return DeviceManagerUtil.replaceSystemProperty(adminPassword); } public void setAdminPassword(String adminPassword) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java index d13a0bebe0..51ea934890 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/DeviceManagerUtil.java @@ -96,10 +96,12 @@ import org.wso2.carbon.identity.jwt.client.extension.JWTClient; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService; +import org.wso2.carbon.user.api.RealmConfiguration; import org.wso2.carbon.user.api.TenantManager; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; +import org.wso2.carbon.user.core.config.RealmConfigXMLProcessor; import org.wso2.carbon.utils.CarbonUtils; import org.wso2.carbon.utils.ConfigurationContextService; import org.wso2.carbon.utils.NetworkUtils; @@ -1165,4 +1167,55 @@ public final class DeviceManagerUtil { .getUserStoreManager(); return userStoreManager.getUserClaimValue(username, claimUri, null); } + + public static String replaceSystemProperty(String text) { + + int indexOfStartingChars = -1; + int indexOfClosingBrace; + + // The following condition deals with properties. + // Properties are specified as ${system.property}, + // and are assumed to be System properties + while (indexOfStartingChars < text.indexOf("${") + && (indexOfStartingChars = text.indexOf("${")) != -1 + && (indexOfClosingBrace = text.indexOf('}')) != -1) { // Is a + // property + // used? + String sysProp = text.substring(indexOfStartingChars + 2, + indexOfClosingBrace); + String propValue = System.getProperty(sysProp); + + if (propValue == null) { + if ("carbon.context".equals(sysProp)) { + propValue = DeviceManagementDataHolder.getInstance().getConfigurationContextService() + .getServerConfigContext().getContextRoot(); + } else if ("admin.username".equals(sysProp) || "admin.password".equals(sysProp)) { + try { + RealmConfiguration realmConfig = + new RealmConfigXMLProcessor().buildRealmConfigurationFromFile(); + if ("admin.username".equals(sysProp)) { + propValue = realmConfig.getAdminUserName(); + } else { + propValue = realmConfig.getAdminPassword(); + } + } catch (UserStoreException e) { + // Can't throw an exception because the server is + // starting and can't be halted. + log.error("Unable to build the Realm Configuration", e); + return null; + } + } + } + //Derive original text value with resolved system property value + if (propValue != null) { + text = text.substring(0, indexOfStartingChars) + propValue + + text.substring(indexOfClosingBrace + 1); + } + if ("carbon.home".equals(sysProp) && propValue != null + && ".".equals(propValue)) { + text = new File(".").getAbsolutePath() + File.separator + text; + } + } + return text; + } } diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/Utils/Utils.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/Utils/Utils.java index 52510d5b67..c3d16672b0 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/Utils/Utils.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/Utils/Utils.java @@ -21,6 +21,7 @@ package org.wso2.carbon.webapp.authenticator.framework.Utils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.device.mgt.core.util.DeviceManagerUtil; import org.wso2.carbon.user.api.TenantManager; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; @@ -98,12 +99,12 @@ public class Utils { if ((url == null) || (url.isEmpty())) { throw new IllegalArgumentException("OAuth token validation endpoint url is not provided"); } - String adminUsername = properties.getProperty("Username"); + String adminUsername = DeviceManagerUtil.replaceSystemProperty(properties.getProperty("Username")); if (adminUsername == null) { throw new IllegalArgumentException( "Username to connect to the OAuth token validation endpoint is not provided"); } - String adminPassword = properties.getProperty("Password"); + String adminPassword = DeviceManagerUtil.replaceSystemProperty(properties.getProperty("Password")); if (adminPassword == null) { throw new IllegalArgumentException( "Password to connect to the OAuth token validation endpoint is not provided"); diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml index bbbd8511d4..d15901005e 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml @@ -42,13 +42,13 @@ https://localhost:9443 - admin - admin + ${admin.username} + ${admin.username} https://localhost:9443 - admin - admin + ${admin.username} + ${admin.username} org.wso2.carbon.policy.mgt diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2 index 214ad3f8a8..78b0fafd8a 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2 +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2 @@ -63,8 +63,8 @@ {{device_mgt_conf.identity_conf.admin_password}} {% else %} https://localhost:9443 - admin - admin + ${admin.username} + ${admin.username} {% endif %} @@ -74,8 +74,8 @@ {{device_mgt_conf.key_manager_conf.admin_password}} {% else %} https://localhost:9443 - admin - admin + ${admin.username} + ${admin.username} {% endif %} diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml index dfea5c07ac..da403d707d 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml @@ -6,8 +6,8 @@ false https://${iot.keymanager.host}:${iot.keymanager.https.port} - admin - admin + ${admin.username} + ${admin.username} 100 100 @@ -41,8 +41,8 @@ false https://${iot.keymanager.host}:${iot.keymanager.https.port} - admin - admin + ${admin.username} + ${admin.username} 100 100 diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-authenticator-config.xml.j2 b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-authenticator-config.xml.j2 index 187c9131fe..42ee60946a 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-authenticator-config.xml.j2 +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-authenticator-config.xml.j2 @@ -14,8 +14,8 @@ false https://${iot.keymanager.host}:${iot.keymanager.https.port} - admin - admin + ${admin.username} + ${admin.username} 100 100 @@ -94,8 +94,8 @@ false https://${iot.keymanager.host}:${iot.keymanager.https.port} - admin - admin + ${admin.username} + ${admin.username} 100 100 From f7f8ce535aa7f3e11c64438a471a1cf773cca312 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 12:39:58 +0530 Subject: [PATCH 32/54] fixed issue - product-iots #1059 --- .../org.wso2.carbon.webapp.authenticator.framework/pom.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 2bf0318675..2a91d7682a 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -92,6 +92,7 @@ org.apache.axis2.transport.http, org.wso2.carbon.certificate.mgt.core.*, org.wso2.carbon.device.mgt.core.permission.mgt.*, + org.wso2.carbon.device.mgt.core.util.*, org.wso2.carbon.device.mgt.common.*, org.wso2.carbon.device.mgt.common.permission.mgt.*, org.apache.axis2, From d6c04ca92809bb6f76fc7748923ff97de23495ea Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 16:02:47 +0530 Subject: [PATCH 33/54] package name change - appmgt store api --- .../pom.xml | 6 +++--- .../store/api/services/ApplicationManagementAPI.java | 2 +- .../mgt/store/api/services/ReviewManagementAPI.java | 2 +- .../api/services/SubscriptionManagementAPI.java | 2 +- .../admin/ReviewManagementStoreAdminAPI.java | 2 +- .../admin/SubscriptionManagementAdminAPI.java | 2 +- .../services/impl/ApplicationManagementAPIImpl.java | 4 ++-- .../api/services/impl/ReviewManagementAPIImpl.java | 4 ++-- .../services/impl/SubscriptionManagementAPIImpl.java | 6 +++--- .../admin/ReviewManagementStoreAdminAPIImpl.java | 4 ++-- .../admin/SubscriptionManagementAdminAPIImpl.java | 6 +++--- .../services/impl/util/RequestValidationUtil.java | 4 ++-- .../application/mgt/store/api/util/Constants.java | 2 +- .../src/main/webapp/META-INF/permissions.xml | 0 .../src/main/webapp/META-INF/webapp-classloading.xml | 0 .../src/main/webapp/WEB-INF/cxf-servlet.xml | 12 ++++++------ .../src/main/webapp/WEB-INF/web.xml | 0 .../store/api/services}/CommentMgtTestHelper.java | 2 +- .../store/api/services/ReviewManagementAPITest.java | 2 +- .../src/test/resources/log4j.properties | 0 .../src/test/resources/testng.xml | 2 +- 21 files changed, 32 insertions(+), 32 deletions(-) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api => io.entgra.application.store.api}/pom.xml (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/ApplicationManagementAPI.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/ReviewManagementAPI.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/SubscriptionManagementAPI.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/services/impl/util/RequestValidationUtil.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device => io.entgra.application.store.api/src/main/java/io/entgra}/application/mgt/store/api/util/Constants.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api => io.entgra.application.store.api}/src/main/webapp/META-INF/permissions.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api => io.entgra.application.store.api}/src/main/webapp/META-INF/webapp-classloading.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api => io.entgra.application.store.api}/src/main/webapp/WEB-INF/cxf-servlet.xml (79%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api => io.entgra.application.store.api}/src/main/webapp/WEB-INF/web.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/test/java/org/wso2/carbon/device/application/mgt/store/api/services/util => io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services}/CommentMgtTestHelper.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api/src/test/java/org/wso2/carbon/device => io.entgra.application.store.api/src/test/java/io/entgra}/application/mgt/store/api/services/ReviewManagementAPITest.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api => io.entgra.application.store.api}/src/test/resources/log4j.properties (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.store.api => io.entgra.application.store.api}/src/test/resources/testng.xml (89%) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml b/components/application-mgt/io.entgra.application.store.api/pom.xml similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml rename to components/application-mgt/io.entgra.application.store.api/pom.xml index 480264b88a..ac60b1e26d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/pom.xml +++ b/components/application-mgt/io.entgra.application.store.api/pom.xml @@ -27,10 +27,10 @@ 4.0.0 - org.wso2.carbon.device.application.mgt.store.api + io.entgra.application.mgt.store.api war - WSO2 Carbon - Application Management Store API - WSO2 Carbon - Application Management Store API + Entgra - Application Management Store API + Entgra - Application Management Store API https://entgra.io diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java index eaf5380ddf..0136d7ca5c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ApplicationManagementAPI.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services; +package io.entgra.application.mgt.store.api.services; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPI.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPI.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java index a620045426..2e1613641f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPI.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services; +package io.entgra.application.mgt.store.api.services; import io.swagger.annotations.ApiParam; import io.swagger.annotations.Api; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/SubscriptionManagementAPI.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/SubscriptionManagementAPI.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java index 9c2bfcdf79..26742db9f3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/SubscriptionManagementAPI.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services; +package io.entgra.application.mgt.store.api.services; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java index cfaf91a5cc..3cbd7ece80 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services.admin; +package io.entgra.application.mgt.store.api.services.admin; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java index d46594d6cc..e7bd335817 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services.admin; +package io.entgra.application.mgt.store.api.services.admin; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java index ac0b3b283b..808c67b287 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services.impl; +package io.entgra.application.mgt.store.api.services.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -27,7 +27,7 @@ import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.store.api.services.ApplicationManagementAPI; +import io.entgra.application.mgt.store.api.services.ApplicationManagementAPI; import javax.validation.Valid; import javax.ws.rs.Consumes; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java index c617671de7..7f5a8b9195 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services.impl; +package io.entgra.application.mgt.store.api.services.impl; import io.swagger.annotations.ApiParam; import org.apache.commons.logging.Log; @@ -28,7 +28,7 @@ import org.wso2.carbon.device.application.mgt.common.wrapper.ReviewWrapper; import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.store.api.services.ReviewManagementAPI; +import io.entgra.application.mgt.store.api.services.ReviewManagementAPI; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java index 4a51353997..b045b8bda3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services.impl; +package io.entgra.application.mgt.store.api.services.impl; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -33,13 +33,13 @@ import org.wso2.carbon.device.application.mgt.common.BasicUserInfo; import org.wso2.carbon.device.application.mgt.common.BasicUserInfoList; import org.wso2.carbon.device.application.mgt.common.RoleList; import org.wso2.carbon.device.application.mgt.common.DeviceGroupList; -import org.wso2.carbon.device.application.mgt.store.api.services.impl.util.RequestValidationUtil; +import io.entgra.application.mgt.store.api.services.impl.util.RequestValidationUtil; import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import org.wso2.carbon.device.application.mgt.core.task.ScheduledAppSubscriptionTaskManager; import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.store.api.services.SubscriptionManagementAPI; +import io.entgra.application.mgt.store.api.services.SubscriptionManagementAPI; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.MDMAppConstants; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java index 5cca42852f..9dc8aec9fc 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services.impl.admin; +package io.entgra.application.mgt.store.api.services.impl.admin; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -23,7 +23,7 @@ import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementE import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.store.api.services.admin.ReviewManagementStoreAdminAPI; +import io.entgra.application.mgt.store.api.services.admin.ReviewManagementStoreAdminAPI; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java index 681b3b5f38..17cf3511f9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services.impl.admin; +package io.entgra.application.mgt.store.api.services.impl.admin; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -26,8 +26,8 @@ import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManage import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.store.api.services.admin.SubscriptionManagementAdminAPI; -import org.wso2.carbon.device.application.mgt.store.api.services.impl.util.RequestValidationUtil; +import io.entgra.application.mgt.store.api.services.admin.SubscriptionManagementAdminAPI; +import io.entgra.application.mgt.store.api.services.impl.util.RequestValidationUtil; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationResult; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/util/RequestValidationUtil.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/util/RequestValidationUtil.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java index 2a59d220a4..4061bcd965 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/services/impl/util/RequestValidationUtil.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java @@ -16,12 +16,12 @@ * under the License. * */ -package org.wso2.carbon.device.application.mgt.store.api.services.impl.util; +package io.entgra.application.mgt.store.api.services.impl.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.store.api.util.Constants; +import io.entgra.application.mgt.store.api.util.Constants; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/util/Constants.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/util/Constants.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/util/Constants.java rename to components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/util/Constants.java index a78c16077f..3c06f365d2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/java/org/wso2/carbon/device/application/mgt/store/api/util/Constants.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/util/Constants.java @@ -33,7 +33,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.util; +package io.entgra.application.mgt.store.api.util; /** * Holds the constants used by DeviceImpl Management Admin web application. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/permissions.xml b/components/application-mgt/io.entgra.application.store.api/src/main/webapp/META-INF/permissions.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/permissions.xml rename to components/application-mgt/io.entgra.application.store.api/src/main/webapp/META-INF/permissions.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/application-mgt/io.entgra.application.store.api/src/main/webapp/META-INF/webapp-classloading.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml rename to components/application-mgt/io.entgra.application.store.api/src/main/webapp/META-INF/webapp-classloading.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml similarity index 79% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml rename to components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 3488f6e8bc..b9f9d11576 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -39,7 +39,7 @@ - + @@ -55,11 +55,11 @@ - - - - - + + + + + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/WEB-INF/web.xml b/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/main/webapp/WEB-INF/web.xml rename to components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/web.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/java/org/wso2/carbon/device/application/mgt/store/api/services/util/CommentMgtTestHelper.java b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/java/org/wso2/carbon/device/application/mgt/store/api/services/util/CommentMgtTestHelper.java rename to components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java index beae02de6d..b14d9035b4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/java/org/wso2/carbon/device/application/mgt/store/api/services/util/CommentMgtTestHelper.java +++ b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services.util; +package io.entgra.application.mgt.store.api.services; import org.wso2.carbon.device.application.mgt.common.response.Review; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPITest.java b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPITest.java rename to components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java index 86b4730c73..643f3c0ece 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/java/org/wso2/carbon/device/application/mgt/store/api/services/ReviewManagementAPITest.java +++ b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.store.api.services; +package io.entgra.application.mgt.store.api.services; import junit.framework.TestCase; import org.apache.commons.logging.Log; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/resources/log4j.properties b/components/application-mgt/io.entgra.application.store.api/src/test/resources/log4j.properties similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/resources/log4j.properties rename to components/application-mgt/io.entgra.application.store.api/src/test/resources/log4j.properties diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/resources/testng.xml b/components/application-mgt/io.entgra.application.store.api/src/test/resources/testng.xml similarity index 89% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/resources/testng.xml rename to components/application-mgt/io.entgra.application.store.api/src/test/resources/testng.xml index 3513acff4e..68732a014c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.store.api/src/test/resources/testng.xml +++ b/components/application-mgt/io.entgra.application.store.api/src/test/resources/testng.xml @@ -23,7 +23,7 @@ - + From a57043b5c1998c3c30fcdfba4a8f7977f5eff962 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 16:07:17 +0530 Subject: [PATCH 34/54] package name change - appmgt publisher api --- .../pom.xml | 6 +++--- .../api/services/ApplicationManagementPublisherAPI.java | 2 +- .../admin/ApplicationManagementPublisherAdminAPI.java | 2 +- .../services/admin/ReviewManagementPublisherAdminAPI.java | 2 +- .../impl/ApplicationManagementPublisherAPIImpl.java | 4 ++-- .../admin/ApplicationManagementPublisherAdminAPIImpl.java | 4 ++-- .../impl/admin/ReviewManagementPublisherAdminAPIImpl.java | 4 ++-- .../src/main/webapp/META-INF/permissions.xml | 0 .../src/main/webapp/META-INF/webapp-classloading.xml | 0 .../src/main/webapp/WEB-INF/cxf-servlet.xml | 8 ++++---- .../src/main/webapp/WEB-INF/web.xml | 0 11 files changed, 16 insertions(+), 16 deletions(-) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api => io.entgra.application.mgt.publisher.api}/pom.xml (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.publisher.api/src/main/java/io/entgra}/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.publisher.api/src/main/java/io/entgra}/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.publisher.api/src/main/java/io/entgra}/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.publisher.api/src/main/java/io/entgra}/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.publisher.api/src/main/java/io/entgra}/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.publisher.api/src/main/java/io/entgra}/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api => io.entgra.application.mgt.publisher.api}/src/main/webapp/META-INF/permissions.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api => io.entgra.application.mgt.publisher.api}/src/main/webapp/META-INF/webapp-classloading.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api => io.entgra.application.mgt.publisher.api}/src/main/webapp/WEB-INF/cxf-servlet.xml (84%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.publisher.api => io.entgra.application.mgt.publisher.api}/src/main/webapp/WEB-INF/web.xml (100%) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml rename to components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml index 75586560be..71fe89cfce 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml @@ -27,10 +27,10 @@ 4.0.0 - org.wso2.carbon.device.application.mgt.publisher.api + io.entgra.application.mgt.publisher.api war - WSO2 Carbon - Application Management Publisher API - WSO2 Carbon - Application Management Publisher API + Entgra - Application Management Publisher API + Entgra - Application Management Publisher API https://entgra.io diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java index 19bf82f0f0..eb2446830e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.publisher.api.services; +package io.entgra.application.mgt.publisher.api.services; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java index bbf92d37eb..3b9d653b1f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.publisher.api.services.admin; +package io.entgra.application.mgt.publisher.api.services.admin; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java index 73a1ccb636..0cbb416a71 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.publisher.api.services.admin; +package io.entgra.application.mgt.publisher.api.services.admin; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java index 74f4b4ee75..0587b0cdd7 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.publisher.api.services.impl; +package io.entgra.application.mgt.publisher.api.services.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -43,7 +43,7 @@ import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; import org.wso2.carbon.device.application.mgt.core.util.APIUtil; import org.wso2.carbon.device.application.mgt.core.util.Constants; -import org.wso2.carbon.device.application.mgt.publisher.api.services.ApplicationManagementPublisherAPI; +import io.entgra.application.mgt.publisher.api.services.ApplicationManagementPublisherAPI; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java index 8e739f1602..370f57e57e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.publisher.api.services.impl.admin; +package io.entgra.application.mgt.publisher.api.services.impl.admin; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -25,7 +25,7 @@ import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.publisher.api.services.admin.ApplicationManagementPublisherAdminAPI; +import io.entgra.application.mgt.publisher.api.services.admin.ApplicationManagementPublisherAdminAPI; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java index c572004e1e..f0af7225b9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/java/org/wso2/carbon/device/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.publisher.api.services.impl.admin; +package io.entgra.application.mgt.publisher.api.services.impl.admin; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -26,7 +26,7 @@ import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementE import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.publisher.api.services.admin.ReviewManagementPublisherAdminAPI; +import io.entgra.application.mgt.publisher.api.services.admin.ReviewManagementPublisherAdminAPI; import javax.ws.rs.DefaultValue; import javax.ws.rs.GET; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/permissions.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/META-INF/permissions.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/permissions.xml rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/META-INF/permissions.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/META-INF/webapp-classloading.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml similarity index 84% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml index c927571504..91580abb68 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -38,7 +38,7 @@ - + @@ -54,9 +54,9 @@ - - - + + + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/WEB-INF/web.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.publisher.api/src/main/webapp/WEB-INF/web.xml rename to components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/web.xml From 4de4a153595c00e3c07c98456ebdf9b3bb167855 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 16:13:23 +0530 Subject: [PATCH 35/54] package name change - appmgt api --- .../pom.xml | 6 +++--- .../application/mgt/api/services/ArtifactDownloadAPI.java | 2 +- .../mgt/api/services/impl/ArtifactDownloadAPIImpl.java | 4 ++-- .../src/main/webapp/META-INF/permissions.xml | 0 .../src/main/webapp/META-INF/webapp-classloading.xml | 0 .../src/main/webapp/WEB-INF/cxf-servlet.xml | 4 ++-- .../src/main/webapp/WEB-INF/web.xml | 0 7 files changed, 8 insertions(+), 8 deletions(-) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.api => io.entgra.application.mgt.api}/pom.xml (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.api/src/main/java/io/entgra}/application/mgt/api/services/ArtifactDownloadAPI.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.api/src/main/java/io/entgra}/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.api => io.entgra.application.mgt.api}/src/main/webapp/META-INF/permissions.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.api => io.entgra.application.mgt.api}/src/main/webapp/META-INF/webapp-classloading.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.api => io.entgra.application.mgt.api}/src/main/webapp/WEB-INF/cxf-servlet.xml (92%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.api => io.entgra.application.mgt.api}/src/main/webapp/WEB-INF/web.xml (100%) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.api/pom.xml similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.api/pom.xml rename to components/application-mgt/io.entgra.application.mgt.api/pom.xml index 6a84b225e1..a4cda82b78 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.api/pom.xml @@ -27,10 +27,10 @@ 4.0.0 - org.wso2.carbon.device.application.mgt.api + io.entgra.application.mgt.api war - WSO2 Carbon - Application Management API - WSO2 Carbon - Application Management API + Entgra - Application Management API + Entgra - Application Management API https://entgra.io diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/ArtifactDownloadAPI.java b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/ArtifactDownloadAPI.java rename to components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java index 8a013e1370..ca46ae679e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/ArtifactDownloadAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.api.services; +package io.entgra.application.mgt.api.services; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java rename to components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java index 005d00e757..526257a2dd 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/java/org/wso2/carbon/device/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java @@ -15,12 +15,12 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.api.services.impl; +package io.entgra.application.mgt.api.services.impl; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.api.services.ArtifactDownloadAPI; +import io.entgra.application.mgt.api.services.ArtifactDownloadAPI; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/META-INF/permissions.xml b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/META-INF/permissions.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/META-INF/permissions.xml rename to components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/META-INF/permissions.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml rename to components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/META-INF/webapp-classloading.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml similarity index 92% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml rename to components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 23d288898d..cfcce344b9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -36,7 +36,7 @@ - + @@ -52,7 +52,7 @@ - + diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/WEB-INF/web.xml b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.api/src/main/webapp/WEB-INF/web.xml rename to components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/web.xml From 16af7a44b50161d127552b6483c38de412bf15d2 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 16:15:59 +0530 Subject: [PATCH 36/54] package name change - appmgt addons --- .../pom.xml | 28 +++++++++++++++---- .../mgt/addons/ApiOriginFilter.java | 2 +- .../mgt/addons/FileStreamingOutput.java | 2 +- .../mgt/addons/JSONMessageHandler.java | 4 +-- .../mgt/addons/MultipartCustomProvider.java | 4 +-- .../mgt/addons/ValidationInterceptor.java | 2 +- .../jaxrs/AnnotationExclusionStrategy.java | 2 +- .../application/mgt/addons/jaxrs/Exclude.java | 2 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 8 +++--- .../src/main/webapp/WEB-INF/web.xml | 2 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 8 +++--- .../src/main/webapp/WEB-INF/web.xml | 2 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 8 +++--- .../src/main/webapp/WEB-INF/web.xml | 2 +- 14 files changed, 47 insertions(+), 29 deletions(-) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.addons => io.entgra.application.mgt.addons}/pom.xml (78%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.addons/src/main/java/io/entgra}/application/mgt/addons/ApiOriginFilter.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.addons/src/main/java/io/entgra}/application/mgt/addons/FileStreamingOutput.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.addons/src/main/java/io/entgra}/application/mgt/addons/JSONMessageHandler.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.addons/src/main/java/io/entgra}/application/mgt/addons/MultipartCustomProvider.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.addons/src/main/java/io/entgra}/application/mgt/addons/ValidationInterceptor.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.addons/src/main/java/io/entgra}/application/mgt/addons/jaxrs/AnnotationExclusionStrategy.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.addons/src/main/java/io/entgra}/application/mgt/addons/jaxrs/Exclude.java (94%) diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml b/components/application-mgt/io.entgra.application.mgt.addons/pom.xml similarity index 78% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml rename to components/application-mgt/io.entgra.application.mgt.addons/pom.xml index 059af5fb7e..06a97f01aa 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.addons/pom.xml @@ -1,5 +1,23 @@ - + + application-mgt org.wso2.carbon.devicemgt @@ -8,9 +26,9 @@ 4.0.0 - org.wso2.carbon.device.application.mgt.addons - WSO2 Carbon - Application Management Add-Ons - WSO2 Carbon - Application Management Add-Ons + io.entgra.application.mgt.addons + Entgra - Application Management Add-Ons + Entgra - Application Management Add-Ons https://entgra.io @@ -35,7 +53,7 @@ io.swagger.annotations.*;resolution:=optional - org.wso2.carbon.device.application.mgt.addons.* + io.entgra.application.mgt.addons.* diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/ApiOriginFilter.java b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/ApiOriginFilter.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/ApiOriginFilter.java rename to components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/ApiOriginFilter.java index 25446e9513..62ba2f3521 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/ApiOriginFilter.java +++ b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/ApiOriginFilter.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.addons; +package io.entgra.application.mgt.addons; import javax.servlet.Filter; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/FileStreamingOutput.java b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/FileStreamingOutput.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/FileStreamingOutput.java rename to components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/FileStreamingOutput.java index a1ad912d19..cf477e58c9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/FileStreamingOutput.java +++ b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/FileStreamingOutput.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.addons; +package io.entgra.application.mgt.addons; import javax.ws.rs.WebApplicationException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/JSONMessageHandler.java b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/JSONMessageHandler.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/JSONMessageHandler.java rename to components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/JSONMessageHandler.java index 6951e02b2e..9aa828b34c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/JSONMessageHandler.java +++ b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/JSONMessageHandler.java @@ -14,11 +14,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.addons; +package io.entgra.application.mgt.addons; import com.google.gson.Gson; import com.google.gson.GsonBuilder; -import org.wso2.carbon.device.application.mgt.addons.jaxrs.AnnotationExclusionStrategy; +import io.entgra.application.mgt.addons.jaxrs.AnnotationExclusionStrategy; import javax.ws.rs.Consumes; import javax.ws.rs.Produces; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/MultipartCustomProvider.java b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/MultipartCustomProvider.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/MultipartCustomProvider.java rename to components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/MultipartCustomProvider.java index 647cbcc27d..3a8c2d42ea 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/MultipartCustomProvider.java +++ b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/MultipartCustomProvider.java @@ -14,14 +14,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.addons; +package io.entgra.application.mgt.addons; import com.google.gson.Gson; import com.google.gson.GsonBuilder; import com.google.gson.JsonObject; import com.google.gson.JsonParser; import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.wso2.carbon.device.application.mgt.addons.jaxrs.AnnotationExclusionStrategy; +import io.entgra.application.mgt.addons.jaxrs.AnnotationExclusionStrategy; import javax.ws.rs.Consumes; import javax.ws.rs.WebApplicationException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/ValidationInterceptor.java b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/ValidationInterceptor.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/ValidationInterceptor.java rename to components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/ValidationInterceptor.java index d36e9986b1..43182bafdc 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/ValidationInterceptor.java +++ b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/ValidationInterceptor.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.addons; +package io.entgra.application.mgt.addons; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/jaxrs/AnnotationExclusionStrategy.java b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/jaxrs/AnnotationExclusionStrategy.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/jaxrs/AnnotationExclusionStrategy.java rename to components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/jaxrs/AnnotationExclusionStrategy.java index d2a92c4c27..5a4932532c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/jaxrs/AnnotationExclusionStrategy.java +++ b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/jaxrs/AnnotationExclusionStrategy.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.addons.jaxrs; +package io.entgra.application.mgt.addons.jaxrs; import com.google.gson.ExclusionStrategy; import com.google.gson.FieldAttributes; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/jaxrs/Exclude.java b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/jaxrs/Exclude.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/jaxrs/Exclude.java rename to components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/jaxrs/Exclude.java index e185ececcb..1f42ccb335 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.addons/src/main/java/org/wso2/carbon/device/application/mgt/addons/jaxrs/Exclude.java +++ b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/jaxrs/Exclude.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.addons.jaxrs; +package io.entgra.application.mgt.addons.jaxrs; import java.lang.annotation.ElementType; import java.lang.annotation.Retention; diff --git a/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml index cfcce344b9..69b6816220 100644 --- a/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -48,17 +48,17 @@ - + - - + + - + diff --git a/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/web.xml b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/web.xml index 15677f5277..5917cf8aaa 100644 --- a/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/web.xml +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/web.xml @@ -74,7 +74,7 @@ ApiOriginFilter - org.wso2.carbon.device.application.mgt.addons.ApiOriginFilter + io.entgra.application.mgt.addons.ApiOriginFilter diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 91580abb68..8314c023b3 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -50,19 +50,19 @@ - + - - + + - + diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/web.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/web.xml index fb8b266948..634df3e71a 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/web.xml +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/web.xml @@ -73,7 +73,7 @@ ApiOriginFilter - org.wso2.carbon.device.application.mgt.addons.ApiOriginFilter + io.entgra.application.mgt.addons.ApiOriginFilter diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml index b9f9d11576..c7003a4fdb 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -51,7 +51,7 @@ - + @@ -60,12 +60,12 @@ - - + + - + diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/web.xml b/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/web.xml index 93903ed95a..09dc9ca61f 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/web.xml +++ b/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/web.xml @@ -73,7 +73,7 @@ ApiOriginFilter - org.wso2.carbon.device.application.mgt.addons.ApiOriginFilter + io.entgra.application.mgt.addons.ApiOriginFilter From 37b08ba3895cc317348cc0def8a8a36a3ba602cc Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 16:48:15 +0530 Subject: [PATCH 37/54] package name change - appmgt core --- .../impl/ArtifactDownloadAPIImpl.java | 8 +-- .../pom.xml | 12 ++-- .../mgt/core/config/Artifacts.java | 2 +- .../mgt/core/config/Configuration.java | 2 +- .../mgt/core/config/ConfigurationManager.java | 4 +- .../mgt/core/config/Extension.java | 2 +- .../core/config/PaginationConfiguration.java | 2 +- .../mgt/core/config/Parameter.java | 2 +- .../mgt/core/dao/ApplicationDAO.java | 4 +- .../mgt/core/dao/ApplicationReleaseDAO.java | 4 +- .../mgt/core/dao/LifecycleStateDAO.java | 4 +- .../application/mgt/core/dao/ReviewDAO.java | 4 +- .../mgt/core/dao/SubscriptionDAO.java | 5 +- .../mgt/core/dao/VisibilityDAO.java | 4 +- .../ApplicationManagementDAOFactory.java | 66 +++++++++--------- .../mgt/core/dao/impl/AbstractDAOImpl.java | 4 +- .../GenericApplicationDAOImpl.java | 12 ++-- .../application/OracleApplicationDAOImpl.java | 6 +- .../PostgreSQLApplicationDAOImpl.java | 2 +- .../SQLServerApplicationDAOImpl.java | 6 +- .../GenericApplicationReleaseDAOImpl.java | 10 +-- .../OracleApplicationReleaseDAOImpl.java | 4 +- .../PostgreSQLApplicationReleaseDAOImpl.java | 2 +- .../SQLServerApplicationReleaseDAOImpl.java | 4 +- .../GenericLifecycleStateDAOImpl.java | 10 +-- .../OracleLifecycleStateDAOImpl.java | 2 +- .../PostgreSQLLifecycleStateDAOImpl.java | 2 +- .../SQLServerLifecycleStateDAOImpl.java | 2 +- .../dao/impl/review/GenericReviewDAOImpl.java | 14 ++-- .../dao/impl/review/OracleReviewDAOImpl.java | 8 +-- .../impl/review/PostgreSQLReviewDAOImpl.java | 2 +- .../impl/review/SQLServerReviewDAOImpl.java | 8 +-- .../GenericSubscriptionDAOImpl.java | 13 ++-- .../OracleSubscriptionDAOImpl.java | 4 +- .../PostgreSQLSubscriptionDAOImpl.java | 2 +- .../SQLServerSubscriptionDAOImpl.java | 7 +- .../visibility/GenericVisibilityDAOImpl.java | 8 +-- .../visibility/OracleVisibilityDAOImpl.java | 2 +- .../PostgreSQLVisibilityDAOImpl.java | 2 +- .../SQLServerVisibilityDAOImpl.java | 2 +- .../mgt/core/deployer/Property.java | 2 +- .../ApplicationManagementDAOException.java | 2 +- .../ApplicationOperationTaskException.java | 2 +- .../core/exception/BadRequestException.java | 2 +- .../core/exception/ForbiddenException.java | 2 +- .../LifeCycleManagementDAOException.java | 2 +- .../mgt/core/exception/NotFoundException.java | 2 +- .../mgt/core/exception/ParsingException.java | 2 +- .../ReviewManagementDAOException.java | 2 +- .../SubscriptionManagementDAOException.java | 2 +- .../UnexpectedServerErrorException.java | 2 +- .../core/exception/ValidationException.java | 2 +- .../VisibilityManagementDAOException.java | 2 +- .../mgt/core/impl/ApplicationManagerImpl.java | 40 +++++------ .../impl/ApplicationStorageManagerImpl.java | 12 ++-- .../mgt/core/impl/AppmDataHandlerImpl.java | 12 ++-- .../mgt/core/impl/ReviewManagerImpl.java | 24 +++---- .../core/impl/SubscriptionManagerImpl.java | 30 ++++---- ...ApplicationManagementServiceComponent.java | 14 ++-- .../mgt/core/internal/DataHolder.java | 4 +- .../core/lifecycle/LifecycleStateManager.java | 4 +- .../ScheduledAppSubscriptionCleanupTask.java | 4 +- .../task/ScheduledAppSubscriptionTask.java | 6 +- .../ScheduledAppSubscriptionTaskManager.java | 12 ++-- .../application/mgt/core/util/APIUtil.java | 10 +-- .../core/util/ApplicationManagementUtil.java | 8 +-- .../util/ApplicationMgtDatabaseCreator.java | 2 +- .../mgt/core/util/ArtifactsParser.java | 5 +- .../mgt/core/util/ConnectionManagerUtil.java | 2 +- .../application/mgt/core/util/Constants.java | 2 +- .../application/mgt/core/util/DAOUtil.java | 4 +- .../application/mgt/core/util/HelperUtil.java | 2 +- .../application/mgt/core/util/JSONUtil.java | 2 +- .../mgt/core/util/MDMAppConstants.java | 2 +- .../application/mgt/core/util/OAuthUtils.java | 2 +- .../mgt/core/util/StorageManagementUtil.java | 2 +- .../src/main/resources/META-INF/component.xml | 2 +- .../mgt/core}/ArtifactParserTest.java | 6 +- .../application/mgt/core}/BaseTestCase.java | 18 ++--- .../mgt/core}/ConfigurationTest.java | 6 +- .../application/mgt/core}/InitTest.java | 4 +- .../mgt/core}/LifeCycleStateManagerTest.java | 4 +- .../mgt/core}/LifecycleManagementTest.java | 8 +-- .../mgt/core}/StorageManagementUtilTest.java | 4 +- .../application/mgt/core}/TestUtils.java | 2 +- .../mgt/core/common/DataSourceConfig.java | 2 +- .../dao/ApplicationManagementDAOTest.java | 10 +-- .../mgt/core}/dto/ApplicationsDTO.java | 2 +- .../mgt/core}/dto/DeviceTypeCreator.java | 2 +- .../management/ApplicationManagementTest.java | 14 ++-- .../src/test/resources/Platform.xml | 0 .../src/test/resources/application-mgt.xml | 10 +-- .../resources/carbon-home/dbscripts/h2.sql | 0 .../repository/conf/application-mgt.xml | 10 +-- .../repository/conf/axis2/axis2.xml | 0 .../repository/conf/axis2/axis2_client.xml | 0 .../repository/conf/axis2/tenant-axis2.xml | 0 .../carbon-home/repository/conf/carbon.xml | 0 .../repository/conf/cdm-config.xml | 0 .../conf/datasources/master-datasources.xml | 0 .../conf/etc/bundle-config/README.txt | 0 .../carboncontext-osgi-services.properties | 0 .../repository/conf/etc/config-validation.xml | 0 .../carbon-home/repository/conf/etc/jmx.xml | 0 .../repository/conf/etc/launch.ini | 0 .../conf/etc/logging-bridge.properties | 0 .../repository/conf/etc/mime.mappings | 0 .../repository/conf/etc/mime.types | 0 .../repository/conf/etc/osgi-debug.options | 0 .../repository/conf/etc/tasks-config.xml | 0 .../repository/conf/log4j.properties | 0 .../carbon-home/repository/conf/registry.xml | 0 .../conf/security/authenticators.xml | 0 .../conf/tomcat/carbon/META-INF/context.xml | 0 .../conf/tomcat/carbon/WEB-INF/web.xml | 0 .../conf/tomcat/catalina-server.xml | 0 .../repository/conf/tomcat/tomcat-users.xml | 0 .../repository/conf/tomcat/web.xml | 0 .../carbon-home/repository/conf/user-mgt.xml | 0 .../datasource/data-source-config.xml | 0 .../src/test/resources/h2.sql | 0 .../src/test/resources/log4j.properties | 0 .../test/resources/samples/app1/banner1.jpg | Bin .../src/test/resources/samples/app1/icon.png | Bin .../test/resources/samples/app1/sample.apk | Bin .../src/test/resources/samples/app1/shot1.png | Bin .../src/test/resources/samples/app1/shot2.png | Bin .../src/test/resources/samples/app1/shot3.png | Bin .../test/resources/samples/app2/banner1.jpg | Bin .../src/test/resources/samples/app2/icon.png | Bin .../resources/samples/app2/sample_4.0.6.apk | Bin .../src/test/resources/samples/app2/shot1.png | Bin .../src/test/resources/samples/app2/shot2.png | Bin .../src/test/resources/samples/app2/shot3.png | Bin .../src/test/resources/testng.xml | 16 ++--- .../user-test/user-mgt-registry-test.xml | 0 .../src/test/resources/util/app-debug.apk | Bin .../src/test/resources/util/iOSMDMAgent.ipa | Bin ...ApplicationManagementPublisherAPIImpl.java | 12 ++-- ...cationManagementPublisherAdminAPIImpl.java | 8 +-- ...ReviewManagementPublisherAdminAPIImpl.java | 4 +- .../impl/ApplicationManagementAPIImpl.java | 8 +-- .../impl/ReviewManagementAPIImpl.java | 8 +-- .../impl/SubscriptionManagementAPIImpl.java | 12 ++-- .../ReviewManagementStoreAdminAPIImpl.java | 4 +- .../SubscriptionManagementAdminAPIImpl.java | 6 +- .../impl/util/RequestValidationUtil.java | 2 +- .../api/services/ReviewManagementAPITest.java | 2 +- .../impl/DeviceManagementServiceImpl.java | 2 +- .../main/resources/conf/application-mgt.xml | 10 +-- 150 files changed, 342 insertions(+), 350 deletions(-) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/pom.xml (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/config/Artifacts.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/config/Configuration.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/config/ConfigurationManager.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/config/Extension.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/config/PaginationConfiguration.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/config/Parameter.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/ApplicationDAO.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/ApplicationReleaseDAO.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/LifecycleStateDAO.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/ReviewDAO.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/SubscriptionDAO.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/VisibilityDAO.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java (72%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/AbstractDAOImpl.java (88%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/application/PostgreSQLApplicationDAOImpl.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/application/release/PostgreSQLApplicationReleaseDAOImpl.java (92%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/lifecyclestate/OracleLifecycleStateDAOImpl.java (91%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/lifecyclestate/PostgreSQLLifecycleStateDAOImpl.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/lifecyclestate/SQLServerLifecycleStateDAOImpl.java (91%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/review/PostgreSQLReviewDAOImpl.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/subscription/PostgreSQLSubscriptionDAOImpl.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/visibility/OracleVisibilityDAOImpl.java (92%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/visibility/PostgreSQLVisibilityDAOImpl.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/dao/impl/visibility/SQLServerVisibilityDAOImpl.java (92%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/deployer/Property.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/ApplicationManagementDAOException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/ApplicationOperationTaskException.java (91%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/BadRequestException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/ForbiddenException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/LifeCycleManagementDAOException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/NotFoundException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/ParsingException.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/ReviewManagementDAOException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/SubscriptionManagementDAOException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/UnexpectedServerErrorException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/ValidationException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/exception/VisibilityManagementDAOException.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/impl/ApplicationManagerImpl.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/impl/ApplicationStorageManagerImpl.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/impl/AppmDataHandlerImpl.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/impl/ReviewManagerImpl.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/impl/SubscriptionManagerImpl.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/internal/ApplicationManagementServiceComponent.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/internal/DataHolder.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/lifecycle/LifecycleStateManager.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/task/ScheduledAppSubscriptionTask.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/APIUtil.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/ApplicationManagementUtil.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/ApplicationMgtDatabaseCreator.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/ArtifactsParser.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/ConnectionManagerUtil.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/Constants.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/DAOUtil.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/HelperUtil.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/JSONUtil.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/MDMAppConstants.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/OAuthUtils.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/main/java/io/entgra}/application/mgt/core/util/StorageManagementUtil.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/main/resources/META-INF/component.xml (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/ArtifactParserTest.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/BaseTestCase.java (92%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/ConfigurationTest.java (89%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/InitTest.java (90%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/LifeCycleStateManagerTest.java (91%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/LifecycleManagementTest.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/StorageManagementUtilTest.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/TestUtils.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org/wso2/carbon/device => io.entgra.application.mgt.core/src/test/java/io/entgra}/application/mgt/core/common/DataSourceConfig.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/dao/ApplicationManagementDAOTest.java (88%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/dto/ApplicationsDTO.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/dto/DeviceTypeCreator.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core}/management/ApplicationManagementTest.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/Platform.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/application-mgt.xml (91%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/dbscripts/h2.sql (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/application-mgt.xml (91%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/axis2/axis2.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/axis2/axis2_client.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/axis2/tenant-axis2.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/carbon.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/cdm-config.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/bundle-config/README.txt (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/carboncontext-osgi-services.properties (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/config-validation.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/jmx.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/launch.ini (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/logging-bridge.properties (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/mime.mappings (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/mime.types (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/osgi-debug.options (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/log4j.properties (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/registry.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/security/authenticators.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/tomcat/carbon/META-INF/context.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/tomcat/carbon/WEB-INF/web.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/tomcat/catalina-server.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/tomcat/tomcat-users.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/tomcat/web.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/carbon-home/repository/conf/user-mgt.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/datasource/data-source-config.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/h2.sql (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/log4j.properties (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app1/banner1.jpg (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app1/icon.png (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app1/sample.apk (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app1/shot1.png (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app1/shot2.png (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app1/shot3.png (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app2/banner1.jpg (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app2/icon.png (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app2/sample_4.0.6.apk (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app2/shot1.png (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app2/shot2.png (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/samples/app2/shot3.png (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/testng.xml (53%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/user-test/user-mgt-registry-test.xml (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/util/app-debug.apk (100%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.core => io.entgra.application.mgt.core}/src/test/resources/util/iOSMDMAgent.ipa (100%) diff --git a/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java index 526257a2dd..4d4ea30cd2 100644 --- a/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java @@ -24,10 +24,10 @@ import io.entgra.application.mgt.api.services.ArtifactDownloadAPI; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.util.Constants; import java.io.ByteArrayInputStream; import java.io.IOException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml b/components/application-mgt/io.entgra.application.mgt.core/pom.xml similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml rename to components/application-mgt/io.entgra.application.mgt.core/pom.xml index 1bf38faaaa..5a1d9f5778 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.core/pom.xml @@ -26,10 +26,10 @@ 4.0.0 - org.wso2.carbon.device.application.mgt.core + io.entgra.application.mgt.core bundle - WSO2 Carbon - Application Management Core - WSO2 Carbon - Application Management Core + Entgra - Application Management Core + Entgra - Application Management Core https://entgra.io @@ -48,7 +48,7 @@ ${project.artifactId} ${carbon.device.mgt.version} Application Management Core Bundle - org.wso2.carbon.device.application.mgt.core.internal + io.entgra.application.mgt.core.internal org.osgi.framework.*;version="${imp.package.version.osgi.framework}", org.osgi.service.*;version="${imp.package.version.osgi.service}", @@ -87,8 +87,8 @@ apk-parser;scope=compile|runtime;inline=false - !org.wso2.carbon.device.application.mgt.core.internal.*, - org.wso2.carbon.device.application.mgt.core.* + !io.entgra.application.mgt.core.internal.*, + io.entgra.application.mgt.core.* diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Artifacts.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Artifacts.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Artifacts.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Artifacts.java index 2c2e6cf25e..8e745c77eb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Artifacts.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Artifacts.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.config; +package io.entgra.application.mgt.core.config; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Configuration.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Configuration.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Configuration.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Configuration.java index 3f3626bfb7..3a254accc5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Configuration.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Configuration.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.config; +package io.entgra.application.mgt.core.config; import org.wso2.carbon.device.application.mgt.common.config.MDMConfig; import org.wso2.carbon.device.application.mgt.common.config.RatingConfiguration; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/ConfigurationManager.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/ConfigurationManager.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/ConfigurationManager.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/ConfigurationManager.java index da8146cf2e..cd2230aa14 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/ConfigurationManager.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/ConfigurationManager.java @@ -15,13 +15,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.config; +package io.entgra.application.mgt.core.config; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.InvalidConfigurationException; -import org.wso2.carbon.device.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.util.Constants; import java.io.File; import javax.xml.bind.JAXBContext; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Extension.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Extension.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Extension.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Extension.java index 17c9f3f63d..282f051889 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Extension.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Extension.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.config; +package io.entgra.application.mgt.core.config; import java.util.List; import javax.xml.bind.annotation.XmlAttribute; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/PaginationConfiguration.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/PaginationConfiguration.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/PaginationConfiguration.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/PaginationConfiguration.java index 0ca3d0e343..6b7974c74f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/PaginationConfiguration.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/PaginationConfiguration.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.config; +package io.entgra.application.mgt.core.config; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Parameter.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Parameter.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Parameter.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Parameter.java index a8e3d1dbc5..82419b1897 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/config/Parameter.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Parameter.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.config; +package io.entgra.application.mgt.core.config; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationDAO.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java index 73784e4813..1b680acc79 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java @@ -15,13 +15,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao; +package io.entgra.application.mgt.core.dao; import org.wso2.carbon.device.application.mgt.common.*; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; import org.wso2.carbon.device.application.mgt.common.dto.CategoryDTO; import org.wso2.carbon.device.application.mgt.common.dto.TagDTO; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationReleaseDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationReleaseDAO.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java index 28af63f2ed..c877d58478 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ApplicationReleaseDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao; +package io.entgra.application.mgt.core.dao; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; import org.wso2.carbon.device.application.mgt.common.Rating; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/LifecycleStateDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/LifecycleStateDAO.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/LifecycleStateDAO.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/LifecycleStateDAO.java index dd4e2575c9..9f46d533e4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/LifecycleStateDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/LifecycleStateDAO.java @@ -15,10 +15,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao; +package io.entgra.application.mgt.core.dao; import org.wso2.carbon.device.application.mgt.common.LifecycleState; -import org.wso2.carbon.device.application.mgt.core.exception.LifeCycleManagementDAOException; +import io.entgra.application.mgt.core.exception.LifeCycleManagementDAOException; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ReviewDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ReviewDAO.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java index ff2cf5d164..afcf8ceec3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/ReviewDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java @@ -15,12 +15,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao; +package io.entgra.application.mgt.core.dao; import org.wso2.carbon.device.application.mgt.common.response.Review; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; -import org.wso2.carbon.device.application.mgt.core.exception.ReviewManagementDAOException; +import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/SubscriptionDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/SubscriptionDAO.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java index 3ff0d95945..63151d7454 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/SubscriptionDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java @@ -15,16 +15,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao; +package io.entgra.application.mgt.core.dao; import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; -import java.time.LocalDateTime; import java.util.List; import java.util.Map; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/VisibilityDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/VisibilityDAO.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/VisibilityDAO.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/VisibilityDAO.java index e1cf1880ec..48597b8495 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/VisibilityDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/VisibilityDAO.java @@ -15,9 +15,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao; +package io.entgra.application.mgt.core.dao; -import org.wso2.carbon.device.application.mgt.core.exception.VisibilityManagementDAOException; +import io.entgra.application.mgt.core.exception.VisibilityManagementDAOException; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java similarity index 72% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java index 36aeaf9678..66e54834c2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java @@ -15,43 +15,43 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.common; +package io.entgra.application.mgt.core.dao.common; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.UnsupportedDatabaseEngineException; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationReleaseDAO; -import org.wso2.carbon.device.application.mgt.core.dao.LifecycleStateDAO; -import org.wso2.carbon.device.application.mgt.core.dao.ReviewDAO; -import org.wso2.carbon.device.application.mgt.core.dao.SubscriptionDAO; -import org.wso2.carbon.device.application.mgt.core.dao.VisibilityDAO; -import org.wso2.carbon.device.application.mgt.core.dao.impl.application.PostgreSQLApplicationDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.application.SQLServerApplicationDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.application.release.OracleApplicationReleaseDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.application.release.PostgreSQLApplicationReleaseDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.application.release.SQLServerApplicationReleaseDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate.OracleLifecycleStateDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate.PostgreSQLLifecycleStateDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate.SQLServerLifecycleStateDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.review.GenericReviewDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.application.GenericApplicationDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.application.release.GenericApplicationReleaseDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.application.OracleApplicationDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate.GenericLifecycleStateDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.review.OracleReviewDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.review.PostgreSQLReviewDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.review.SQLServerReviewDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.subscription.GenericSubscriptionDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.subscription.OracleSubscriptionDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.subscription.PostgreSQLSubscriptionDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.subscription.SQLServerSubscriptionDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.visibility.OracleVisibilityDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.visibility.PostgreSQLVisibilityDAOImpl; -import org.wso2.carbon.device.application.mgt.core.dao.impl.visibility.SQLServerVisibilityDAOImpl; -import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; -import org.wso2.carbon.device.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.dao.ApplicationDAO; +import io.entgra.application.mgt.core.dao.ApplicationReleaseDAO; +import io.entgra.application.mgt.core.dao.LifecycleStateDAO; +import io.entgra.application.mgt.core.dao.ReviewDAO; +import io.entgra.application.mgt.core.dao.SubscriptionDAO; +import io.entgra.application.mgt.core.dao.VisibilityDAO; +import io.entgra.application.mgt.core.dao.impl.application.PostgreSQLApplicationDAOImpl; +import io.entgra.application.mgt.core.dao.impl.application.SQLServerApplicationDAOImpl; +import io.entgra.application.mgt.core.dao.impl.application.release.OracleApplicationReleaseDAOImpl; +import io.entgra.application.mgt.core.dao.impl.application.release.PostgreSQLApplicationReleaseDAOImpl; +import io.entgra.application.mgt.core.dao.impl.application.release.SQLServerApplicationReleaseDAOImpl; +import io.entgra.application.mgt.core.dao.impl.lifecyclestate.OracleLifecycleStateDAOImpl; +import io.entgra.application.mgt.core.dao.impl.lifecyclestate.PostgreSQLLifecycleStateDAOImpl; +import io.entgra.application.mgt.core.dao.impl.lifecyclestate.SQLServerLifecycleStateDAOImpl; +import io.entgra.application.mgt.core.dao.impl.review.GenericReviewDAOImpl; +import io.entgra.application.mgt.core.dao.impl.application.GenericApplicationDAOImpl; +import io.entgra.application.mgt.core.dao.impl.application.release.GenericApplicationReleaseDAOImpl; +import io.entgra.application.mgt.core.dao.impl.application.OracleApplicationDAOImpl; +import io.entgra.application.mgt.core.dao.impl.lifecyclestate.GenericLifecycleStateDAOImpl; +import io.entgra.application.mgt.core.dao.impl.review.OracleReviewDAOImpl; +import io.entgra.application.mgt.core.dao.impl.review.PostgreSQLReviewDAOImpl; +import io.entgra.application.mgt.core.dao.impl.review.SQLServerReviewDAOImpl; +import io.entgra.application.mgt.core.dao.impl.subscription.GenericSubscriptionDAOImpl; +import io.entgra.application.mgt.core.dao.impl.subscription.OracleSubscriptionDAOImpl; +import io.entgra.application.mgt.core.dao.impl.subscription.PostgreSQLSubscriptionDAOImpl; +import io.entgra.application.mgt.core.dao.impl.subscription.SQLServerSubscriptionDAOImpl; +import io.entgra.application.mgt.core.dao.impl.visibility.GenericVisibilityDAOImpl; +import io.entgra.application.mgt.core.dao.impl.visibility.OracleVisibilityDAOImpl; +import io.entgra.application.mgt.core.dao.impl.visibility.PostgreSQLVisibilityDAOImpl; +import io.entgra.application.mgt.core.dao.impl.visibility.SQLServerVisibilityDAOImpl; +import io.entgra.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.application.mgt.core.util.Constants; import javax.sql.DataSource; import java.sql.SQLException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/AbstractDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/AbstractDAOImpl.java similarity index 88% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/AbstractDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/AbstractDAOImpl.java index a9488163fc..b9808ead34 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/AbstractDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/AbstractDAOImpl.java @@ -15,10 +15,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl; +package io.entgra.application.mgt.core.dao.impl; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.application.mgt.core.util.ConnectionManagerUtil; import java.sql.Connection; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java index dd8880c6fc..37b9b72c23 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.application; +package io.entgra.application.mgt.core.dao.impl.application; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -27,11 +27,11 @@ import org.wso2.carbon.device.application.mgt.common.Filter; import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; import org.wso2.carbon.device.application.mgt.common.dto.TagDTO; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO; -import org.wso2.carbon.device.application.mgt.core.util.DAOUtil; -import org.wso2.carbon.device.application.mgt.core.dao.impl.AbstractDAOImpl; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.application.mgt.core.dao.ApplicationDAO; +import io.entgra.application.mgt.core.util.DAOUtil; +import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java index bb705d7f82..e96f7769eb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.application; +package io.entgra.application.mgt.core.dao.impl.application; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -24,8 +24,8 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.Filter; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.util.DAOUtil; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.util.DAOUtil; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/PostgreSQLApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/PostgreSQLApplicationDAOImpl.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/PostgreSQLApplicationDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/PostgreSQLApplicationDAOImpl.java index 54eb76b914..bba8543c2c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/PostgreSQLApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/PostgreSQLApplicationDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.application; +package io.entgra.application.mgt.core.dao.impl.application; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java index d27e55aa9b..1c755e633e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.application; +package io.entgra.application.mgt.core.dao.impl.application; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -23,8 +23,8 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.Filter; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.util.DAOUtil; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.util.DAOUtil; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java index c03ab8bea2..c6b8309642 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java @@ -16,17 +16,17 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.application.release; +package io.entgra.application.mgt.core.dao.impl.application.release; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; import org.wso2.carbon.device.application.mgt.common.Rating; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationReleaseDAO; -import org.wso2.carbon.device.application.mgt.core.util.DAOUtil; -import org.wso2.carbon.device.application.mgt.core.dao.impl.AbstractDAOImpl; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.dao.ApplicationReleaseDAO; +import io.entgra.application.mgt.core.util.DAOUtil; +import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java index d030fa82b7..c9aaae519f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java @@ -15,12 +15,12 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.application.release; +package io.entgra.application.mgt.core.dao.impl.application.release; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/PostgreSQLApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/PostgreSQLApplicationReleaseDAOImpl.java similarity index 92% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/PostgreSQLApplicationReleaseDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/PostgreSQLApplicationReleaseDAOImpl.java index 3ffa907fcf..3727a992ae 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/PostgreSQLApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/PostgreSQLApplicationReleaseDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.application.release; +package io.entgra.application.mgt.core.dao.impl.application.release; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java index 4afcdf0928..eac1e23271 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java @@ -15,12 +15,12 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.application.release; +package io.entgra.application.mgt.core.dao.impl.application.release; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java index ee90772205..3c5c2aa559 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java @@ -15,17 +15,17 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate; +package io.entgra.application.mgt.core.dao.impl.lifecyclestate; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.AppLifecycleState; import org.wso2.carbon.device.application.mgt.common.LifecycleState; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.dao.LifecycleStateDAO; -import org.wso2.carbon.device.application.mgt.core.util.DAOUtil; -import org.wso2.carbon.device.application.mgt.core.dao.impl.AbstractDAOImpl; -import org.wso2.carbon.device.application.mgt.core.exception.LifeCycleManagementDAOException; +import io.entgra.application.mgt.core.dao.LifecycleStateDAO; +import io.entgra.application.mgt.core.util.DAOUtil; +import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; +import io.entgra.application.mgt.core.exception.LifeCycleManagementDAOException; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/OracleLifecycleStateDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/OracleLifecycleStateDAOImpl.java similarity index 91% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/OracleLifecycleStateDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/OracleLifecycleStateDAOImpl.java index e278574c39..feffaafca9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/OracleLifecycleStateDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/OracleLifecycleStateDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate; +package io.entgra.application.mgt.core.dao.impl.lifecyclestate; /** * This handles App Lifecycle operations which are specific to MSSQL. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/PostgreSQLLifecycleStateDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/PostgreSQLLifecycleStateDAOImpl.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/PostgreSQLLifecycleStateDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/PostgreSQLLifecycleStateDAOImpl.java index 1637777285..0dff4b0395 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/PostgreSQLLifecycleStateDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/PostgreSQLLifecycleStateDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate; +package io.entgra.application.mgt.core.dao.impl.lifecyclestate; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/SQLServerLifecycleStateDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/SQLServerLifecycleStateDAOImpl.java similarity index 91% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/SQLServerLifecycleStateDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/SQLServerLifecycleStateDAOImpl.java index 063e3ccd56..09db338455 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/lifecyclestate/SQLServerLifecycleStateDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/SQLServerLifecycleStateDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.lifecyclestate; +package io.entgra.application.mgt.core.dao.impl.lifecyclestate; /** * This handles App Lifecycle operations which are specific to MSSQL. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java index 24052730b3..a43f4710d0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.review; +package io.entgra.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -23,12 +23,12 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.dao.ReviewDAO; -import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; -import org.wso2.carbon.device.application.mgt.core.util.DAOUtil; -import org.wso2.carbon.device.application.mgt.core.dao.impl.AbstractDAOImpl; -import org.wso2.carbon.device.application.mgt.core.exception.ReviewManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.dao.ReviewDAO; +import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.application.mgt.core.util.DAOUtil; +import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; +import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; +import io.entgra.application.mgt.core.util.Constants; import java.sql.SQLException; import java.sql.ResultSet; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java index ac252e52f7..6f318a1d70 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java @@ -15,16 +15,16 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.review; +package io.entgra.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.exception.ReviewManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.util.Constants; -import org.wso2.carbon.device.application.mgt.core.util.DAOUtil; +import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; +import io.entgra.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.util.DAOUtil; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/PostgreSQLReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/PostgreSQLReviewDAOImpl.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/PostgreSQLReviewDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/PostgreSQLReviewDAOImpl.java index 38bebccd12..b5eacab5aa 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/PostgreSQLReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/PostgreSQLReviewDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.review; +package io.entgra.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java index 213d619b0c..d6a6368076 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java @@ -15,16 +15,16 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.review; +package io.entgra.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.exception.ReviewManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.util.Constants; -import org.wso2.carbon.device.application.mgt.core.util.DAOUtil; +import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; +import io.entgra.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.util.DAOUtil; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java index 4e6c6623f1..dbf896200c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.subscription; +package io.entgra.application.mgt.core.dao.impl.subscription; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -25,18 +25,17 @@ import org.wso2.carbon.device.application.mgt.common.SubscriptionType; import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.dao.SubscriptionDAO; -import org.wso2.carbon.device.application.mgt.core.dao.impl.AbstractDAOImpl; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; -import org.wso2.carbon.device.application.mgt.core.util.DAOUtil; +import io.entgra.application.mgt.core.dao.SubscriptionDAO; +import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.application.mgt.core.util.DAOUtil; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; import java.sql.Timestamp; -import java.time.LocalDateTime; import java.util.ArrayList; import java.util.Arrays; import java.util.Calendar; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java index b7932d9f9c..e4d25a8219 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java @@ -15,12 +15,12 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.subscription; +package io.entgra.application.mgt.core.dao.impl.subscription; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/PostgreSQLSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/PostgreSQLSubscriptionDAOImpl.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/PostgreSQLSubscriptionDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/PostgreSQLSubscriptionDAOImpl.java index de13737299..bae3c14471 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/PostgreSQLSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/PostgreSQLSubscriptionDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.subscription; +package io.entgra.application.mgt.core.dao.impl.subscription; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java index 26a498af1b..4d6763b047 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java @@ -15,21 +15,18 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.subscription; +package io.entgra.application.mgt.core.dao.impl.subscription; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; -import java.sql.Statement; -import java.sql.Timestamp; import java.util.ArrayList; -import java.util.Calendar; import java.util.List; /** diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java index 492a65e004..50156e417c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java @@ -15,14 +15,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.visibility; +package io.entgra.application.mgt.core.dao.impl.visibility; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.core.dao.VisibilityDAO; -import org.wso2.carbon.device.application.mgt.core.dao.impl.AbstractDAOImpl; -import org.wso2.carbon.device.application.mgt.core.exception.VisibilityManagementDAOException; +import io.entgra.application.mgt.core.dao.VisibilityDAO; +import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; +import io.entgra.application.mgt.core.exception.VisibilityManagementDAOException; import java.sql.Connection; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/OracleVisibilityDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/OracleVisibilityDAOImpl.java similarity index 92% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/OracleVisibilityDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/OracleVisibilityDAOImpl.java index 8234879598..8649d32d06 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/OracleVisibilityDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/OracleVisibilityDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.visibility; +package io.entgra.application.mgt.core.dao.impl.visibility; /** * This handles Application visibility handling operations which are specific to Oracle.. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/PostgreSQLVisibilityDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/PostgreSQLVisibilityDAOImpl.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/PostgreSQLVisibilityDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/PostgreSQLVisibilityDAOImpl.java index 3d9169f7b6..fb0cecccd6 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/PostgreSQLVisibilityDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/PostgreSQLVisibilityDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.visibility; +package io.entgra.application.mgt.core.dao.impl.visibility; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/SQLServerVisibilityDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/SQLServerVisibilityDAOImpl.java similarity index 92% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/SQLServerVisibilityDAOImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/SQLServerVisibilityDAOImpl.java index 3243f24116..935f0f057e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/dao/impl/visibility/SQLServerVisibilityDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/SQLServerVisibilityDAOImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao.impl.visibility; +package io.entgra.application.mgt.core.dao.impl.visibility; /** * This handles Application visibility handling operations which are specific to MsSQL. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/deployer/Property.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/deployer/Property.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/deployer/Property.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/deployer/Property.java index f9fc46b0a1..0072d10d49 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/deployer/Property.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/deployer/Property.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.deployer; +package io.entgra.application.mgt.core.deployer; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ApplicationManagementDAOException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ApplicationManagementDAOException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ApplicationManagementDAOException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ApplicationManagementDAOException.java index d946ee3fce..2643d255f7 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ApplicationManagementDAOException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ApplicationManagementDAOException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; /** * Exception thrown during the ApplicationDTO Management DAO operations. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ApplicationOperationTaskException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ApplicationOperationTaskException.java similarity index 91% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ApplicationOperationTaskException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ApplicationOperationTaskException.java index bfec70afc5..1a9b9f55f4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ApplicationOperationTaskException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ApplicationOperationTaskException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; public class ApplicationOperationTaskException extends Exception { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/BadRequestException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/BadRequestException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/BadRequestException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/BadRequestException.java index 8930d87310..f4f940fbcd 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/BadRequestException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/BadRequestException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ForbiddenException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ForbiddenException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ForbiddenException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ForbiddenException.java index 3957b5bff2..f1a5554bfd 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ForbiddenException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ForbiddenException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/LifeCycleManagementDAOException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/LifeCycleManagementDAOException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/LifeCycleManagementDAOException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/LifeCycleManagementDAOException.java index 3b2a36da48..cd90374dc5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/LifeCycleManagementDAOException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/LifeCycleManagementDAOException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; /** * This exception will be thrown when there is an issue with Lifecycle related DAO operations. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/NotFoundException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/NotFoundException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/NotFoundException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/NotFoundException.java index 2073d5a7c0..36fe34b45a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/NotFoundException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/NotFoundException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ParsingException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ParsingException.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ParsingException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ParsingException.java index 543de598c4..53ecb39ae0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ParsingException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ParsingException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; public class ParsingException extends Exception { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ReviewManagementDAOException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ReviewManagementDAOException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ReviewManagementDAOException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ReviewManagementDAOException.java index e9f17065c7..1686453a2d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ReviewManagementDAOException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ReviewManagementDAOException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/SubscriptionManagementDAOException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/SubscriptionManagementDAOException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/SubscriptionManagementDAOException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/SubscriptionManagementDAOException.java index 8419ed643d..56330bd41d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/SubscriptionManagementDAOException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/SubscriptionManagementDAOException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/UnexpectedServerErrorException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/UnexpectedServerErrorException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/UnexpectedServerErrorException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/UnexpectedServerErrorException.java index d17116730f..aec891fda1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/UnexpectedServerErrorException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/UnexpectedServerErrorException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ValidationException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ValidationException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ValidationException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ValidationException.java index f17baee7f7..4b06dcb5a2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/ValidationException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ValidationException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/VisibilityManagementDAOException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/VisibilityManagementDAOException.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/VisibilityManagementDAOException.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/VisibilityManagementDAOException.java index b3cc7a3a63..2a65f5c83d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/exception/VisibilityManagementDAOException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/VisibilityManagementDAOException.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.exception; +package io.entgra.application.mgt.core.exception; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java index 05b757ba45..ef08172f10 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.impl; +package io.entgra.application.mgt.core.impl; import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.IOUtils; @@ -65,25 +65,25 @@ import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppReleaseWra import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppWrapper; import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppReleaseWrapper; import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppWrapper; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationReleaseDAO; -import org.wso2.carbon.device.application.mgt.core.dao.LifecycleStateDAO; -import org.wso2.carbon.device.application.mgt.core.dao.SubscriptionDAO; -import org.wso2.carbon.device.application.mgt.core.dao.VisibilityDAO; -import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; -import org.wso2.carbon.device.application.mgt.core.exception.LifeCycleManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.exception.VisibilityManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; -import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager; -import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; -import org.wso2.carbon.device.application.mgt.core.util.Constants; -import org.wso2.carbon.device.application.mgt.core.util.StorageManagementUtil; +import io.entgra.application.mgt.core.config.ConfigurationManager; +import io.entgra.application.mgt.core.dao.ApplicationDAO; +import io.entgra.application.mgt.core.dao.ApplicationReleaseDAO; +import io.entgra.application.mgt.core.dao.LifecycleStateDAO; +import io.entgra.application.mgt.core.dao.SubscriptionDAO; +import io.entgra.application.mgt.core.dao.VisibilityDAO; +import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; +import io.entgra.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.ForbiddenException; +import io.entgra.application.mgt.core.exception.LifeCycleManagementDAOException; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.exception.VisibilityManagementDAOException; +import io.entgra.application.mgt.core.internal.DataHolder; +import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.util.StorageManagementUtil; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.core.dto.DeviceType; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationStorageManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationStorageManagerImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java index fc58f3c910..5f34e80de4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ApplicationStorageManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.impl; +package io.entgra.application.mgt.core.impl; import com.dd.plist.NSDictionary; import net.dongliu.apk.parser.bean.ApkMeta; @@ -28,15 +28,15 @@ import org.wso2.carbon.device.application.mgt.common.DeviceTypes; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; -import org.wso2.carbon.device.application.mgt.core.exception.ParsingException; -import org.wso2.carbon.device.application.mgt.core.util.ArtifactsParser; -import org.wso2.carbon.device.application.mgt.core.util.Constants; -import org.wso2.carbon.device.application.mgt.core.util.StorageManagementUtil; +import io.entgra.application.mgt.core.exception.ParsingException; +import io.entgra.application.mgt.core.util.ArtifactsParser; +import io.entgra.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.util.StorageManagementUtil; import java.io.*; import java.util.List; -import static org.wso2.carbon.device.application.mgt.core.util.StorageManagementUtil.saveFile; +import static io.entgra.application.mgt.core.util.StorageManagementUtil.saveFile; /** * This class contains the default concrete implementation of ApplicationStorage Management. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/AppmDataHandlerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/AppmDataHandlerImpl.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/AppmDataHandlerImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/AppmDataHandlerImpl.java index bd0f6ad79f..9d87520e4b 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/AppmDataHandlerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/AppmDataHandlerImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.impl; +package io.entgra.application.mgt.core.impl; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -26,11 +26,11 @@ import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorag import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; -import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.internal.DataHolder; +import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.core.dto.DeviceType; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java index 92e281fd6b..f9a1ea3709 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/ReviewManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.impl; +package io.entgra.application.mgt.core.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -34,17 +34,17 @@ import org.wso2.carbon.device.application.mgt.common.exception.TransactionManage import org.wso2.carbon.device.application.mgt.common.response.Review; import org.wso2.carbon.device.application.mgt.common.services.*; import org.wso2.carbon.device.application.mgt.common.wrapper.ReviewWrapper; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationReleaseDAO; -import org.wso2.carbon.device.application.mgt.core.dao.ReviewDAO; -import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.exception.ReviewManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; -import org.wso2.carbon.device.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.dao.ApplicationDAO; +import io.entgra.application.mgt.core.dao.ApplicationReleaseDAO; +import io.entgra.application.mgt.core.dao.ReviewDAO; +import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.ForbiddenException; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; +import io.entgra.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.application.mgt.core.util.Constants; import java.util.ArrayList; import java.util.Comparator; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java index 2de1094c1f..0d3a9a2195 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.impl; +package io.entgra.application.mgt.core.impl; import com.google.gson.Gson; import org.apache.commons.httpclient.HttpClient; @@ -51,20 +51,20 @@ import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManag import org.wso2.carbon.device.application.mgt.common.exception.TransactionManagementException; import org.wso2.carbon.device.application.mgt.common.response.Application; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO; -import org.wso2.carbon.device.application.mgt.core.dao.SubscriptionDAO; -import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationManagementDAOException; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; -import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; -import org.wso2.carbon.device.application.mgt.core.util.Constants; -import org.wso2.carbon.device.application.mgt.core.util.HelperUtil; -import org.wso2.carbon.device.application.mgt.core.util.OAuthUtils; +import io.entgra.application.mgt.core.dao.ApplicationDAO; +import io.entgra.application.mgt.core.dao.SubscriptionDAO; +import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; +import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.ForbiddenException; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.internal.DataHolder; +import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.util.HelperUtil; +import io.entgra.application.mgt.core.util.OAuthUtils; import org.wso2.carbon.device.mgt.common.*; import org.wso2.carbon.device.mgt.common.app.mgt.App; import org.wso2.carbon.device.mgt.common.app.mgt.MobileAppTypes; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/internal/ApplicationManagementServiceComponent.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/ApplicationManagementServiceComponent.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/internal/ApplicationManagementServiceComponent.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/ApplicationManagementServiceComponent.java index 7f07edba77..59f5e7d1b5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/internal/ApplicationManagementServiceComponent.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/ApplicationManagementServiceComponent.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.internal; +package io.entgra.application.mgt.core.internal; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -27,12 +27,12 @@ import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorage import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; -import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory; -import org.wso2.carbon.device.application.mgt.core.impl.AppmDataHandlerImpl; -import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager; -import org.wso2.carbon.device.application.mgt.core.task.ScheduledAppSubscriptionTaskManager; -import org.wso2.carbon.device.application.mgt.core.util.ApplicationManagementUtil; +import io.entgra.application.mgt.core.config.ConfigurationManager; +import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; +import io.entgra.application.mgt.core.impl.AppmDataHandlerImpl; +import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.application.mgt.core.task.ScheduledAppSubscriptionTaskManager; +import io.entgra.application.mgt.core.util.ApplicationManagementUtil; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.ndatasource.core.DataSourceService; import org.wso2.carbon.ntask.core.service.TaskService; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/internal/DataHolder.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/DataHolder.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/internal/DataHolder.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/DataHolder.java index 81132a7009..fce0f8f04e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/internal/DataHolder.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/DataHolder.java @@ -15,14 +15,14 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.internal; +package io.entgra.application.mgt.core.internal; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.ntask.core.service.TaskService; import org.wso2.carbon.user.core.service.RealmService; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/lifecycle/LifecycleStateManager.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/lifecycle/LifecycleStateManager.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/lifecycle/LifecycleStateManager.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/lifecycle/LifecycleStateManager.java index e0f9a2f796..33154514a5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/lifecycle/LifecycleStateManager.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/lifecycle/LifecycleStateManager.java @@ -15,12 +15,12 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.lifecycle; +package io.entgra.application.mgt.core.lifecycle; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; -import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; +import io.entgra.application.mgt.core.internal.DataHolder; import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagementException; import org.wso2.carbon.device.mgt.core.permission.mgt.PermissionUtils; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java index 351a4477b2..266084eaa4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java @@ -16,13 +16,13 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.task; +package io.entgra.application.mgt.core.task; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.impl.SubscriptionManagerImpl; +import io.entgra.application.mgt.core.impl.SubscriptionManagerImpl; import org.wso2.carbon.device.mgt.core.task.impl.RandomlyAssignedScheduleTask; import java.util.Map; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/task/ScheduledAppSubscriptionTask.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/task/ScheduledAppSubscriptionTask.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java index d8f491e37d..3668b1669e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/task/ScheduledAppSubscriptionTask.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.task; +package io.entgra.application.mgt.core.task; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -30,8 +30,8 @@ import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDT import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.impl.SubscriptionManagerImpl; -import org.wso2.carbon.device.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.impl.SubscriptionManagerImpl; +import io.entgra.application.mgt.core.util.Constants; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.core.task.impl.RandomlyAssignedScheduleTask; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java index b274b1850f..66f94d5967 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.task; +package io.entgra.application.mgt.core.task; import com.google.gson.Gson; import org.apache.commons.codec.digest.DigestUtils; @@ -29,17 +29,15 @@ import org.wso2.carbon.device.application.mgt.common.SubscriptionType; import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationOperationTaskException; -import org.wso2.carbon.device.application.mgt.core.impl.SubscriptionManagerImpl; -import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; -import org.wso2.carbon.device.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.exception.ApplicationOperationTaskException; +import io.entgra.application.mgt.core.impl.SubscriptionManagerImpl; +import io.entgra.application.mgt.core.internal.DataHolder; +import io.entgra.application.mgt.core.util.Constants; import org.wso2.carbon.ntask.common.TaskException; import org.wso2.carbon.ntask.core.TaskInfo; import org.wso2.carbon.ntask.core.TaskManager; import org.wso2.carbon.ntask.core.service.TaskService; -import java.time.LocalDateTime; -import java.time.format.TextStyle; import java.util.Calendar; import java.util.Date; import java.util.HashMap; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java index 97e83d3128..f3ec5199bd 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/APIUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; @@ -40,10 +40,10 @@ import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppReleaseWra import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppWrapper; import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppReleaseWrapper; import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppWrapper; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; -import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; +import io.entgra.application.mgt.core.config.ConfigurationManager; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.application.mgt.core.internal.DataHolder; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.core.dto.DeviceType; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ApplicationManagementUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationManagementUtil.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ApplicationManagementUtil.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationManagementUtil.java index db4e749e93..3f14309cd5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ApplicationManagementUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationManagementUtil.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -24,9 +24,9 @@ import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; -import org.wso2.carbon.device.application.mgt.core.config.Extension; -import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.application.mgt.core.config.ConfigurationManager; +import io.entgra.application.mgt.core.config.Extension; +import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; import java.lang.reflect.Constructor; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ApplicationMgtDatabaseCreator.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationMgtDatabaseCreator.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ApplicationMgtDatabaseCreator.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationMgtDatabaseCreator.java index 95f2119870..82678ada0a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ApplicationMgtDatabaseCreator.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationMgtDatabaseCreator.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ArtifactsParser.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ArtifactsParser.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ArtifactsParser.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ArtifactsParser.java index 32de0f8006..d9f0ad0234 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ArtifactsParser.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ArtifactsParser.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import com.dd.plist.BinaryPropertyListParser; import com.dd.plist.NSDictionary; @@ -27,7 +27,7 @@ import net.dongliu.apk.parser.bean.ApkMeta; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.io.IOUtils; -import org.wso2.carbon.device.application.mgt.core.exception.ParsingException; +import io.entgra.application.mgt.core.exception.ParsingException; import java.io.ByteArrayOutputStream; import java.io.File; @@ -38,7 +38,6 @@ import java.io.IOException; import java.io.InputStream; import java.nio.file.Files; import java.util.UUID; -import java.nio.file.Files; import java.util.zip.ZipEntry; import java.util.zip.ZipInputStream; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ConnectionManagerUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ConnectionManagerUtil.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ConnectionManagerUtil.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ConnectionManagerUtil.java index d8c0d66f3a..6fda7e1f7c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/ConnectionManagerUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ConnectionManagerUtil.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/Constants.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/Constants.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/Constants.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/Constants.java index 27498f77bb..3a5956ea0e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/Constants.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/Constants.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import org.wso2.carbon.utils.CarbonUtils; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/DAOUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/DAOUtil.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java index 4950fe3c6e..6e234fdc72 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/DAOUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import com.google.gson.Gson; import com.google.gson.reflect.TypeToken; @@ -30,7 +30,7 @@ import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import java.sql.PreparedStatement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/HelperUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/HelperUtil.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/HelperUtil.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/HelperUtil.java index fcc7698169..25fedae716 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/HelperUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/HelperUtil.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/JSONUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/JSONUtil.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/JSONUtil.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/JSONUtil.java index 34fedf190e..4e57a96c77 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/JSONUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/JSONUtil.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import org.json.JSONArray; import org.json.JSONException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/MDMAppConstants.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/MDMAppConstants.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/MDMAppConstants.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/MDMAppConstants.java index 0892f0909d..46a5f4fd8d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/MDMAppConstants.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/MDMAppConstants.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; public class MDMAppConstants { public static final String USER = "user"; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/OAuthUtils.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/OAuthUtils.java index 33a9d0706f..9c47a4bc1c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/OAuthUtils.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/OAuthUtils.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/StorageManagementUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/StorageManagementUtil.java rename to components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java index 97b36aba28..7c9e6560d5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/java/org/wso2/carbon/device/application/mgt/core/util/StorageManagementUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.util; +package io.entgra.application.mgt.core.util; import org.apache.commons.codec.binary.Base64; import org.apache.commons.codec.digest.DigestUtils; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/resources/META-INF/component.xml b/components/application-mgt/io.entgra.application.mgt.core/src/main/resources/META-INF/component.xml similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/resources/META-INF/component.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/main/resources/META-INF/component.xml index 2f5770f0bf..857df5b402 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/main/resources/META-INF/component.xml +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/resources/META-INF/component.xml @@ -20,7 +20,7 @@ platforms xml - org.wso2.carbon.device.application.mgt.core.deployer.PlatformDeployer + io.entgra.application.mgt.core.deployer.PlatformDeployer diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/ArtifactParserTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ArtifactParserTest.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/ArtifactParserTest.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ArtifactParserTest.java index f252a882b1..6fa36dab72 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/ArtifactParserTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ArtifactParserTest.java @@ -16,14 +16,14 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core; +package io.entgra.application.mgt.core; import com.dd.plist.NSDictionary; import net.dongliu.apk.parser.bean.ApkMeta; import org.testng.Assert; import org.testng.annotations.Test; -import org.wso2.carbon.device.application.mgt.core.exception.ParsingException; -import org.wso2.carbon.device.application.mgt.core.util.ArtifactsParser; +import io.entgra.application.mgt.core.exception.ParsingException; +import io.entgra.application.mgt.core.util.ArtifactsParser; import java.io.FileInputStream; import java.io.FileNotFoundException; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/BaseTestCase.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java similarity index 92% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/BaseTestCase.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java index c757724712..044cf84951 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/BaseTestCase.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core; +package io.entgra.application.mgt.core; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -26,13 +26,13 @@ import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.core.common.DataSourceConfig; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; -import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory; -import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; -import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager; -import org.wso2.carbon.device.application.mgt.core.util.ApplicationManagementUtil; -import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.application.mgt.core.common.DataSourceConfig; +import io.entgra.application.mgt.core.config.ConfigurationManager; +import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; +import io.entgra.application.mgt.core.internal.DataHolder; +import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.application.mgt.core.util.ApplicationManagementUtil; +import io.entgra.application.mgt.core.util.ConnectionManagerUtil; import org.wso2.carbon.device.mgt.core.authorization.DeviceAccessAuthorizationServiceImpl; import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; @@ -161,7 +161,7 @@ public abstract class BaseTestCase { if (file.exists()) { System.setProperty("carbon.home", file.getAbsolutePath()); } - file = new File("../resources/carbon-home"); + file = new File("io.entgra.application.mgt.core/src/test/resources/carbon-home"); if (file.exists()) { System.setProperty("carbon.home", file.getAbsolutePath()); } diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/ConfigurationTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ConfigurationTest.java similarity index 89% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/ConfigurationTest.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ConfigurationTest.java index b14958f105..dfcae3db61 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/ConfigurationTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ConfigurationTest.java @@ -15,12 +15,12 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core; +package io.entgra.application.mgt.core; import org.junit.Assert; import org.testng.annotations.Test; -import org.wso2.carbon.device.application.mgt.core.config.Configuration; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; +import io.entgra.application.mgt.core.config.Configuration; +import io.entgra.application.mgt.core.config.ConfigurationManager; import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/InitTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/InitTest.java similarity index 90% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/InitTest.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/InitTest.java index 8d207b555c..796af57966 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/InitTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/InitTest.java @@ -15,11 +15,11 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core; +package io.entgra.application.mgt.core; import org.testng.annotations.BeforeSuite; import org.wso2.carbon.device.application.mgt.common.exception.InvalidConfigurationException; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; +import io.entgra.application.mgt.core.config.ConfigurationManager; import java.io.File; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/LifeCycleStateManagerTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifeCycleStateManagerTest.java similarity index 91% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/LifeCycleStateManagerTest.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifeCycleStateManagerTest.java index 75a3d3d04d..3ba7e049e7 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/LifeCycleStateManagerTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifeCycleStateManagerTest.java @@ -15,9 +15,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core; +package io.entgra.application.mgt.core; -import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; import java.util.HashMap; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/LifecycleManagementTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifecycleManagementTest.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/LifecycleManagementTest.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifecycleManagementTest.java index a0b816489f..cceb7e7e7a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/LifecycleManagementTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifecycleManagementTest.java @@ -15,15 +15,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core; +package io.entgra.application.mgt.core; import org.junit.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; -import org.wso2.carbon.device.application.mgt.core.config.Configuration; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; -import org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager; +import io.entgra.application.mgt.core.config.Configuration; +import io.entgra.application.mgt.core.config.ConfigurationManager; +import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/StorageManagementUtilTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/StorageManagementUtilTest.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/StorageManagementUtilTest.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/StorageManagementUtilTest.java index 88d3fa4ecb..01409e46e7 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/StorageManagementUtilTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/StorageManagementUtilTest.java @@ -16,14 +16,14 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core; +package io.entgra.application.mgt.core; import org.junit.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException; -import org.wso2.carbon.device.application.mgt.core.util.StorageManagementUtil; +import io.entgra.application.mgt.core.util.StorageManagementUtil; import java.io.File; import java.io.FileInputStream; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/TestUtils.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/TestUtils.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/TestUtils.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/TestUtils.java index ceeb41902a..8ae7ba5e61 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/TestUtils.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/TestUtils.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core; +package io.entgra.application.mgt.core; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org/wso2/carbon/device/application/mgt/core/common/DataSourceConfig.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/common/DataSourceConfig.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org/wso2/carbon/device/application/mgt/core/common/DataSourceConfig.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/common/DataSourceConfig.java index 7b1f2c32bc..14aa81c13a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org/wso2/carbon/device/application/mgt/core/common/DataSourceConfig.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/common/DataSourceConfig.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.common; +package io.entgra.application.mgt.core.common; import javax.xml.bind.annotation.XmlElement; import javax.xml.bind.annotation.XmlRootElement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dao/ApplicationManagementDAOTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dao/ApplicationManagementDAOTest.java similarity index 88% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dao/ApplicationManagementDAOTest.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dao/ApplicationManagementDAOTest.java index bee26a37b8..106e1a08af 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dao/ApplicationManagementDAOTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dao/ApplicationManagementDAOTest.java @@ -15,19 +15,19 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dao; +package io.entgra.application.mgt.core.dao; import junit.framework.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import org.wso2.carbon.device.application.mgt.core.BaseTestCase; -import org.wso2.carbon.device.application.mgt.core.config.ConfigurationManager; -import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory; +import io.entgra.application.mgt.core.BaseTestCase; +import io.entgra.application.mgt.core.config.ConfigurationManager; +import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; import org.wso2.carbon.device.application.mgt.core.dto.ApplicationsDTO; import org.wso2.carbon.device.application.mgt.core.dto.DeviceTypeCreator; -import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.application.mgt.core.util.ConnectionManagerUtil; import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOFactory; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dto/ApplicationsDTO.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/ApplicationsDTO.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dto/ApplicationsDTO.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/ApplicationsDTO.java index 74f598a831..2d0c0fbd2f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dto/ApplicationsDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/ApplicationsDTO.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dto; +package io.entgra.application.mgt.core.dto; import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dto/DeviceTypeCreator.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/DeviceTypeCreator.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dto/DeviceTypeCreator.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/DeviceTypeCreator.java index 3ecd1aa675..d1a862afec 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/dto/DeviceTypeCreator.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/DeviceTypeCreator.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.core.dto; +package io.entgra.application.mgt.core.dto; import org.wso2.carbon.device.mgt.core.dto.DeviceType; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/management/ApplicationManagementTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/management/ApplicationManagementTest.java rename to components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java index 4ebdf3ce6c..fb8393740a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/java/org.wso2.carbon.device.application.mgt.core/management/ApplicationManagementTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.core.management; +package io.entgra.application.mgt.core.management; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; @@ -33,13 +33,13 @@ import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager import org.wso2.carbon.device.application.mgt.common.wrapper.EntAppReleaseWrapper; import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationUpdateWrapper; import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper; -import org.wso2.carbon.device.application.mgt.core.BaseTestCase; -import org.wso2.carbon.device.application.mgt.core.dao.ApplicationDAO; -import org.wso2.carbon.device.application.mgt.core.dao.common.ApplicationManagementDAOFactory; +import io.entgra.application.mgt.core.BaseTestCase; +import io.entgra.application.mgt.core.dao.ApplicationDAO; +import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; import org.wso2.carbon.device.application.mgt.core.dto.ApplicationsDTO; -import org.wso2.carbon.device.application.mgt.core.impl.ApplicationManagerImpl; -import org.wso2.carbon.device.application.mgt.core.internal.DataHolder; -import org.wso2.carbon.device.application.mgt.core.util.ConnectionManagerUtil; +import io.entgra.application.mgt.core.impl.ApplicationManagerImpl; +import io.entgra.application.mgt.core.internal.DataHolder; +import io.entgra.application.mgt.core.util.ConnectionManagerUtil; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.core.dto.DeviceType; import org.wso2.carbon.device.mgt.core.dto.DeviceTypeVersion; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/Platform.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/Platform.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/Platform.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/Platform.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/application-mgt.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/application-mgt.xml similarity index 91% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/application-mgt.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/application-mgt.xml index 60a8b0448b..d80e94c223 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/application-mgt.xml +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/application-mgt.xml @@ -23,19 +23,19 @@ - org.wso2.carbon.device.application.mgt.core.impl.ApplicationManagerImpl + io.entgra.application.mgt.core.impl.ApplicationManagerImpl - org.wso2.carbon.device.application.mgt.core.impl.ReviewManagerImpl + io.entgra.application.mgt.core.impl.ReviewManagerImpl - org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager + io.entgra.application.mgt.core.lifecycle.LifecycleStateManager - org.wso2.carbon.device.application.mgt.core.impl.SubscriptionManagerImpl + io.entgra.application.mgt.core.impl.SubscriptionManagerImpl - org.wso2.carbon.device.application.mgt.core.impl.ApplicationStorageManagerImpl + io.entgra.application.mgt.core.impl.ApplicationStorageManagerImpl repository/resources/apps/ 6 diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/dbscripts/h2.sql b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/dbscripts/h2.sql similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/dbscripts/h2.sql rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/dbscripts/h2.sql diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml similarity index 91% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml index a94190bda4..aafbdb712e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/application-mgt.xml @@ -23,19 +23,19 @@ - org.wso2.carbon.device.application.mgt.core.impl.ApplicationManagerImpl + io.entgra.application.mgt.core.impl.ApplicationManagerImpl - org.wso2.carbon.device.application.mgt.core.impl.ReviewManagerImpl + io.entgra.application.mgt.core.impl.ReviewManagerImpl - org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager + io.entgra.application.mgt.core.lifecycle.LifecycleStateManager - org.wso2.carbon.device.application.mgt.core.impl.SubscriptionManagerImpl + io.entgra.application.mgt.core.impl.SubscriptionManagerImpl - org.wso2.carbon.device.application.mgt.core.impl.ApplicationStorageManagerImpl + io.entgra.application.mgt.core.impl.ApplicationStorageManagerImpl /tmp/apps/ 6 diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/axis2.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/axis2.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/axis2.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/axis2.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/axis2_client.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/axis2_client.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/axis2_client.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/axis2_client.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/tenant-axis2.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/tenant-axis2.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/tenant-axis2.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/axis2/tenant-axis2.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/carbon.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/carbon.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/carbon.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/carbon.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/datasources/master-datasources.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/bundle-config/README.txt b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/bundle-config/README.txt similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/bundle-config/README.txt rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/bundle-config/README.txt diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/carboncontext-osgi-services.properties b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/carboncontext-osgi-services.properties similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/carboncontext-osgi-services.properties rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/carboncontext-osgi-services.properties diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/config-validation.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/config-validation.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/config-validation.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/config-validation.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/jmx.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/jmx.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/jmx.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/jmx.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/launch.ini b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/launch.ini similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/launch.ini rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/launch.ini diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/logging-bridge.properties b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/logging-bridge.properties similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/logging-bridge.properties rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/logging-bridge.properties diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/mime.mappings b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/mime.mappings similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/mime.mappings rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/mime.mappings diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/mime.types b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/mime.types similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/mime.types rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/mime.types diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/osgi-debug.options b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/osgi-debug.options similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/osgi-debug.options rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/osgi-debug.options diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/etc/tasks-config.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/log4j.properties b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/log4j.properties similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/log4j.properties rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/log4j.properties diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/registry.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/registry.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/registry.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/registry.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/security/authenticators.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/security/authenticators.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/security/authenticators.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/security/authenticators.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/carbon/META-INF/context.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/carbon/META-INF/context.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/carbon/META-INF/context.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/carbon/META-INF/context.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/carbon/WEB-INF/web.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/carbon/WEB-INF/web.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/carbon/WEB-INF/web.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/carbon/WEB-INF/web.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/catalina-server.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/catalina-server.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/catalina-server.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/catalina-server.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/tomcat-users.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/tomcat-users.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/tomcat-users.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/tomcat-users.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/web.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/web.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/web.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/tomcat/web.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/user-mgt.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/user-mgt.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/carbon-home/repository/conf/user-mgt.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/carbon-home/repository/conf/user-mgt.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/datasource/data-source-config.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/datasource/data-source-config.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/datasource/data-source-config.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/datasource/data-source-config.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/h2.sql b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/h2.sql similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/h2.sql rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/h2.sql diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/log4j.properties b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/log4j.properties similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/log4j.properties rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/log4j.properties diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/banner1.jpg b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/banner1.jpg similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/banner1.jpg rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/banner1.jpg diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/icon.png b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/icon.png similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/icon.png rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/icon.png diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/sample.apk b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/sample.apk similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/sample.apk rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/sample.apk diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/shot1.png b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/shot1.png similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/shot1.png rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/shot1.png diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/shot2.png b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/shot2.png similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/shot2.png rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/shot2.png diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/shot3.png b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/shot3.png similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app1/shot3.png rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app1/shot3.png diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/banner1.jpg b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/banner1.jpg similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/banner1.jpg rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/banner1.jpg diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/icon.png b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/icon.png similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/icon.png rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/icon.png diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/sample_4.0.6.apk b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/sample_4.0.6.apk similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/sample_4.0.6.apk rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/sample_4.0.6.apk diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/shot1.png b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/shot1.png similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/shot1.png rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/shot1.png diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/shot2.png b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/shot2.png similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/shot2.png rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/shot2.png diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/shot3.png b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/shot3.png similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/samples/app2/shot3.png rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/samples/app2/shot3.png diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/testng.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/testng.xml similarity index 53% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/testng.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/testng.xml index b9fad1fe6a..e8b627e825 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/testng.xml +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/testng.xml @@ -22,14 +22,14 @@ - - - - - - - - + + + + + + + + \ No newline at end of file diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/user-test/user-mgt-registry-test.xml b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/user-test/user-mgt-registry-test.xml similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/user-test/user-mgt-registry-test.xml rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/user-test/user-mgt-registry-test.xml diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/util/app-debug.apk b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/util/app-debug.apk similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/util/app-debug.apk rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/util/app-debug.apk diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/util/iOSMDMAgent.ipa b/components/application-mgt/io.entgra.application.mgt.core/src/test/resources/util/iOSMDMAgent.ipa similarity index 100% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.core/src/test/resources/util/iOSMDMAgent.ipa rename to components/application-mgt/io.entgra.application.mgt.core/src/test/resources/util/iOSMDMAgent.ipa diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java index 0587b0cdd7..6bd5941447 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java @@ -38,15 +38,15 @@ import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppReleaseWra import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppWrapper; import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppReleaseWrapper; import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppWrapper; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; -import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; -import org.wso2.carbon.device.application.mgt.core.util.Constants; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.ForbiddenException; +import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.util.Constants; import io.entgra.application.mgt.publisher.api.services.ApplicationManagementPublisherAPI; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.exception.NotFoundException; import java.io.IOException; import java.io.InputStream; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java index 370f57e57e..fd37ba0efb 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java @@ -21,10 +21,10 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.ForbiddenException; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.publisher.api.services.admin.ApplicationManagementPublisherAdminAPI; import javax.ws.rs.Consumes; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java index f0af7225b9..2e5da54e34 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java @@ -24,8 +24,8 @@ import org.wso2.carbon.device.application.mgt.common.Rating; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.publisher.api.services.admin.ReviewManagementPublisherAdminAPI; import javax.ws.rs.DefaultValue; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java index 808c67b287..c646b32d9e 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java @@ -23,10 +23,10 @@ import org.wso2.carbon.device.application.mgt.common.Filter; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.response.Application; import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.exception.UnexpectedServerErrorException; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; +import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.store.api.services.ApplicationManagementAPI; import javax.validation.Valid; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java index 7f5a8b9195..762b126664 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java @@ -25,14 +25,14 @@ import org.wso2.carbon.device.application.mgt.common.Rating; import org.wso2.carbon.device.application.mgt.common.response.Review; import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; import org.wso2.carbon.device.application.mgt.common.wrapper.ReviewWrapper; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.ForbiddenException; +import io.entgra.application.mgt.core.exception.NotFoundException; import io.entgra.application.mgt.store.api.services.ReviewManagementAPI; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.util.APIUtil; import javax.ws.rs.DefaultValue; import javax.ws.rs.Path; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java index b045b8bda3..80ab0ec49e 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java @@ -27,18 +27,18 @@ import org.wso2.carbon.device.application.mgt.common.SubAction; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.exception.ApplicationOperationTaskException; +import io.entgra.application.mgt.core.exception.ApplicationOperationTaskException; import org.wso2.carbon.device.application.mgt.common.DeviceList; import org.wso2.carbon.device.application.mgt.common.BasicUserInfo; import org.wso2.carbon.device.application.mgt.common.BasicUserInfoList; import org.wso2.carbon.device.application.mgt.common.RoleList; import org.wso2.carbon.device.application.mgt.common.DeviceGroupList; import io.entgra.application.mgt.store.api.services.impl.util.RequestValidationUtil; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.ForbiddenException; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.task.ScheduledAppSubscriptionTaskManager; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.ForbiddenException; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.task.ScheduledAppSubscriptionTaskManager; +import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.store.api.services.SubscriptionManagementAPI; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java index 9dc8aec9fc..0d62ba9d16 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java @@ -21,8 +21,8 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.store.api.services.admin.ReviewManagementStoreAdminAPI; import javax.ws.rs.Consumes; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java index 17cf3511f9..c65cd02826 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java @@ -23,9 +23,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; -import org.wso2.carbon.device.application.mgt.core.exception.NotFoundException; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.NotFoundException; +import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.store.api.services.admin.SubscriptionManagementAdminAPI; import io.entgra.application.mgt.store.api.services.impl.util.RequestValidationUtil; import org.wso2.carbon.device.mgt.common.PaginationRequest; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java index 4061bcd965..aeff5fe9f8 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java @@ -20,7 +20,7 @@ package io.entgra.application.mgt.store.api.services.impl.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.core.exception.BadRequestException; +import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.store.api.util.Constants; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java index 643f3c0ece..88fe81fcaa 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java +++ b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java @@ -25,7 +25,7 @@ import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; -import org.wso2.carbon.device.application.mgt.core.util.APIUtil; +import io.entgra.application.mgt.core.util.APIUtil; @PowerMockIgnore("javax.ws.rs.*") @SuppressStaticInitializationFor({ diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index c0a5a4a6b4..b28c1a31cc 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -47,7 +47,7 @@ import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; -import org.wso2.carbon.device.application.mgt.core.util.HelperUtil; +import io.entgra.application.mgt.core.util.HelperUtil; import org.wso2.carbon.device.mgt.common.DeviceFilters; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; import org.wso2.carbon.device.mgt.common.OperationLogFilters; diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml index d0d02a058a..fa4ce1eb53 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml +++ b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml @@ -23,19 +23,19 @@ - org.wso2.carbon.device.application.mgt.core.impl.ApplicationManagerImpl + io.entgra.application.mgt.core.impl.ApplicationManagerImpl - org.wso2.carbon.device.application.mgt.core.impl.ReviewManagerImpl + io.entgra.application.mgt.core.impl.ReviewManagerImpl - org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager + io.entgra.application.mgt.core.lifecycle.LifecycleStateManager - org.wso2.carbon.device.application.mgt.core.impl.SubscriptionManagerImpl + io.entgra.application.mgt.core.impl.SubscriptionManagerImpl - org.wso2.carbon.device.application.mgt.core.impl.ApplicationStorageManagerImpl + io.entgra.application.mgt.core.impl.ApplicationStorageManagerImpl repository/resources/apps/ 6 From 8a07dad38c8b351cf8b6be5b6caccf975d839633 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 16:56:19 +0530 Subject: [PATCH 38/54] package name change - appmgt common --- .../impl/ArtifactDownloadAPIImpl.java | 6 +- .../pom.xml | 8 +-- .../mgt/common/AppLifecycleState.java | 2 +- .../application/mgt/common/AppOperation.java | 4 +- .../mgt/common/ApplicationArtifact.java | 2 +- .../common/ApplicationInstallResponse.java | 2 +- .../mgt/common/ApplicationInstaller.java | 2 +- .../mgt/common/ApplicationList.java | 6 +- .../common/ApplicationSubscriptionInfo.java | 2 +- .../common/ApplicationSubscriptionType.java | 2 +- .../mgt/common/ApplicationType.java | 2 +- .../mgt/common/BasePaginatedResult.java | 2 +- .../application/mgt/common/BasicUserInfo.java | 2 +- .../mgt/common/BasicUserInfoList.java | 2 +- .../mgt/common/DeviceGroupList.java | 2 +- .../application/mgt/common/DeviceList.java | 2 +- .../mgt/common/DeviceSubscriptionData.java | 2 +- .../application/mgt/common/DeviceTypes.java | 2 +- .../common/EnterpriseInstallationDetails.java | 2 +- .../application/mgt/common/ErrorListItem.java | 2 +- .../application/mgt/common/ErrorResponse.java | 2 +- .../mgt/common/ExecutionStatus.java | 2 +- .../application/mgt/common/Filter.java | 2 +- .../application/mgt/common/ImageArtifact.java | 2 +- .../mgt/common/InstallationDetails.java | 2 +- .../mgt/common/LifecycleChanger.java | 2 +- .../mgt/common/LifecycleState.java | 2 +- .../application/mgt/common/Pagination.java | 2 +- .../mgt/common/PaginationRequest.java | 2 +- .../mgt/common/PaginationResult.java | 2 +- .../application/mgt/common/Rating.java | 2 +- .../application/mgt/common/ReviewNode.java | 2 +- .../application/mgt/common/RoleList.java | 2 +- .../application/mgt/common/SortingOrder.java | 2 +- .../application/mgt/common/SubAction.java | 2 +- .../mgt/common/SubscribingDeviceIdHolder.java | 2 +- .../mgt/common/SubscriptionType.java | 2 +- .../entgra}/application/mgt/common/User.java | 2 +- .../mgt/common/config/ErrorCallback.java | 2 +- .../mgt/common/config/LifecycleState.java | 2 +- .../mgt/common/config/MDMConfig.java | 2 +- .../common/config/RatingConfiguration.java | 2 +- .../common/dto/ApiRegistrationProfile.java | 2 +- .../mgt/common/dto/ApplicationDTO.java | 2 +- .../mgt/common/dto/ApplicationPolicyDTO.java | 2 +- .../mgt/common/dto/ApplicationReleaseDTO.java | 2 +- .../mgt/common/dto/CategoryDTO.java | 2 +- .../mgt/common/dto/DeviceSubscriptionDTO.java | 2 +- .../mgt/common/dto/GroupSubscriptionDTO.java | 2 +- .../application/mgt/common/dto/ReviewDTO.java | 2 +- .../mgt/common/dto/RoleSubscriptionDTO.java | 2 +- .../common/dto/ScheduledSubscriptionDTO.java | 9 ++- .../application/mgt/common/dto/TagDTO.java | 2 +- .../mgt/common/dto/UserSubscriptionDTO.java | 2 +- ...pplicationCategoryManagementException.java | 2 +- .../ApplicationManagementException.java | 2 +- ...ApplicationStorageManagementException.java | 2 +- .../exception/DBConnectionException.java | 2 +- .../exception/DeviceConnectorException.java | 2 +- .../IllegalTransactionStateException.java | 2 +- .../InvalidConfigurationException.java | 2 +- .../LifecycleManagementException.java | 2 +- .../exception/RequestValidatingException.java | 2 +- .../ResourceManagementException.java | 2 +- .../ReviewDoesNotExistException.java | 2 +- .../exception/ReviewManagementException.java | 2 +- .../SubscriptionManagementException.java | 2 +- .../TransactionManagementException.java | 2 +- .../UnsupportedDatabaseEngineException.java | 2 +- .../VisibilityManagementException.java | 2 +- .../mgt/common/response/Application.java | 2 +- .../common/response/ApplicationRelease.java | 2 +- .../mgt/common/response/Category.java | 2 +- .../mgt/common/response/Review.java | 2 +- .../application/mgt/common/response/Tag.java | 2 +- .../common/services/ApplicationManager.java | 44 +++++++-------- .../services/ApplicationStorageManager.java | 12 ++-- .../mgt/common/services/AppmDataHandler.java | 8 +-- .../mgt/common/services/DeviceConnector.java | 6 +- .../mgt/common/services/ReviewManager.java | 16 +++--- .../common/services/SubscriptionManager.java | 12 ++-- .../wrapper/ApplicationUpdateWrapper.java | 2 +- .../common/wrapper/ApplicationWrapper.java | 2 +- .../wrapper/CustomAppReleaseWrapper.java | 2 +- .../mgt/common/wrapper/CustomAppWrapper.java | 2 +- .../common/wrapper/EntAppReleaseWrapper.java | 2 +- .../wrapper/PublicAppReleaseWrapper.java | 2 +- .../mgt/common/wrapper/PublicAppWrapper.java | 2 +- .../mgt/common/wrapper/ReviewWrapper.java | 2 +- .../common/wrapper/WebAppReleaseWrapper.java | 2 +- .../mgt/common/wrapper/WebAppWrapper.java | 2 +- .../mgt/core/config/Configuration.java | 6 +- .../mgt/core/config/ConfigurationManager.java | 4 +- .../mgt/core/dao/ApplicationDAO.java | 6 +- .../mgt/core/dao/ApplicationReleaseDAO.java | 2 +- .../application/mgt/core/dao/ReviewDAO.java | 4 +- .../mgt/core/dao/SubscriptionDAO.java | 8 +-- .../ApplicationManagementDAOFactory.java | 2 +- .../mgt/core/dao/impl/AbstractDAOImpl.java | 2 +- .../GenericApplicationDAOImpl.java | 10 ++-- .../application/OracleApplicationDAOImpl.java | 4 +- .../SQLServerApplicationDAOImpl.java | 4 +- .../GenericApplicationReleaseDAOImpl.java | 4 +- .../OracleApplicationReleaseDAOImpl.java | 2 +- .../SQLServerApplicationReleaseDAOImpl.java | 2 +- .../GenericLifecycleStateDAOImpl.java | 2 +- .../dao/impl/review/GenericReviewDAOImpl.java | 4 +- .../dao/impl/review/OracleReviewDAOImpl.java | 4 +- .../impl/review/SQLServerReviewDAOImpl.java | 4 +- .../GenericSubscriptionDAOImpl.java | 6 +- .../OracleSubscriptionDAOImpl.java | 2 +- .../SQLServerSubscriptionDAOImpl.java | 2 +- .../visibility/GenericVisibilityDAOImpl.java | 2 +- .../core/exception/BadRequestException.java | 2 +- .../core/exception/ForbiddenException.java | 2 +- .../mgt/core/exception/NotFoundException.java | 2 +- .../ReviewManagementDAOException.java | 2 +- .../SubscriptionManagementDAOException.java | 2 +- .../UnexpectedServerErrorException.java | 2 +- .../core/exception/ValidationException.java | 2 +- .../VisibilityManagementDAOException.java | 2 +- .../mgt/core/impl/ApplicationManagerImpl.java | 56 +++++++++---------- .../impl/ApplicationStorageManagerImpl.java | 8 +-- .../mgt/core/impl/AppmDataHandlerImpl.java | 12 ++-- .../mgt/core/impl/ReviewManagerImpl.java | 20 +++---- .../core/impl/SubscriptionManagerImpl.java | 24 ++++---- ...ApplicationManagementServiceComponent.java | 12 ++-- .../mgt/core/internal/DataHolder.java | 10 ++-- .../core/lifecycle/LifecycleStateManager.java | 4 +- .../ScheduledAppSubscriptionCleanupTask.java | 4 +- .../task/ScheduledAppSubscriptionTask.java | 8 +-- .../ScheduledAppSubscriptionTaskManager.java | 6 +- .../application/mgt/core/util/APIUtil.java | 30 +++++----- .../core/util/ApplicationManagementUtil.java | 10 ++-- .../mgt/core/util/ConnectionManagerUtil.java | 6 +- .../application/mgt/core/util/DAOUtil.java | 10 ++-- .../application/mgt/core/util/OAuthUtils.java | 2 +- .../mgt/core/util/StorageManagementUtil.java | 4 +- .../application/mgt/core/BaseTestCase.java | 4 +- .../mgt/core/ConfigurationTest.java | 2 +- .../entgra/application/mgt/core/InitTest.java | 2 +- .../mgt/core/LifeCycleStateManagerTest.java | 2 +- .../mgt/core/LifecycleManagementTest.java | 4 +- .../mgt/core/StorageManagementUtilTest.java | 2 +- .../mgt/core/dto/ApplicationsDTO.java | 2 +- .../management/ApplicationManagementTest.java | 22 ++++---- .../ApplicationManagementPublisherAPI.java | 24 ++++---- ...ApplicationManagementPublisherAPIImpl.java | 36 ++++++------ ...cationManagementPublisherAdminAPIImpl.java | 4 +- ...ReviewManagementPublisherAdminAPIImpl.java | 6 +- .../services/ApplicationManagementAPI.java | 2 +- .../api/services/ReviewManagementAPI.java | 4 +- .../impl/ApplicationManagementAPIImpl.java | 6 +- .../impl/ReviewManagementAPIImpl.java | 10 ++-- .../impl/SubscriptionManagementAPIImpl.java | 4 +- .../ReviewManagementStoreAdminAPIImpl.java | 6 +- .../SubscriptionManagementAdminAPIImpl.java | 4 +- .../api/services/CommentMgtTestHelper.java | 2 +- .../api/services/ReviewManagementAPITest.java | 2 +- .../pom.xml | 10 ++-- .../PullNotificationSubscriberImpl.java | 6 +- .../internal/PullNotificationDataHolder.java | 2 +- .../PullNotificationServiceComponent.java | 2 +- .../pom.xml | 2 +- .../impl/DeviceManagementServiceImpl.java | 6 +- .../mgt/jaxrs/util/DeviceMgtAPIUtils.java | 2 +- 166 files changed, 398 insertions(+), 401 deletions(-) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common => io.entgra.application.mgt.common}/pom.xml (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/AppLifecycleState.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/AppOperation.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ApplicationArtifact.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ApplicationInstallResponse.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ApplicationInstaller.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ApplicationList.java (86%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ApplicationSubscriptionInfo.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ApplicationSubscriptionType.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ApplicationType.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/BasePaginatedResult.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/BasicUserInfo.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/BasicUserInfoList.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/DeviceGroupList.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/DeviceList.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/DeviceSubscriptionData.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/DeviceTypes.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/EnterpriseInstallationDetails.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ErrorListItem.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ErrorResponse.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ExecutionStatus.java (90%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/Filter.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ImageArtifact.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/InstallationDetails.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/LifecycleChanger.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/LifecycleState.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/Pagination.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/PaginationRequest.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/PaginationResult.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/Rating.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/ReviewNode.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/RoleList.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/SortingOrder.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/SubAction.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/SubscribingDeviceIdHolder.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/SubscriptionType.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/User.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/config/ErrorCallback.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/config/LifecycleState.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/config/MDMConfig.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/config/RatingConfiguration.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/ApiRegistrationProfile.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/ApplicationDTO.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/ApplicationPolicyDTO.java (96%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/ApplicationReleaseDTO.java (99%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/CategoryDTO.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/DeviceSubscriptionDTO.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/GroupSubscriptionDTO.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/ReviewDTO.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/RoleSubscriptionDTO.java (97%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/ScheduledSubscriptionDTO.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/TagDTO.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/dto/UserSubscriptionDTO.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/ApplicationCategoryManagementException.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/ApplicationManagementException.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/ApplicationStorageManagementException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/DBConnectionException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/DeviceConnectorException.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/IllegalTransactionStateException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/InvalidConfigurationException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/LifecycleManagementException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/RequestValidatingException.java (93%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/ResourceManagementException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/ReviewDoesNotExistException.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/ReviewManagementException.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/SubscriptionManagementException.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/TransactionManagementException.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/UnsupportedDatabaseEngineException.java (95%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/exception/VisibilityManagementException.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/response/Application.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/response/ApplicationRelease.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/response/Category.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/response/Review.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/response/Tag.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/services/ApplicationManager.java (88%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/services/ApplicationStorageManager.java (91%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/services/AppmDataHandler.java (84%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/services/DeviceConnector.java (87%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/services/ReviewManager.java (85%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/services/SubscriptionManager.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/ApplicationUpdateWrapper.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/ApplicationWrapper.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/CustomAppReleaseWrapper.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/CustomAppWrapper.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/EntAppReleaseWrapper.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/PublicAppReleaseWrapper.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/PublicAppWrapper.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/ReviewWrapper.java (94%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/WebAppReleaseWrapper.java (98%) rename components/application-mgt/{org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device => io.entgra.application.mgt.common/src/main/java/io/entgra}/application/mgt/common/wrapper/WebAppWrapper.java (98%) diff --git a/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java index 4d4ea30cd2..51a5074e13 100644 --- a/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/impl/ArtifactDownloadAPIImpl.java @@ -21,9 +21,9 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import io.entgra.application.mgt.api.services.ArtifactDownloadAPI; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.services.AppmDataHandler; import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.exception.NotFoundException; import io.entgra.application.mgt.core.util.APIUtil; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml b/components/application-mgt/io.entgra.application.mgt.common/pom.xml similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml rename to components/application-mgt/io.entgra.application.mgt.common/pom.xml index 9bc4a1dcf4..877c259b6f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.common/pom.xml @@ -26,10 +26,10 @@ 4.0.0 - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common bundle - WSO2 Carbon - Application Management Common - WSO2 Carbon - Application Management Common + Entgra - Application Management Common + Entgra - Application Management Common https://entgra.io @@ -58,7 +58,7 @@ javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", - org.wso2.carbon.device.application.mgt.common.* + io.entgra.application.mgt.common.* diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/AppLifecycleState.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/AppLifecycleState.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/AppLifecycleState.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/AppLifecycleState.java index d41de093e2..7c068158d2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/AppLifecycleState.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/AppLifecycleState.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; /** diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/AppOperation.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/AppOperation.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/AppOperation.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/AppOperation.java index a7fe3c9ced..100042f892 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/AppOperation.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/AppOperation.java @@ -14,9 +14,9 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.ApplicationDTO; public class AppOperation { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationArtifact.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationArtifact.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationArtifact.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationArtifact.java index c71a468957..1485ef0e11 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationArtifact.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationArtifact.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import java.io.InputStream; import java.util.Map; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationInstallResponse.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationInstallResponse.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationInstallResponse.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationInstallResponse.java index 06b0817ac1..bd77ad4079 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationInstallResponse.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationInstallResponse.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationInstaller.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationInstaller.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationInstaller.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationInstaller.java index dde6722d85..78876f0d43 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationInstaller.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationInstaller.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; public class ApplicationInstaller { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationList.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationList.java similarity index 86% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationList.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationList.java index e34c55c464..9d725dd6b5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationList.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationList.java @@ -14,10 +14,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.response.Application; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.response.Application; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationSubscriptionInfo.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationSubscriptionInfo.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationSubscriptionInfo.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationSubscriptionInfo.java index 648e8585f9..d8c0736f65 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationSubscriptionInfo.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationSubscriptionInfo.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationSubscriptionType.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationSubscriptionType.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationSubscriptionType.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationSubscriptionType.java index 5628c9d96d..9dadc7ebd7 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationSubscriptionType.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationSubscriptionType.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; /** * Possible Subscription Type of the application. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationType.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationType.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationType.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationType.java index 8964ec60e7..54d091aeb1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ApplicationType.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ApplicationType.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; /** diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/BasePaginatedResult.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/BasePaginatedResult.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/BasePaginatedResult.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/BasePaginatedResult.java index b2445fcf7f..b32f6c553e 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/BasePaginatedResult.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/BasePaginatedResult.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/BasicUserInfo.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/BasicUserInfo.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/BasicUserInfo.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/BasicUserInfo.java index 26e73d2dc1..ece8ad6867 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/BasicUserInfo.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/BasicUserInfo.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/BasicUserInfoList.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/BasicUserInfoList.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/BasicUserInfoList.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/BasicUserInfoList.java index 3f4762e3cb..e7f0747298 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/BasicUserInfoList.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/BasicUserInfoList.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceGroupList.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceGroupList.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceGroupList.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceGroupList.java index 698d29ee44..bb7daca91a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceGroupList.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceGroupList.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceList.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceList.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceList.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceList.java index 94f81e153c..692a3a8aed 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceList.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceList.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceSubscriptionData.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceSubscriptionData.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceSubscriptionData.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceSubscriptionData.java index 550c1c98fc..d769a8b139 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceSubscriptionData.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceSubscriptionData.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import org.wso2.carbon.device.mgt.common.Device; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceTypes.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceTypes.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceTypes.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceTypes.java index 7fa8a02062..fed66c582c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/DeviceTypes.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/DeviceTypes.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; public enum DeviceTypes { ANDROID, IOS, WINDOWS diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/EnterpriseInstallationDetails.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/EnterpriseInstallationDetails.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/EnterpriseInstallationDetails.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/EnterpriseInstallationDetails.java index e045fecd78..49986c11bd 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/EnterpriseInstallationDetails.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/EnterpriseInstallationDetails.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ErrorListItem.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ErrorListItem.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ErrorListItem.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ErrorListItem.java index 8a5e2e2f60..143c1374ff 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ErrorListItem.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ErrorListItem.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ErrorResponse.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ErrorResponse.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ErrorResponse.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ErrorResponse.java index 58c67bfc3a..6a7673bba8 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ErrorResponse.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ErrorResponse.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ExecutionStatus.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ExecutionStatus.java similarity index 90% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ExecutionStatus.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ExecutionStatus.java index c24a65593f..dc4a8f2197 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ExecutionStatus.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ExecutionStatus.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; public enum ExecutionStatus { PENDING, EXECUTED, FAILED diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Filter.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/Filter.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Filter.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/Filter.java index 6e45015c41..6ce0f2b2d3 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Filter.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/Filter.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ImageArtifact.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ImageArtifact.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ImageArtifact.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ImageArtifact.java index 30eed0d513..e885ffbcf8 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ImageArtifact.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ImageArtifact.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; /** * This represents a image artifact of a application. Icon, Screen-shot or Banner. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/InstallationDetails.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/InstallationDetails.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/InstallationDetails.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/InstallationDetails.java index d15dd4a7c5..22ade53450 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/InstallationDetails.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/InstallationDetails.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import io.swagger.annotations.ApiModelProperty; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/LifecycleChanger.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/LifecycleChanger.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/LifecycleChanger.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/LifecycleChanger.java index abb39642f9..2709823ddd 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/LifecycleChanger.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/LifecycleChanger.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; public class LifecycleChanger { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/LifecycleState.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/LifecycleState.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/LifecycleState.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/LifecycleState.java index 3021b6fd9b..78ad768912 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/LifecycleState.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/LifecycleState.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import java.sql.Timestamp; import io.swagger.annotations.ApiModel; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Pagination.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/Pagination.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Pagination.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/Pagination.java index 01a2205bf7..c2179dcd70 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Pagination.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/Pagination.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; /** * This class represents the pagination details that will be used when fetching application details from database. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/PaginationRequest.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/PaginationRequest.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/PaginationRequest.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/PaginationRequest.java index 80e0f1c603..794ec1a2a1 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/PaginationRequest.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/PaginationRequest.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; /** * This class holds required parameters for a querying a paginated device response. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/PaginationResult.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/PaginationResult.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/PaginationResult.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/PaginationResult.java index 3f90066264..57cbafb884 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/PaginationResult.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/PaginationResult.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Rating.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/Rating.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Rating.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/Rating.java index 8ac2414668..5fbb1a1e39 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/Rating.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/Rating.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import java.util.TreeMap; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ReviewNode.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ReviewNode.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ReviewNode.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ReviewNode.java index c3c5c75026..f8f45ef6ef 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/ReviewNode.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/ReviewNode.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import java.util.ArrayList; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/RoleList.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/RoleList.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/RoleList.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/RoleList.java index 183f196c8c..fadca3462c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/RoleList.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/RoleList.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import com.fasterxml.jackson.annotation.JsonProperty; import io.swagger.annotations.ApiModel; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SortingOrder.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SortingOrder.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SortingOrder.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SortingOrder.java index f0c19bdffc..2479c97046 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SortingOrder.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SortingOrder.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; /** diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SubAction.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SubAction.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SubAction.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SubAction.java index fde06081ef..1c3bd64ff9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SubAction.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SubAction.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; public enum SubAction { INSTALL, UNINSTALL diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SubscribingDeviceIdHolder.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SubscribingDeviceIdHolder.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SubscribingDeviceIdHolder.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SubscribingDeviceIdHolder.java index 0dd283b3fe..be3051a314 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SubscribingDeviceIdHolder.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SubscribingDeviceIdHolder.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SubscriptionType.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SubscriptionType.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SubscriptionType.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SubscriptionType.java index 08af098d8f..048c83b721 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/SubscriptionType.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/SubscriptionType.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; public enum SubscriptionType { USER, ROLE, GROUP, DEVICE diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/User.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/User.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/User.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/User.java index 780a066b17..3e0b201126 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/User.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/User.java @@ -15,7 +15,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common; +package io.entgra.application.mgt.common; /** * Represents an user. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/ErrorCallback.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/ErrorCallback.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/ErrorCallback.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/ErrorCallback.java index 660c6c4b09..83a5810dd9 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/ErrorCallback.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/ErrorCallback.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.config; +package io.entgra.application.mgt.common.config; import javax.xml.bind.annotation.XmlElement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/LifecycleState.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/LifecycleState.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/LifecycleState.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/LifecycleState.java index f94f3b3690..8f8122b437 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/LifecycleState.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/LifecycleState.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.config; +package io.entgra.application.mgt.common.config; import javax.xml.bind.annotation.XmlAttribute; import javax.xml.bind.annotation.XmlElement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/MDMConfig.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/MDMConfig.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/MDMConfig.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/MDMConfig.java index 1f478f8481..1c6c47330d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/MDMConfig.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/MDMConfig.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.config; +package io.entgra.application.mgt.common.config; import javax.xml.bind.annotation.XmlElement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/RatingConfiguration.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/RatingConfiguration.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/RatingConfiguration.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/RatingConfiguration.java index 44892c462f..f821d7c996 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/config/RatingConfiguration.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/config/RatingConfiguration.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.config; +package io.entgra.application.mgt.common.config; import javax.xml.bind.annotation.XmlElement; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApiRegistrationProfile.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApiRegistrationProfile.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApiRegistrationProfile.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApiRegistrationProfile.java index a117584bd8..6d44f35478 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApiRegistrationProfile.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApiRegistrationProfile.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; public class ApiRegistrationProfile { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApplicationDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApplicationDTO.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApplicationDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApplicationDTO.java index 57ec6991f9..48bd1c6822 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApplicationDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApplicationDTO.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; import io.swagger.annotations.ApiModel; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApplicationPolicyDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApplicationPolicyDTO.java similarity index 96% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApplicationPolicyDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApplicationPolicyDTO.java index 5611eb51b7..f4357d59be 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApplicationPolicyDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApplicationPolicyDTO.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApplicationReleaseDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApplicationReleaseDTO.java similarity index 99% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApplicationReleaseDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApplicationReleaseDTO.java index d5df40f969..7b5fddac63 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ApplicationReleaseDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ApplicationReleaseDTO.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/CategoryDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/CategoryDTO.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/CategoryDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/CategoryDTO.java index 5ab45a3079..a29c2b9670 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/CategoryDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/CategoryDTO.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; public class CategoryDTO { int id; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/DeviceSubscriptionDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/DeviceSubscriptionDTO.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/DeviceSubscriptionDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/DeviceSubscriptionDTO.java index 58809c1b2e..b2cd3d1572 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/DeviceSubscriptionDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/DeviceSubscriptionDTO.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; import java.sql.Timestamp; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/GroupSubscriptionDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/GroupSubscriptionDTO.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/GroupSubscriptionDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/GroupSubscriptionDTO.java index 1d1640a247..a01b2b08bc 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/GroupSubscriptionDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/GroupSubscriptionDTO.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; import java.sql.Timestamp; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ReviewDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ReviewDTO.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ReviewDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ReviewDTO.java index 42f410a26f..24dbb6125c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ReviewDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ReviewDTO.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; import java.sql.Timestamp; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/RoleSubscriptionDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/RoleSubscriptionDTO.java similarity index 97% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/RoleSubscriptionDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/RoleSubscriptionDTO.java index 9d06179024..075e96d083 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/RoleSubscriptionDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/RoleSubscriptionDTO.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; import java.sql.Timestamp; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ScheduledSubscriptionDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ScheduledSubscriptionDTO.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ScheduledSubscriptionDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ScheduledSubscriptionDTO.java index da3e1e01e0..ac2277a02d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/ScheduledSubscriptionDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ScheduledSubscriptionDTO.java @@ -16,13 +16,12 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; import com.google.gson.Gson; -import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; -import org.wso2.carbon.device.application.mgt.common.SubscriptionType; +import io.entgra.application.mgt.common.ExecutionStatus; +import io.entgra.application.mgt.common.SubscriptionType; -import java.time.LocalDateTime; import java.util.List; import java.util.stream.Collectors; @@ -50,7 +49,7 @@ public class ScheduledSubscriptionDTO { /** * UUID of the application release which is subscribed to. - * {@see {@link org.wso2.carbon.device.application.mgt.common.response.ApplicationRelease}} + * {@see {@link io.entgra.application.mgt.common.response.ApplicationRelease}} */ private String applicationUUID; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/TagDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/TagDTO.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/TagDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/TagDTO.java index 6a7f5f5af0..cb06a8a1ce 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/TagDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/TagDTO.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; public class TagDTO { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/UserSubscriptionDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/UserSubscriptionDTO.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/UserSubscriptionDTO.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/UserSubscriptionDTO.java index 277b04e97d..4b318df937 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/dto/UserSubscriptionDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/UserSubscriptionDTO.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.dto; +package io.entgra.application.mgt.common.dto; import java.sql.Timestamp; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ApplicationCategoryManagementException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ApplicationCategoryManagementException.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ApplicationCategoryManagementException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ApplicationCategoryManagementException.java index 027aa52d43..206b4d1970 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ApplicationCategoryManagementException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ApplicationCategoryManagementException.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Exception that will be thrown during Application Category Management. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ApplicationManagementException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ApplicationManagementException.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ApplicationManagementException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ApplicationManagementException.java index 48596fe969..c698aa01ec 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ApplicationManagementException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ApplicationManagementException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Represents the exception thrown during application management. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ApplicationStorageManagementException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ApplicationStorageManagementException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ApplicationStorageManagementException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ApplicationStorageManagementException.java index 56cfb19710..0549d2e3fc 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ApplicationStorageManagementException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ApplicationStorageManagementException.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Represents the exception thrown during storing and retrieving the artifacts. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/DBConnectionException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/DBConnectionException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/DBConnectionException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/DBConnectionException.java index cedf06bf7c..e09cbae4b0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/DBConnectionException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/DBConnectionException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Exception thrown due to Database Connection issues. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/DeviceConnectorException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/DeviceConnectorException.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/DeviceConnectorException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/DeviceConnectorException.java index 3e9fb9ddee..d6e43825fb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/DeviceConnectorException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/DeviceConnectorException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Represents the exception thrown during device connections. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/IllegalTransactionStateException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/IllegalTransactionStateException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/IllegalTransactionStateException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/IllegalTransactionStateException.java index 40d0c4916a..10400af2e0 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/IllegalTransactionStateException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/IllegalTransactionStateException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Exception thrown due to an issue in database transactions. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/InvalidConfigurationException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/InvalidConfigurationException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/InvalidConfigurationException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/InvalidConfigurationException.java index 9ad11d10b5..2acfdd57eb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/InvalidConfigurationException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/InvalidConfigurationException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Exception thrown due to invalid configurations provided for Application Management. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/LifecycleManagementException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/LifecycleManagementException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/LifecycleManagementException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/LifecycleManagementException.java index 6df1b09246..022e2bfcac 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/LifecycleManagementException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/LifecycleManagementException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Exception caused during the lifecycle management. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/RequestValidatingException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/RequestValidatingException.java similarity index 93% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/RequestValidatingException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/RequestValidatingException.java index 3fbb27fc35..62d5d06eb2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/RequestValidatingException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/RequestValidatingException.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Represents the exception thrown during validating the request. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ResourceManagementException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ResourceManagementException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ResourceManagementException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ResourceManagementException.java index 3b5125d365..21634a38aa 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ResourceManagementException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ResourceManagementException.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Represents the exception that will be thrown when there is an issue while managing the resources. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ReviewDoesNotExistException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ReviewDoesNotExistException.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ReviewDoesNotExistException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ReviewDoesNotExistException.java index c31c8b6263..81ed5ad18c 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ReviewDoesNotExistException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ReviewDoesNotExistException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; public class ReviewDoesNotExistException extends Exception { private String message; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ReviewManagementException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ReviewManagementException.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ReviewManagementException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ReviewManagementException.java index 1e6d0c0a63..c8ef1af781 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/ReviewManagementException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/ReviewManagementException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; public class ReviewManagementException extends Exception { private String message; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/SubscriptionManagementException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/SubscriptionManagementException.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/SubscriptionManagementException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/SubscriptionManagementException.java index e3c48164d0..1abb93a98d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/SubscriptionManagementException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/SubscriptionManagementException.java @@ -16,7 +16,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; public class SubscriptionManagementException extends Exception { private String message; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/TransactionManagementException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/TransactionManagementException.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/TransactionManagementException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/TransactionManagementException.java index 4fcb6261fd..bb24e02638 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/TransactionManagementException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/TransactionManagementException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * Exception thrown due to an issue in TransactionManagement of Database. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/UnsupportedDatabaseEngineException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/UnsupportedDatabaseEngineException.java similarity index 95% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/UnsupportedDatabaseEngineException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/UnsupportedDatabaseEngineException.java index 0be1bc7466..99613e6736 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/UnsupportedDatabaseEngineException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/UnsupportedDatabaseEngineException.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * This runtime exception will be thrown if the server has configured with unsupported DB engine. diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/VisibilityManagementException.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/VisibilityManagementException.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/VisibilityManagementException.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/VisibilityManagementException.java index aecf2c76c5..4133158ebb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/exception/VisibilityManagementException.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/exception/VisibilityManagementException.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.exception; +package io.entgra.application.mgt.common.exception; /** * This specialized exception is thrown by the Visibility Manager during unexpected behaviour diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Application.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Application.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Application.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Application.java index 0cd8a72783..fc5251d3a8 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Application.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Application.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.response; +package io.entgra.application.mgt.common.response; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/ApplicationRelease.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/ApplicationRelease.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/ApplicationRelease.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/ApplicationRelease.java index 25009bae1f..aff7688f18 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/ApplicationRelease.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/ApplicationRelease.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.response; +package io.entgra.application.mgt.common.response; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Category.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Category.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Category.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Category.java index f90a688a5f..f65614d197 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Category.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Category.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.response; +package io.entgra.application.mgt.common.response; public class Category { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Review.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Review.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Review.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Review.java index 1c0285fbb4..5e72e376de 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Review.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Review.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.response; +package io.entgra.application.mgt.common.response; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Tag.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Tag.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Tag.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Tag.java index a10e3eccc9..bc58ded996 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/response/Tag.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/response/Tag.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.response; +package io.entgra.application.mgt.common.response; public class Tag { diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationManager.java similarity index 88% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationManager.java index 73f78478e7..5e77584b9a 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationManager.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationManager.java @@ -14,30 +14,30 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.services; +package io.entgra.application.mgt.common.services; import org.apache.cxf.jaxrs.ext.multipart.Attachment; -import org.wso2.carbon.device.application.mgt.common.ApplicationArtifact; -import org.wso2.carbon.device.application.mgt.common.LifecycleChanger; -import org.wso2.carbon.device.application.mgt.common.ApplicationList; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.Filter; -import org.wso2.carbon.device.application.mgt.common.LifecycleState; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.RequestValidatingException; -import org.wso2.carbon.device.application.mgt.common.response.Application; -import org.wso2.carbon.device.application.mgt.common.response.ApplicationRelease; -import org.wso2.carbon.device.application.mgt.common.response.Category; -import org.wso2.carbon.device.application.mgt.common.response.Tag; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.EntAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationUpdateWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppWrapper; +import io.entgra.application.mgt.common.ApplicationArtifact; +import io.entgra.application.mgt.common.LifecycleChanger; +import io.entgra.application.mgt.common.ApplicationList; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.Filter; +import io.entgra.application.mgt.common.LifecycleState; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.RequestValidatingException; +import io.entgra.application.mgt.common.response.Application; +import io.entgra.application.mgt.common.response.ApplicationRelease; +import io.entgra.application.mgt.common.response.Category; +import io.entgra.application.mgt.common.response.Tag; +import io.entgra.application.mgt.common.wrapper.CustomAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.CustomAppWrapper; +import io.entgra.application.mgt.common.wrapper.EntAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationUpdateWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppWrapper; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationStorageManager.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationStorageManager.java similarity index 91% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationStorageManager.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationStorageManager.java index 3d8b0f6821..39be94cc3d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ApplicationStorageManager.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ApplicationStorageManager.java @@ -15,13 +15,13 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.services; +package io.entgra.application.mgt.common.services; -import org.wso2.carbon.device.application.mgt.common.ApplicationInstaller; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.RequestValidatingException; -import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException; +import io.entgra.application.mgt.common.ApplicationInstaller; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.exception.ApplicationStorageManagementException; +import io.entgra.application.mgt.common.exception.RequestValidatingException; +import io.entgra.application.mgt.common.exception.ResourceManagementException; import java.io.InputStream; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/AppmDataHandler.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/AppmDataHandler.java similarity index 84% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/AppmDataHandler.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/AppmDataHandler.java index e789fe5421..5b99870c5f 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/AppmDataHandler.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/AppmDataHandler.java @@ -15,11 +15,11 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.services; +package io.entgra.application.mgt.common.services; -import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; +import io.entgra.application.mgt.common.config.LifecycleState; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.LifecycleManagementException; import java.io.InputStream; import java.util.Map; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/DeviceConnector.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/DeviceConnector.java similarity index 87% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/DeviceConnector.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/DeviceConnector.java index b227dd43b5..10a8c31258 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/DeviceConnector.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/DeviceConnector.java @@ -14,10 +14,10 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.services; +package io.entgra.application.mgt.common.services; -import org.wso2.carbon.device.application.mgt.common.AppOperation; -import org.wso2.carbon.device.application.mgt.common.exception.DeviceConnectorException; +import io.entgra.application.mgt.common.AppOperation; +import io.entgra.application.mgt.common.exception.DeviceConnectorException; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import java.util.List; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ReviewManager.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ReviewManager.java similarity index 85% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ReviewManager.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ReviewManager.java index c87b50a3eb..97da7397c4 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/ReviewManager.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/ReviewManager.java @@ -14,15 +14,15 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.services; +package io.entgra.application.mgt.common.services; -import org.wso2.carbon.device.application.mgt.common.Rating; -import org.wso2.carbon.device.application.mgt.common.response.Review; -import org.wso2.carbon.device.application.mgt.common.PaginationRequest; -import org.wso2.carbon.device.application.mgt.common.PaginationResult; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; -import org.wso2.carbon.device.application.mgt.common.wrapper.ReviewWrapper; +import io.entgra.application.mgt.common.Rating; +import io.entgra.application.mgt.common.response.Review; +import io.entgra.application.mgt.common.PaginationRequest; +import io.entgra.application.mgt.common.PaginationResult; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ReviewManagementException; +import io.entgra.application.mgt.common.wrapper.ReviewWrapper; /** * ReviewManager is responsible for handling all the add/update/delete/get operations related with diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/SubscriptionManager.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/SubscriptionManager.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java index bc2eaabc47..8f945844c2 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/services/SubscriptionManager.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java @@ -14,13 +14,13 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.services; +package io.entgra.application.mgt.common.services; -import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse; -import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; -import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; +import io.entgra.application.mgt.common.ApplicationInstallResponse; +import io.entgra.application.mgt.common.ExecutionStatus; +import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.SubscriptionManagementException; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.PaginationRequest; import org.wso2.carbon.device.mgt.common.PaginationResult; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/ApplicationUpdateWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/ApplicationUpdateWrapper.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/ApplicationUpdateWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/ApplicationUpdateWrapper.java index 4c7614e612..84da8cecb5 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/ApplicationUpdateWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/ApplicationUpdateWrapper.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/ApplicationWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/ApplicationWrapper.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/ApplicationWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/ApplicationWrapper.java index 11ae27b7f2..f109b7b78d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/ApplicationWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/ApplicationWrapper.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/CustomAppReleaseWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/CustomAppReleaseWrapper.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/CustomAppReleaseWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/CustomAppReleaseWrapper.java index ca9a77e2cd..eb30c7e912 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/CustomAppReleaseWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/CustomAppReleaseWrapper.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/CustomAppWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/CustomAppWrapper.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/CustomAppWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/CustomAppWrapper.java index ce0108bbd7..4c0a392d89 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/CustomAppWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/CustomAppWrapper.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/EntAppReleaseWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/EntAppReleaseWrapper.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/EntAppReleaseWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/EntAppReleaseWrapper.java index c3c7ddb84d..4d39506e9b 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/EntAppReleaseWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/EntAppReleaseWrapper.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/PublicAppReleaseWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/PublicAppReleaseWrapper.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/PublicAppReleaseWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/PublicAppReleaseWrapper.java index badbdf30d5..4b60e52941 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/PublicAppReleaseWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/PublicAppReleaseWrapper.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/PublicAppWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/PublicAppWrapper.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/PublicAppWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/PublicAppWrapper.java index beb66706fd..5f653257cb 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/PublicAppWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/PublicAppWrapper.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/ReviewWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/ReviewWrapper.java similarity index 94% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/ReviewWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/ReviewWrapper.java index 120df8cc1b..90a525f3db 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/ReviewWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/ReviewWrapper.java @@ -15,7 +15,7 @@ * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; public class ReviewWrapper { private String content; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/WebAppReleaseWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/WebAppReleaseWrapper.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/WebAppReleaseWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/WebAppReleaseWrapper.java index 02435bcc8e..090307a32d 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/WebAppReleaseWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/WebAppReleaseWrapper.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/WebAppWrapper.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/WebAppWrapper.java similarity index 98% rename from components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/WebAppWrapper.java rename to components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/WebAppWrapper.java index 1c5bba1d20..8455f0ce67 100644 --- a/components/application-mgt/org.wso2.carbon.device.application.mgt.common/src/main/java/org/wso2/carbon/device/application/mgt/common/wrapper/WebAppWrapper.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/wrapper/WebAppWrapper.java @@ -14,7 +14,7 @@ * specific language governing permissions and limitations * under the License. */ -package org.wso2.carbon.device.application.mgt.common.wrapper; +package io.entgra.application.mgt.common.wrapper; import io.swagger.annotations.ApiModel; import io.swagger.annotations.ApiModelProperty; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Configuration.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Configuration.java index 3a254accc5..b152ed28b8 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Configuration.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/Configuration.java @@ -17,9 +17,9 @@ */ package io.entgra.application.mgt.core.config; -import org.wso2.carbon.device.application.mgt.common.config.MDMConfig; -import org.wso2.carbon.device.application.mgt.common.config.RatingConfiguration; -import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; +import io.entgra.application.mgt.common.config.MDMConfig; +import io.entgra.application.mgt.common.config.RatingConfiguration; +import io.entgra.application.mgt.common.config.LifecycleState; import java.util.List; import javax.xml.bind.annotation.XmlElement; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/ConfigurationManager.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/ConfigurationManager.java index cd2230aa14..ab85f87bb3 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/ConfigurationManager.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/config/ConfigurationManager.java @@ -19,8 +19,8 @@ package io.entgra.application.mgt.core.config; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.InvalidConfigurationException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.InvalidConfigurationException; import io.entgra.application.mgt.core.util.Constants; import java.io.File; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java index 1b680acc79..6e9566721d 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java @@ -18,9 +18,9 @@ package io.entgra.application.mgt.core.dao; import org.wso2.carbon.device.application.mgt.common.*; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.dto.CategoryDTO; -import org.wso2.carbon.device.application.mgt.common.dto.TagDTO; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.CategoryDTO; +import io.entgra.application.mgt.common.dto.TagDTO; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java index c877d58478..48bc3bdc8d 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.dao; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; import org.wso2.carbon.device.application.mgt.common.Rating; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java index afcf8ceec3..6d911fe914 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java @@ -17,9 +17,9 @@ */ package io.entgra.application.mgt.core.dao; -import org.wso2.carbon.device.application.mgt.common.response.Review; +import io.entgra.application.mgt.common.response.Review; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; -import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; +import io.entgra.application.mgt.common.dto.ReviewDTO; import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java index 63151d7454..6894c08caa 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java @@ -18,10 +18,10 @@ package io.entgra.application.mgt.core.dao; import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.dto.DeviceSubscriptionDTO; +import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; +import io.entgra.application.mgt.common.exception.SubscriptionManagementException; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java index 66e54834c2..414ca0d015 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/common/ApplicationManagementDAOFactory.java @@ -19,7 +19,7 @@ package io.entgra.application.mgt.core.dao.common; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.UnsupportedDatabaseEngineException; +import io.entgra.application.mgt.common.exception.UnsupportedDatabaseEngineException; import io.entgra.application.mgt.core.dao.ApplicationDAO; import io.entgra.application.mgt.core.dao.ApplicationReleaseDAO; import io.entgra.application.mgt.core.dao.LifecycleStateDAO; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/AbstractDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/AbstractDAOImpl.java index b9808ead34..f8b50341fc 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/AbstractDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/AbstractDAOImpl.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.dao.impl; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.util.ConnectionManagerUtil; import java.sql.Connection; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java index 37b9b72c23..a8067fa86e 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java @@ -21,12 +21,12 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.AppLifecycleState; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.dto.CategoryDTO; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.CategoryDTO; import org.wso2.carbon.device.application.mgt.common.Filter; -import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; -import org.wso2.carbon.device.application.mgt.common.dto.TagDTO; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.dto.ReviewDTO; +import io.entgra.application.mgt.common.dto.TagDTO; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.dao.ApplicationDAO; import io.entgra.application.mgt.core.util.DAOUtil; import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java index e96f7769eb..cbd48bd45b 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java @@ -22,8 +22,8 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.Filter; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import io.entgra.application.mgt.core.util.DAOUtil; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java index 1c755e633e..9cce71c6e7 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java @@ -21,8 +21,8 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.Filter; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import io.entgra.application.mgt.core.util.DAOUtil; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java index c6b8309642..e6e7bf8ead 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java @@ -20,9 +20,9 @@ package io.entgra.application.mgt.core.dao.impl.application.release; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; import org.wso2.carbon.device.application.mgt.common.Rating; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.dao.ApplicationReleaseDAO; import io.entgra.application.mgt.core.util.DAOUtil; import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java index c9aaae519f..33105e9bdc 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/OracleApplicationReleaseDAOImpl.java @@ -19,7 +19,7 @@ package io.entgra.application.mgt.core.dao.impl.application.release; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java index eac1e23271..b40790a7b8 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/SQLServerApplicationReleaseDAOImpl.java @@ -19,7 +19,7 @@ package io.entgra.application.mgt.core.dao.impl.application.release; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java index 3c5c2aa559..bf2b9288ec 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java @@ -21,7 +21,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.AppLifecycleState; import org.wso2.carbon.device.application.mgt.common.LifecycleState; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.dao.LifecycleStateDAO; import io.entgra.application.mgt.core.util.DAOUtil; import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java index a43f4710d0..7238b4d0a4 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java @@ -21,8 +21,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; -import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.dto.ReviewDTO; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.dao.ReviewDAO; import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; import io.entgra.application.mgt.core.util.DAOUtil; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java index 6f318a1d70..3806c312c8 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java @@ -20,8 +20,8 @@ package io.entgra.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; -import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.dto.ReviewDTO; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; import io.entgra.application.mgt.core.util.Constants; import io.entgra.application.mgt.core.util.DAOUtil; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java index d6a6368076..0e17014319 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java @@ -20,8 +20,8 @@ package io.entgra.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; -import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.dto.ReviewDTO; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; import io.entgra.application.mgt.core.util.Constants; import io.entgra.application.mgt.core.util.DAOUtil; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java index dbf896200c..092beb05c3 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java @@ -22,9 +22,9 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; import org.wso2.carbon.device.application.mgt.common.SubAction; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; -import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.dto.DeviceSubscriptionDTO; +import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.dao.SubscriptionDAO; import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java index e4d25a8219..d52cc49fef 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/OracleSubscriptionDAOImpl.java @@ -19,7 +19,7 @@ package io.entgra.application.mgt.core.dao.impl.subscription; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java index 4d6763b047..7872b64ff5 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/SQLServerSubscriptionDAOImpl.java @@ -19,7 +19,7 @@ package io.entgra.application.mgt.core.dao.impl.subscription; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.sql.Connection; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java index 50156e417c..eb4b712cd5 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/visibility/GenericVisibilityDAOImpl.java @@ -19,7 +19,7 @@ package io.entgra.application.mgt.core.dao.impl.visibility; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.dao.VisibilityDAO; import io.entgra.application.mgt.core.dao.impl.AbstractDAOImpl; import io.entgra.application.mgt.core.exception.VisibilityManagementDAOException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/BadRequestException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/BadRequestException.java index f4f940fbcd..c898bb3318 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/BadRequestException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/BadRequestException.java @@ -18,7 +18,7 @@ package io.entgra.application.mgt.core.exception; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; /** * Custom exception class for wrapping BadRequest related exceptions. diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ForbiddenException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ForbiddenException.java index f1a5554bfd..f0286f3e69 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ForbiddenException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ForbiddenException.java @@ -19,7 +19,7 @@ package io.entgra.application.mgt.core.exception; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; /** * Exception class that is corresponding to 401 Forbidden response diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/NotFoundException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/NotFoundException.java index 36fe34b45a..aca4f221fe 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/NotFoundException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/NotFoundException.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.exception; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; /** * This exception will be thrown when the requested application or platform not found. diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ReviewManagementDAOException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ReviewManagementDAOException.java index 1686453a2d..4dec217d0c 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ReviewManagementDAOException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ReviewManagementDAOException.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.exception; -import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; +import io.entgra.application.mgt.common.exception.ReviewManagementException; /** * Exception thrown during the Review Management DAO operations. diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/SubscriptionManagementDAOException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/SubscriptionManagementDAOException.java index 56330bd41d..f45337cd3b 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/SubscriptionManagementDAOException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/SubscriptionManagementDAOException.java @@ -16,7 +16,7 @@ */ package io.entgra.application.mgt.core.exception; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; /** * Exception thrown during the ApplicationDTO Management DAO operations. diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/UnexpectedServerErrorException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/UnexpectedServerErrorException.java index aec891fda1..58a24f1e44 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/UnexpectedServerErrorException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/UnexpectedServerErrorException.java @@ -18,7 +18,7 @@ package io.entgra.application.mgt.core.exception; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; public class UnexpectedServerErrorException extends ApplicationManagementException { diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ValidationException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ValidationException.java index 4b06dcb5a2..bad1b6b69d 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ValidationException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/ValidationException.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.exception; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; /** * This exception will be thrown when the initial validation fails to perform an operation. diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/VisibilityManagementDAOException.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/VisibilityManagementDAOException.java index 2a65f5c83d..5988904f55 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/VisibilityManagementDAOException.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/exception/VisibilityManagementDAOException.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.exception; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; /** * This is the specialized exception which is thrown when there are database level problems encountered diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java index ef08172f10..badb4946c5 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java @@ -32,39 +32,39 @@ import org.wso2.carbon.device.application.mgt.common.ApplicationInstaller; import org.wso2.carbon.device.application.mgt.common.DeviceTypes; import org.wso2.carbon.device.application.mgt.common.LifecycleChanger; import org.wso2.carbon.device.application.mgt.common.Pagination; -import org.wso2.carbon.device.application.mgt.common.config.RatingConfiguration; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.config.RatingConfiguration; +import io.entgra.application.mgt.common.dto.ApplicationDTO; import org.wso2.carbon.device.application.mgt.common.ApplicationList; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; import org.wso2.carbon.device.application.mgt.common.ApplicationSubscriptionType; import org.wso2.carbon.device.application.mgt.common.ApplicationType; -import org.wso2.carbon.device.application.mgt.common.dto.CategoryDTO; +import io.entgra.application.mgt.common.dto.CategoryDTO; import org.wso2.carbon.device.application.mgt.common.Filter; -import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; +import io.entgra.application.mgt.common.dto.DeviceSubscriptionDTO; import org.wso2.carbon.device.application.mgt.common.LifecycleState; -import org.wso2.carbon.device.application.mgt.common.dto.TagDTO; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.RequestValidatingException; -import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.TransactionManagementException; -import org.wso2.carbon.device.application.mgt.common.response.Application; -import org.wso2.carbon.device.application.mgt.common.response.ApplicationRelease; -import org.wso2.carbon.device.application.mgt.common.response.Category; -import org.wso2.carbon.device.application.mgt.common.response.Tag; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.EntAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationUpdateWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppWrapper; +import io.entgra.application.mgt.common.dto.TagDTO; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationStorageManagementException; +import io.entgra.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.LifecycleManagementException; +import io.entgra.application.mgt.common.exception.RequestValidatingException; +import io.entgra.application.mgt.common.exception.ResourceManagementException; +import io.entgra.application.mgt.common.exception.TransactionManagementException; +import io.entgra.application.mgt.common.response.Application; +import io.entgra.application.mgt.common.response.ApplicationRelease; +import io.entgra.application.mgt.common.response.Category; +import io.entgra.application.mgt.common.response.Tag; +import io.entgra.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.services.ApplicationStorageManager; +import io.entgra.application.mgt.common.wrapper.CustomAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.CustomAppWrapper; +import io.entgra.application.mgt.common.wrapper.EntAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationUpdateWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppWrapper; import io.entgra.application.mgt.core.config.ConfigurationManager; import io.entgra.application.mgt.core.dao.ApplicationDAO; import io.entgra.application.mgt.core.dao.ApplicationReleaseDAO; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java index 5f34e80de4..9e02ad2b9b 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java @@ -23,11 +23,11 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.ApplicationInstaller; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; import org.wso2.carbon.device.application.mgt.common.DeviceTypes; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; +import io.entgra.application.mgt.common.exception.ApplicationStorageManagementException; +import io.entgra.application.mgt.common.exception.ResourceManagementException; +import io.entgra.application.mgt.common.services.ApplicationStorageManager; import io.entgra.application.mgt.core.exception.ParsingException; import io.entgra.application.mgt.core.util.ArtifactsParser; import io.entgra.application.mgt.core.util.Constants; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/AppmDataHandlerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/AppmDataHandlerImpl.java index 9d87520e4b..0700689081 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/AppmDataHandlerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/AppmDataHandlerImpl.java @@ -20,12 +20,12 @@ package io.entgra.application.mgt.core.impl; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; -import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; +import io.entgra.application.mgt.common.config.LifecycleState; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationStorageManagementException; +import io.entgra.application.mgt.common.exception.LifecycleManagementException; +import io.entgra.application.mgt.common.services.ApplicationStorageManager; +import io.entgra.application.mgt.common.services.AppmDataHandler; import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.core.exception.NotFoundException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java index f9a1ea3709..f468e2630a 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java @@ -24,16 +24,16 @@ import org.wso2.carbon.device.application.mgt.common.Rating; import org.wso2.carbon.device.application.mgt.common.ReviewNode; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.PaginationResult; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.common.exception.TransactionManagementException; -import org.wso2.carbon.device.application.mgt.common.response.Review; -import org.wso2.carbon.device.application.mgt.common.services.*; -import org.wso2.carbon.device.application.mgt.common.wrapper.ReviewWrapper; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.dto.ReviewDTO; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ReviewManagementException; +import io.entgra.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.TransactionManagementException; +import io.entgra.application.mgt.common.response.Review; +import io.entgra.application.mgt.common.services.*; +import io.entgra.application.mgt.common.wrapper.ReviewWrapper; import io.entgra.application.mgt.core.dao.ApplicationDAO; import io.entgra.application.mgt.core.dao.ApplicationReleaseDAO; import io.entgra.application.mgt.core.dao.ReviewDAO; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java index 0d3a9a2195..73cc270e11 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -39,18 +39,18 @@ import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; import org.wso2.carbon.device.application.mgt.common.SubAction; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; import org.wso2.carbon.device.application.mgt.common.SubscribingDeviceIdHolder; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationPolicyDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.TransactionManagementException; -import org.wso2.carbon.device.application.mgt.common.response.Application; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.ApplicationPolicyDTO; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.dto.DeviceSubscriptionDTO; +import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.LifecycleManagementException; +import io.entgra.application.mgt.common.exception.SubscriptionManagementException; +import io.entgra.application.mgt.common.exception.TransactionManagementException; +import io.entgra.application.mgt.common.response.Application; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.dao.ApplicationDAO; import io.entgra.application.mgt.core.dao.SubscriptionDAO; import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/ApplicationManagementServiceComponent.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/ApplicationManagementServiceComponent.java index 59f5e7d1b5..e56f73e1cb 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/ApplicationManagementServiceComponent.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/ApplicationManagementServiceComponent.java @@ -21,12 +21,12 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.framework.BundleContext; import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; -import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; -import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.config.LifecycleState; +import io.entgra.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.services.ApplicationStorageManager; +import io.entgra.application.mgt.common.services.AppmDataHandler; +import io.entgra.application.mgt.common.services.ReviewManager; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.config.ConfigurationManager; import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; import io.entgra.application.mgt.core.impl.AppmDataHandlerImpl; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/DataHolder.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/DataHolder.java index fce0f8f04e..3c675db85a 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/DataHolder.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/internal/DataHolder.java @@ -17,11 +17,11 @@ */ package io.entgra.application.mgt.core.internal; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; -import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; -import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.services.ApplicationStorageManager; +import io.entgra.application.mgt.common.services.AppmDataHandler; +import io.entgra.application.mgt.common.services.ReviewManager; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.ntask.core.service.TaskService; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/lifecycle/LifecycleStateManager.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/lifecycle/LifecycleStateManager.java index 33154514a5..a44c708fc3 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/lifecycle/LifecycleStateManager.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/lifecycle/LifecycleStateManager.java @@ -19,9 +19,9 @@ package io.entgra.application.mgt.core.lifecycle; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; +import io.entgra.application.mgt.common.exception.LifecycleManagementException; import io.entgra.application.mgt.core.internal.DataHolder; -import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; +import io.entgra.application.mgt.common.config.LifecycleState; import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagementException; import org.wso2.carbon.device.mgt.core.permission.mgt.PermissionUtils; import org.wso2.carbon.device.mgt.core.search.mgt.Constants; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java index 266084eaa4..1860d2f7ff 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionCleanupTask.java @@ -20,8 +20,8 @@ package io.entgra.application.mgt.core.task; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.exception.SubscriptionManagementException; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.impl.SubscriptionManagerImpl; import org.wso2.carbon.device.mgt.core.task.impl.RandomlyAssignedScheduleTask; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java index 3668b1669e..79c36c2e68 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java @@ -26,10 +26,10 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; -import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.SubscriptionManagementException; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.impl.SubscriptionManagerImpl; import io.entgra.application.mgt.core.util.Constants; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java index 66f94d5967..d414d366fe 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java @@ -26,9 +26,9 @@ import org.quartz.CronExpression; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.application.mgt.common.SubAction; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; -import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; +import io.entgra.application.mgt.common.exception.SubscriptionManagementException; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.exception.ApplicationOperationTaskException; import io.entgra.application.mgt.core.impl.SubscriptionManagerImpl; import io.entgra.application.mgt.core.internal.DataHolder; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java index f3ec5199bd..d433051058 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java @@ -24,22 +24,22 @@ import org.apache.commons.logging.LogFactory; import org.apache.commons.validator.routines.UrlValidator; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.application.mgt.common.ApplicationType; -import org.wso2.carbon.device.application.mgt.common.config.MDMConfig; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.response.Application; -import org.wso2.carbon.device.application.mgt.common.response.ApplicationRelease; -import org.wso2.carbon.device.application.mgt.common.services.*; +import io.entgra.application.mgt.common.config.MDMConfig; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.response.Application; +import io.entgra.application.mgt.common.response.ApplicationRelease; +import io.entgra.application.mgt.common.services.*; import org.wso2.carbon.device.application.mgt.common.ErrorResponse; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.EntAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppWrapper; +import io.entgra.application.mgt.common.wrapper.CustomAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.CustomAppWrapper; +import io.entgra.application.mgt.common.wrapper.EntAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppWrapper; import io.entgra.application.mgt.core.config.ConfigurationManager; import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationManagementUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationManagementUtil.java index 3f14309cd5..11d8adb2ce 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationManagementUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ApplicationManagementUtil.java @@ -19,11 +19,11 @@ package io.entgra.application.mgt.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.InvalidConfigurationException; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationStorageManager; -import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.exception.InvalidConfigurationException; +import io.entgra.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.services.ApplicationStorageManager; +import io.entgra.application.mgt.common.services.ReviewManager; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.config.ConfigurationManager; import io.entgra.application.mgt.core.config.Extension; import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ConnectionManagerUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ConnectionManagerUtil.java index 6fda7e1f7c..cbfa27f63e 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ConnectionManagerUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/ConnectionManagerUtil.java @@ -19,9 +19,9 @@ package io.entgra.application.mgt.core.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.DBConnectionException; -import org.wso2.carbon.device.application.mgt.common.exception.IllegalTransactionStateException; -import org.wso2.carbon.device.application.mgt.common.exception.TransactionManagementException; +import io.entgra.application.mgt.common.exception.DBConnectionException; +import io.entgra.application.mgt.common.exception.IllegalTransactionStateException; +import io.entgra.application.mgt.common.exception.TransactionManagementException; import java.sql.Connection; import java.sql.SQLException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java index 6e234fdc72..f9fb0da0e8 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java @@ -24,12 +24,12 @@ import org.apache.commons.logging.LogFactory; import org.json.JSONException; import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.dto.DeviceSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ReviewDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ScheduledSubscriptionDTO; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.dto.DeviceSubscriptionDTO; +import io.entgra.application.mgt.common.dto.ReviewDTO; +import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/OAuthUtils.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/OAuthUtils.java index 9c47a4bc1c..71eb214ecc 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/OAuthUtils.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/OAuthUtils.java @@ -24,7 +24,7 @@ import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.application.mgt.common.dto.ApiRegistrationProfile; +import io.entgra.application.mgt.common.dto.ApiRegistrationProfile; import org.wso2.carbon.identity.jwt.client.extension.JWTClient; import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java index 7c9e6560d5..ee639406b7 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java @@ -24,8 +24,8 @@ import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.ImageArtifact; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationStorageManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException; +import io.entgra.application.mgt.common.exception.ApplicationStorageManagementException; +import io.entgra.application.mgt.common.exception.ResourceManagementException; import java.io.File; import java.io.FileInputStream; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java index 044cf84951..f0a29efd96 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java @@ -24,8 +24,8 @@ import org.testng.annotations.BeforeSuite; import org.w3c.dom.Document; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.config.LifecycleState; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; import io.entgra.application.mgt.core.common.DataSourceConfig; import io.entgra.application.mgt.core.config.ConfigurationManager; import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ConfigurationTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ConfigurationTest.java index dfcae3db61..9a8609f1ae 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ConfigurationTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/ConfigurationTest.java @@ -21,7 +21,7 @@ import org.junit.Assert; import org.testng.annotations.Test; import io.entgra.application.mgt.core.config.Configuration; import io.entgra.application.mgt.core.config.ConfigurationManager; -import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; +import io.entgra.application.mgt.common.config.LifecycleState; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/InitTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/InitTest.java index 796af57966..2db5d9fa98 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/InitTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/InitTest.java @@ -18,7 +18,7 @@ package io.entgra.application.mgt.core; import org.testng.annotations.BeforeSuite; -import org.wso2.carbon.device.application.mgt.common.exception.InvalidConfigurationException; +import io.entgra.application.mgt.common.exception.InvalidConfigurationException; import io.entgra.application.mgt.core.config.ConfigurationManager; import java.io.File; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifeCycleStateManagerTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifeCycleStateManagerTest.java index 3ba7e049e7..248cd1929f 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifeCycleStateManagerTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifeCycleStateManagerTest.java @@ -18,7 +18,7 @@ package io.entgra.application.mgt.core; import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; -import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; +import io.entgra.application.mgt.common.config.LifecycleState; import java.util.HashMap; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifecycleManagementTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifecycleManagementTest.java index cceb7e7e7a..6080982a5d 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifecycleManagementTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/LifecycleManagementTest.java @@ -20,11 +20,11 @@ package io.entgra.application.mgt.core; import org.junit.Assert; import org.testng.annotations.BeforeClass; import org.testng.annotations.Test; -import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; +import io.entgra.application.mgt.common.exception.LifecycleManagementException; import io.entgra.application.mgt.core.config.Configuration; import io.entgra.application.mgt.core.config.ConfigurationManager; import io.entgra.application.mgt.core.lifecycle.LifecycleStateManager; -import org.wso2.carbon.device.application.mgt.common.config.LifecycleState; +import io.entgra.application.mgt.common.config.LifecycleState; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/StorageManagementUtilTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/StorageManagementUtilTest.java index 01409e46e7..08644a5fab 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/StorageManagementUtilTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/StorageManagementUtilTest.java @@ -22,7 +22,7 @@ import org.junit.Assert; import org.testng.annotations.AfterMethod; import org.testng.annotations.BeforeMethod; import org.testng.annotations.Test; -import org.wso2.carbon.device.application.mgt.common.exception.ResourceManagementException; +import io.entgra.application.mgt.common.exception.ResourceManagementException; import io.entgra.application.mgt.core.util.StorageManagementUtil; import java.io.File; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/ApplicationsDTO.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/ApplicationsDTO.java index 2d0c0fbd2f..d13d288b62 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/ApplicationsDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dto/ApplicationsDTO.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.dto; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.ApplicationDTO; import java.util.ArrayList; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java index fb8393740a..4ff7e42c66 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java @@ -22,17 +22,17 @@ import org.apache.commons.logging.LogFactory; import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.testng.annotations.Test; import org.wso2.carbon.device.application.mgt.common.*; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.RequestValidatingException; -import org.wso2.carbon.device.application.mgt.common.response.Application; -import org.wso2.carbon.device.application.mgt.common.response.ApplicationRelease; -import org.wso2.carbon.device.application.mgt.common.response.Category; -import org.wso2.carbon.device.application.mgt.common.response.Tag; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.application.mgt.common.wrapper.EntAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationUpdateWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.RequestValidatingException; +import io.entgra.application.mgt.common.response.Application; +import io.entgra.application.mgt.common.response.ApplicationRelease; +import io.entgra.application.mgt.common.response.Category; +import io.entgra.application.mgt.common.response.Tag; +import io.entgra.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.wrapper.EntAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationUpdateWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationWrapper; import io.entgra.application.mgt.core.BaseTestCase; import io.entgra.application.mgt.core.dao.ApplicationDAO; import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java index eb2446830e..c9ab612a84 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java @@ -35,18 +35,18 @@ import org.wso2.carbon.device.application.mgt.common.ApplicationList; import org.wso2.carbon.device.application.mgt.common.ErrorResponse; import org.wso2.carbon.device.application.mgt.common.Filter; import org.wso2.carbon.device.application.mgt.common.LifecycleChanger; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.response.ApplicationRelease; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.EntAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationUpdateWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppWrapper; +import io.entgra.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; +import io.entgra.application.mgt.common.response.ApplicationRelease; +import io.entgra.application.mgt.common.wrapper.CustomAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.CustomAppWrapper; +import io.entgra.application.mgt.common.wrapper.EntAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationUpdateWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppWrapper; import java.util.List; import javax.validation.Valid; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java index 6bd5941447..c0126cf34e 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java @@ -22,30 +22,30 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; import org.wso2.carbon.device.application.mgt.common.*; import org.wso2.carbon.device.application.mgt.common.LifecycleState; -import org.wso2.carbon.device.application.mgt.common.exception.LifecycleManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.RequestValidatingException; -import org.wso2.carbon.device.application.mgt.common.response.Application; -import org.wso2.carbon.device.application.mgt.common.response.ApplicationRelease; -import org.wso2.carbon.device.application.mgt.common.response.Category; -import org.wso2.carbon.device.application.mgt.common.response.Tag; -import org.wso2.carbon.device.application.mgt.common.services.AppmDataHandler; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.CustomAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.EntAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationUpdateWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.ApplicationWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.PublicAppWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppReleaseWrapper; -import org.wso2.carbon.device.application.mgt.common.wrapper.WebAppWrapper; +import io.entgra.application.mgt.common.exception.LifecycleManagementException; +import io.entgra.application.mgt.common.exception.RequestValidatingException; +import io.entgra.application.mgt.common.response.Application; +import io.entgra.application.mgt.common.response.ApplicationRelease; +import io.entgra.application.mgt.common.response.Category; +import io.entgra.application.mgt.common.response.Tag; +import io.entgra.application.mgt.common.services.AppmDataHandler; +import io.entgra.application.mgt.common.wrapper.CustomAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.CustomAppWrapper; +import io.entgra.application.mgt.common.wrapper.EntAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationUpdateWrapper; +import io.entgra.application.mgt.common.wrapper.ApplicationWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.PublicAppWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppReleaseWrapper; +import io.entgra.application.mgt.common.wrapper.WebAppWrapper; import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.exception.ForbiddenException; import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.core.util.Constants; import io.entgra.application.mgt.publisher.api.services.ApplicationManagementPublisherAPI; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.services.ApplicationManager; import io.entgra.application.mgt.core.exception.NotFoundException; import java.io.IOException; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java index fd37ba0efb..9799ab9a7f 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ApplicationManagementPublisherAdminAPIImpl.java @@ -19,8 +19,8 @@ package io.entgra.application.mgt.publisher.api.services.impl.admin; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.services.ApplicationManager; import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.exception.ForbiddenException; import io.entgra.application.mgt.core.exception.NotFoundException; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java index 2e5da54e34..65b7f2e9ec 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java @@ -21,9 +21,9 @@ import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; import org.wso2.carbon.device.application.mgt.common.PaginationResult; import org.wso2.carbon.device.application.mgt.common.Rating; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; -import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ReviewManagementException; +import io.entgra.application.mgt.common.services.ReviewManager; import io.entgra.application.mgt.core.exception.NotFoundException; import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.publisher.api.services.admin.ReviewManagementPublisherAdminAPI; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java index 0136d7ca5c..b2ccfbd810 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java @@ -30,7 +30,7 @@ import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.application.mgt.common.ErrorResponse; import org.wso2.carbon.device.application.mgt.common.Filter; -import org.wso2.carbon.device.application.mgt.common.dto.ApplicationDTO; +import io.entgra.application.mgt.common.dto.ApplicationDTO; import org.wso2.carbon.device.application.mgt.common.ApplicationList; import javax.validation.Valid; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java index 2e1613641f..55f0deed17 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java @@ -31,8 +31,8 @@ import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.application.mgt.common.PaginationResult; import org.wso2.carbon.device.application.mgt.common.ErrorResponse; -import org.wso2.carbon.device.application.mgt.common.response.Review; -import org.wso2.carbon.device.application.mgt.common.wrapper.ReviewWrapper; +import io.entgra.application.mgt.common.response.Review; +import io.entgra.application.mgt.common.wrapper.ReviewWrapper; import javax.validation.Valid; import javax.ws.rs.Path; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java index c646b32d9e..05bf95d962 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java @@ -20,9 +20,9 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.ApplicationList; import org.wso2.carbon.device.application.mgt.common.Filter; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.response.Application; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.response.Application; +import io.entgra.application.mgt.common.services.ApplicationManager; import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.exception.NotFoundException; import io.entgra.application.mgt.core.exception.UnexpectedServerErrorException; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java index 762b126664..420679989c 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java @@ -22,16 +22,16 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.device.application.mgt.common.PaginationResult; import org.wso2.carbon.device.application.mgt.common.Rating; -import org.wso2.carbon.device.application.mgt.common.response.Review; -import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; -import org.wso2.carbon.device.application.mgt.common.wrapper.ReviewWrapper; +import io.entgra.application.mgt.common.response.Review; +import io.entgra.application.mgt.common.services.ReviewManager; +import io.entgra.application.mgt.common.wrapper.ReviewWrapper; import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.exception.ForbiddenException; import io.entgra.application.mgt.core.exception.NotFoundException; import io.entgra.application.mgt.store.api.services.ReviewManagementAPI; import org.wso2.carbon.device.application.mgt.common.PaginationRequest; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ReviewManagementException; import io.entgra.application.mgt.core.util.APIUtil; import javax.ws.rs.DefaultValue; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java index 80ab0ec49e..b6bcc37f26 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java @@ -25,8 +25,8 @@ import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse; import org.wso2.carbon.device.application.mgt.common.ErrorResponse; import org.wso2.carbon.device.application.mgt.common.SubAction; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.exception.ApplicationOperationTaskException; import org.wso2.carbon.device.application.mgt.common.DeviceList; import org.wso2.carbon.device.application.mgt.common.BasicUserInfo; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java index 0d62ba9d16..2585edaf1a 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java @@ -18,9 +18,9 @@ package io.entgra.application.mgt.store.api.services.impl.admin; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.exception.ReviewManagementException; -import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ReviewManagementException; +import io.entgra.application.mgt.common.services.ReviewManager; import io.entgra.application.mgt.core.exception.NotFoundException; import io.entgra.application.mgt.core.util.APIUtil; import io.entgra.application.mgt.store.api.services.admin.ReviewManagementStoreAdminAPI; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java index c65cd02826..b767c39ccd 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java @@ -21,8 +21,8 @@ package io.entgra.application.mgt.store.api.services.impl.admin; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.exception.NotFoundException; import io.entgra.application.mgt.core.util.APIUtil; diff --git a/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java index b14d9035b4..d586b5f5cb 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java +++ b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.store.api.services; -import org.wso2.carbon.device.application.mgt.common.response.Review; +import io.entgra.application.mgt.common.response.Review; /** * Helper class for Review Management API test cases. diff --git a/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java index 88fe81fcaa..432322ff11 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java +++ b/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java @@ -24,7 +24,7 @@ import org.junit.Ignore; import org.powermock.core.classloader.annotations.PowerMockIgnore; import org.powermock.core.classloader.annotations.PrepareForTest; import org.powermock.core.classloader.annotations.SuppressStaticInitializationFor; -import org.wso2.carbon.device.application.mgt.common.services.ReviewManager; +import io.entgra.application.mgt.common.services.ReviewManager; import io.entgra.application.mgt.core.util.APIUtil; @PowerMockIgnore("javax.ws.rs.*") diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml index ae6ddc3665..fd84b4cc62 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml @@ -87,12 +87,12 @@ org.apache.commons.logging, org.wso2.carbon.device.mgt.common.*, org.wso2.carbon.device.mgt.core.service - org.wso2.carbon.policy.mgt.core.*, - org.wso2.carbon.policy.mgt.core, - com.google.gson, - org.wso2.carbon.device.mgt.core.service.*, + org.wso2.carbon.policy.mgt.core.*, + org.wso2.carbon.policy.mgt.core, + com.google.gson, + org.wso2.carbon.device.mgt.core.service.*, org.wso2.carbon.device.application.mgt.common.*, - org.wso2.carbon.device.application.mgt.common.services.* + io.entgra.application.mgt.common.services.* diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/PullNotificationSubscriberImpl.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/PullNotificationSubscriberImpl.java index 620757ace1..4ad59f212d 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/PullNotificationSubscriberImpl.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/PullNotificationSubscriberImpl.java @@ -24,11 +24,9 @@ import com.google.gson.JsonElement; import com.google.gson.JsonParser; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException; +import io.entgra.application.mgt.common.exception.ApplicationManagementException; import org.wso2.carbon.device.mgt.common.Device; -import org.wso2.carbon.device.mgt.common.DeviceIdentifier; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; -import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; +import io.entgra.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.mgt.common.operation.mgt.Operation; import org.wso2.carbon.device.mgt.common.operation.mgt.OperationManagementException; import org.wso2.carbon.device.mgt.common.policy.mgt.monitor.ComplianceFeature; diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationDataHolder.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationDataHolder.java index fd257ea28c..453325d5cd 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationDataHolder.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationDataHolder.java @@ -18,7 +18,7 @@ */ package org.wso2.carbon.device.mgt.extensions.pull.notification.internal; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java index 4c3971bf7d..90f8db4004 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java @@ -21,7 +21,7 @@ package org.wso2.carbon.device.mgt.extensions.pull.notification.internal; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.osgi.service.component.ComponentContext; -import org.wso2.carbon.device.application.mgt.common.services.ApplicationManager; +import io.entgra.application.mgt.common.services.ApplicationManager; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; import org.wso2.carbon.policy.mgt.core.PolicyManagerService; diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index 61f896e377..be7d732f59 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -161,7 +161,7 @@ org.wso2.carbon.device.mgt.core.operation.mgt, org.wso2.carbon.core, org.wso2.carbon.device.application.mgt.common.*, - org.wso2.carbon.device.application.mgt.common.services.* + io.entgra.application.mgt.common.services.* diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index b28c1a31cc..a538a641fd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -45,8 +45,8 @@ import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse; import org.wso2.carbon.device.application.mgt.common.SubscriptionType; -import org.wso2.carbon.device.application.mgt.common.exception.SubscriptionManagementException; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.exception.SubscriptionManagementException; +import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.util.HelperUtil; import org.wso2.carbon.device.mgt.common.DeviceFilters; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; @@ -944,7 +944,7 @@ public class DeviceManagementServiceImpl implements DeviceManagementService { return Response.serverError().entity( new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build(); } catch (SubscriptionManagementException | - org.wso2.carbon.device.application.mgt.common.exception.ApplicationManagementException + io.entgra.application.mgt.common.exception.ApplicationManagementException e) { String msg = "Error occurred while getting the " + type + "application is of device " + id + "subscribed " + "at entgra store"; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java index 4f45ea3980..8275ea0163 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/util/DeviceMgtAPIUtils.java @@ -51,7 +51,7 @@ import org.wso2.carbon.base.ServerConfiguration; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.core.util.Utils; -import org.wso2.carbon.device.application.mgt.common.services.SubscriptionManager; +import io.entgra.application.mgt.common.services.SubscriptionManager; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; From 4503ab77c7c7e1be85783e151b0c82a0137b36f0 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 17:30:48 +0530 Subject: [PATCH 39/54] package name change - appmgt --- .../io.entgra.application.mgt.addons/pom.xml | 2 +- .../mgt/addons/FileStreamingOutput.java | 2 +- .../io.entgra.application.mgt.api/pom.xml | 6 +- .../mgt/api/services/ArtifactDownloadAPI.java | 4 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 2 +- .../common/dto/ScheduledSubscriptionDTO.java | 2 +- .../common/services/SubscriptionManager.java | 6 +- .../io.entgra.application.mgt.core/pom.xml | 4 +- .../mgt/core/dao/ApplicationDAO.java | 2 +- .../mgt/core/dao/ApplicationReleaseDAO.java | 2 +- .../mgt/core/dao/LifecycleStateDAO.java | 2 +- .../application/mgt/core/dao/ReviewDAO.java | 2 +- .../mgt/core/dao/SubscriptionDAO.java | 2 +- .../GenericApplicationDAOImpl.java | 4 +- .../application/OracleApplicationDAOImpl.java | 2 +- .../SQLServerApplicationDAOImpl.java | 2 +- .../GenericApplicationReleaseDAOImpl.java | 2 +- .../GenericLifecycleStateDAOImpl.java | 4 +- .../dao/impl/review/GenericReviewDAOImpl.java | 2 +- .../dao/impl/review/OracleReviewDAOImpl.java | 2 +- .../impl/review/SQLServerReviewDAOImpl.java | 2 +- .../GenericSubscriptionDAOImpl.java | 6 +- .../mgt/core/impl/ApplicationManagerImpl.java | 20 ++-- .../impl/ApplicationStorageManagerImpl.java | 4 +- .../mgt/core/impl/ReviewManagerImpl.java | 8 +- .../core/impl/SubscriptionManagerImpl.java | 18 +-- .../task/ScheduledAppSubscriptionTask.java | 4 +- .../ScheduledAppSubscriptionTaskManager.java | 4 +- .../application/mgt/core/util/APIUtil.java | 4 +- .../application/mgt/core/util/DAOUtil.java | 4 +- .../mgt/core/util/StorageManagementUtil.java | 2 +- .../application/mgt/core/BaseTestCase.java | 2 +- .../dao/ApplicationManagementDAOTest.java | 4 +- .../management/ApplicationManagementTest.java | 4 +- .../pom.xml | 6 +- .../ApplicationManagementPublisherAPI.java | 8 +- ...pplicationManagementPublisherAdminAPI.java | 4 +- .../ReviewManagementPublisherAdminAPI.java | 4 +- ...ApplicationManagementPublisherAPIImpl.java | 4 +- ...ReviewManagementPublisherAdminAPIImpl.java | 6 +- .../src/main/webapp/WEB-INF/cxf-servlet.xml | 2 +- .../pom.xml | 6 +- .../services/ApplicationManagementAPI.java | 6 +- .../api/services/ReviewManagementAPI.java | 4 +- .../services/SubscriptionManagementAPI.java | 2 +- .../admin/ReviewManagementStoreAdminAPI.java | 2 +- .../admin/SubscriptionManagementAdminAPI.java | 2 +- .../impl/ApplicationManagementAPIImpl.java | 4 +- .../impl/ReviewManagementAPIImpl.java | 6 +- .../impl/SubscriptionManagementAPIImpl.java | 22 ++-- .../ReviewManagementStoreAdminAPIImpl.java | 0 .../SubscriptionManagementAdminAPIImpl.java | 0 .../impl/util/RequestValidationUtil.java | 0 .../mgt/store/api/util/Constants.java | 0 .../src/main/webapp/META-INF/permissions.xml | 0 .../webapp/META-INF/webapp-classloading.xml | 0 .../src/main/webapp/WEB-INF/cxf-servlet.xml | 2 +- .../src/main/webapp/WEB-INF/web.xml | 0 .../api/services/CommentMgtTestHelper.java | 0 .../api/services/ReviewManagementAPITest.java | 2 +- .../src/test/resources/log4j.properties | 0 .../src/test/resources/testng.xml | 0 components/application-mgt/pom.xml | 12 +- .../pom.xml | 4 +- .../PullNotificationServiceComponent.java | 2 +- .../pom.xml | 4 +- .../org.wso2.carbon.device.mgt.api/pom.xml | 4 +- .../impl/DeviceManagementServiceImpl.java | 4 +- .../pom.xml | 2 +- .../io.entgra.ui.request.interceptor/pom.xml | 2 +- .../pom.xml | 12 +- .../src/main/resources/build.properties | 0 .../src/main/resources/p2.inf | 5 + .../pom.xml | 45 ++------ .../src/main/resources/build.properties | 0 .../main/resources/conf/application-mgt.xml | 0 .../application-mgt-datasources.xml | 0 .../repository/conf/application-mgt.xml.j2 | 10 +- .../application-mgt-datasources.xml.j2 | 0 .../dbscripts/cdm/application-mgt/h2.sql | 0 .../dbscripts/cdm/application-mgt/mssql.sql | 0 .../dbscripts/cdm/application-mgt/mysql.sql | 0 .../dbscripts/cdm/application-mgt/oracle.sql | 0 .../cdm/application-mgt/postgresql.sql | 0 .../src/main/resources/p2.inf | 10 ++ .../src/main/resources/p2.inf | 5 - .../src/main/resources/p2.inf | 10 -- features/application-mgt/pom.xml | 4 +- pom.xml | 104 +++++++++--------- 89 files changed, 221 insertions(+), 252 deletions(-) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/pom.xml (97%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java (96%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java (99%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java (99%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java (98%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java (98%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java (97%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java (98%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java (96%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java (100%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java (100%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java (100%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/java/io/entgra/application/mgt/store/api/util/Constants.java (100%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/webapp/META-INF/permissions.xml (100%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/webapp/META-INF/webapp-classloading.xml (100%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/webapp/WEB-INF/cxf-servlet.xml (96%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/main/webapp/WEB-INF/web.xml (100%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java (100%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java (99%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/test/resources/log4j.properties (100%) rename components/application-mgt/{io.entgra.application.store.api => io.entgra.application.mgt.store.api}/src/test/resources/testng.xml (100%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.api.feature => io.entgra.application.mgt.api.feature}/pom.xml (93%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.api.feature => io.entgra.application.mgt.api.feature}/src/main/resources/build.properties (100%) create mode 100644 features/application-mgt/io.entgra.application.mgt.api.feature/src/main/resources/p2.inf rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/pom.xml (73%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/build.properties (100%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/conf/application-mgt.xml (100%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/conf/datasources/application-mgt-datasources.xml (100%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 (94%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/conf_templates/templates/repository/conf/datasources/application-mgt-datasources.xml.j2 (100%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/dbscripts/cdm/application-mgt/h2.sql (100%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql (100%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql (100%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql (100%) rename features/application-mgt/{org.wso2.carbon.device.application.mgt.server.feature => io.entgra.application.mgt.server.feature}/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql (100%) create mode 100644 features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/p2.inf delete mode 100644 features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/src/main/resources/p2.inf delete mode 100644 features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf diff --git a/components/application-mgt/io.entgra.application.mgt.addons/pom.xml b/components/application-mgt/io.entgra.application.mgt.addons/pom.xml index 06a97f01aa..59c2e6dbba 100644 --- a/components/application-mgt/io.entgra.application.mgt.addons/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.addons/pom.xml @@ -112,7 +112,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common javax.servlet diff --git a/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/FileStreamingOutput.java b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/FileStreamingOutput.java index cf477e58c9..3012adf008 100644 --- a/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/FileStreamingOutput.java +++ b/components/application-mgt/io.entgra.application.mgt.addons/src/main/java/io/entgra/application/mgt/addons/FileStreamingOutput.java @@ -24,7 +24,7 @@ import java.io.InputStream; import java.io.OutputStream; /** - * org.wso2.carbon.device.application.mgt.addons.FileStreamingOutput to allow the user to send the files as Stream. + * io.entgra.application.mgt.addons.FileStreamingOutput to allow the user to send the files as Stream. */ public class FileStreamingOutput implements StreamingOutput { private InputStream inputStream; diff --git a/components/application-mgt/io.entgra.application.mgt.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.api/pom.xml index a4cda82b78..9ce26dac9f 100644 --- a/components/application-mgt/io.entgra.application.mgt.api/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.api/pom.xml @@ -154,12 +154,12 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.core + io.entgra.application.mgt.core provided org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common provided @@ -218,7 +218,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.addons + io.entgra.application.mgt.addons \ No newline at end of file diff --git a/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java index ca46ae679e..2698811f7a 100644 --- a/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/java/io/entgra/application/mgt/api/services/ArtifactDownloadAPI.java @@ -26,8 +26,8 @@ import io.swagger.annotations.Extension; import io.swagger.annotations.ExtensionProperty; import io.swagger.annotations.Info; import io.swagger.annotations.SwaggerDefinition; -import org.wso2.carbon.device.application.mgt.common.ApplicationList; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.ApplicationList; +import io.entgra.application.mgt.common.ErrorResponse; import javax.ws.rs.GET; import javax.ws.rs.Path; diff --git a/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 69b6816220..8b0e0c94ad 100644 --- a/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -48,7 +48,7 @@ - + diff --git a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ScheduledSubscriptionDTO.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ScheduledSubscriptionDTO.java index ac2277a02d..59ad166e80 100644 --- a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ScheduledSubscriptionDTO.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/dto/ScheduledSubscriptionDTO.java @@ -40,7 +40,7 @@ public class ScheduledSubscriptionDTO { * Task name is a generated field and in the following pattern: * {@code __} * {@code SUBSCRIPTION-TYPE} - {@see {@linkplain SubscriptionType}} - * {@code ACTION} - {@see {@linkplain org.wso2.carbon.device.application.mgt.common.SubAction} + * {@code ACTION} - {@see {@linkplain io.entgra.application.mgt.common.SubAction} * {@code HASH-VALUE} - this is a hash value of the combination of application uuid and the subscriber list. * * Example: {@code DEVICE_INSTALL_e593e00e8ef55efc764295b6aa9ad56b} diff --git a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java index 8f945844c2..068a6900fc 100644 --- a/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java +++ b/components/application-mgt/io.entgra.application.mgt.common/src/main/java/io/entgra/application/mgt/common/services/SubscriptionManager.java @@ -45,8 +45,8 @@ public interface SubscriptionManager { * @param generic type of the method. * @return {@link ApplicationInstallResponse} * @throws ApplicationManagementException if error occurs when subscribing to the given application - * @link org.wso2.carbon.device.application.mgt.common.SubscriptionType}} - * @link org.wso2.carbon.device.application.mgt.common.SubAction}} + * @link io.entgra.application.mgt.common.SubscriptionType}} + * @link io.entgra.application.mgt.common.SubAction}} * @param properties */ ApplicationInstallResponse performBulkAppOperation(String applicationUUID, List params, String subType, @@ -109,7 +109,7 @@ public interface SubscriptionManager { * @return {@link ApplicationInstallResponse} * @throws ApplicationManagementException ApplicationManagementException if error occurs when subscribing to the * given application - * @link org.wso2.carbon.device.application.mgt.common.SubscriptionType}} + * @link io.entgra.application.mgt.common.SubscriptionType}} */ void performEntAppSubscription(String applicationUUID, List params, String subType, String action, boolean requiresUpdatingExternal) throws ApplicationManagementException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/pom.xml b/components/application-mgt/io.entgra.application.mgt.core/pom.xml index 5a1d9f5778..05104b8b57 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.core/pom.xml @@ -63,7 +63,7 @@ javax.naming, javax.xml.bind.annotation; version="${javax.xml.bind.imp.pkg.version}", javax.xml.bind; version="${javax.xml.bind.imp.pkg.version}", - org.wso2.carbon.device.application.mgt.common.*, + io.entgra.application.mgt.common.*, org.wso2.carbon.device.mgt.core.*, org.wso2.carbon.device.mgt.common.*, org.wso2.carbon.user.core.*, @@ -163,7 +163,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common org.wso2.carbon.devicemgt diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java index 6e9566721d..6ffa843e5a 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationDAO.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.dao; -import org.wso2.carbon.device.application.mgt.common.*; +import io.entgra.application.mgt.common.*; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.dto.CategoryDTO; import io.entgra.application.mgt.common.dto.TagDTO; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java index 48bc3bdc8d..0ac4824840 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ApplicationReleaseDAO.java @@ -18,7 +18,7 @@ package io.entgra.application.mgt.core.dao; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.Rating; +import io.entgra.application.mgt.common.Rating; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/LifecycleStateDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/LifecycleStateDAO.java index 9f46d533e4..f56849263c 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/LifecycleStateDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/LifecycleStateDAO.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.dao; -import org.wso2.carbon.device.application.mgt.common.LifecycleState; +import io.entgra.application.mgt.common.LifecycleState; import io.entgra.application.mgt.core.exception.LifeCycleManagementDAOException; import java.util.List; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java index 6d911fe914..488563987e 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/ReviewDAO.java @@ -18,7 +18,7 @@ package io.entgra.application.mgt.core.dao; import io.entgra.application.mgt.common.response.Review; -import org.wso2.carbon.device.application.mgt.common.PaginationRequest; +import io.entgra.application.mgt.common.PaginationRequest; import io.entgra.application.mgt.common.dto.ReviewDTO; import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java index 6894c08caa..a84446d6a3 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/SubscriptionDAO.java @@ -17,7 +17,7 @@ */ package io.entgra.application.mgt.core.dao; -import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; +import io.entgra.application.mgt.common.ExecutionStatus; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.application.mgt.common.dto.DeviceSubscriptionDTO; import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java index a8067fa86e..9fa9743590 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/GenericApplicationDAOImpl.java @@ -20,10 +20,10 @@ package io.entgra.application.mgt.core.dao.impl.application; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.AppLifecycleState; +import io.entgra.application.mgt.common.AppLifecycleState; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.dto.CategoryDTO; -import org.wso2.carbon.device.application.mgt.common.Filter; +import io.entgra.application.mgt.common.Filter; import io.entgra.application.mgt.common.dto.ReviewDTO; import io.entgra.application.mgt.common.dto.TagDTO; import io.entgra.application.mgt.common.exception.DBConnectionException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java index cbd48bd45b..60e49f2a27 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/OracleApplicationDAOImpl.java @@ -21,7 +21,7 @@ package io.entgra.application.mgt.core.dao.impl.application; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.Filter; +import io.entgra.application.mgt.common.Filter; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java index 9cce71c6e7..7420b9a057 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/SQLServerApplicationDAOImpl.java @@ -20,7 +20,7 @@ package io.entgra.application.mgt.core.dao.impl.application; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.Filter; +import io.entgra.application.mgt.common.Filter; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ApplicationManagementDAOException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java index e6e7bf8ead..11dbcf6c20 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/application/release/GenericApplicationReleaseDAOImpl.java @@ -21,7 +21,7 @@ package io.entgra.application.mgt.core.dao.impl.application.release; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.Rating; +import io.entgra.application.mgt.common.Rating; import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.dao.ApplicationReleaseDAO; import io.entgra.application.mgt.core.util.DAOUtil; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java index bf2b9288ec..83d1bdf79f 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/lifecyclestate/GenericLifecycleStateDAOImpl.java @@ -19,8 +19,8 @@ package io.entgra.application.mgt.core.dao.impl.lifecyclestate; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.AppLifecycleState; -import org.wso2.carbon.device.application.mgt.common.LifecycleState; +import io.entgra.application.mgt.common.AppLifecycleState; +import io.entgra.application.mgt.common.LifecycleState; import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.dao.LifecycleStateDAO; import io.entgra.application.mgt.core.util.DAOUtil; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java index 7238b4d0a4..c5c5a0bfa0 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/GenericReviewDAOImpl.java @@ -20,7 +20,7 @@ package io.entgra.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.PaginationRequest; +import io.entgra.application.mgt.common.PaginationRequest; import io.entgra.application.mgt.common.dto.ReviewDTO; import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.dao.ReviewDAO; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java index 3806c312c8..340b7204f4 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/OracleReviewDAOImpl.java @@ -19,7 +19,7 @@ package io.entgra.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.PaginationRequest; +import io.entgra.application.mgt.common.PaginationRequest; import io.entgra.application.mgt.common.dto.ReviewDTO; import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java index 0e17014319..0b0e45e6f3 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/review/SQLServerReviewDAOImpl.java @@ -19,7 +19,7 @@ package io.entgra.application.mgt.core.dao.impl.review; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.PaginationRequest; +import io.entgra.application.mgt.common.PaginationRequest; import io.entgra.application.mgt.common.dto.ReviewDTO; import io.entgra.application.mgt.common.exception.DBConnectionException; import io.entgra.application.mgt.core.exception.ReviewManagementDAOException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java index 092beb05c3..521981849d 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/dao/impl/subscription/GenericSubscriptionDAOImpl.java @@ -19,9 +19,9 @@ package io.entgra.application.mgt.core.dao.impl.subscription; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; -import org.wso2.carbon.device.application.mgt.common.SubAction; -import org.wso2.carbon.device.application.mgt.common.SubscriptionType; +import io.entgra.application.mgt.common.ExecutionStatus; +import io.entgra.application.mgt.common.SubAction; +import io.entgra.application.mgt.common.SubscriptionType; import io.entgra.application.mgt.common.dto.DeviceSubscriptionDTO; import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; import io.entgra.application.mgt.common.exception.DBConnectionException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java index badb4946c5..82405ee2fe 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationManagerImpl.java @@ -27,21 +27,21 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.application.mgt.common.ApplicationArtifact; -import org.wso2.carbon.device.application.mgt.common.ApplicationInstaller; -import org.wso2.carbon.device.application.mgt.common.DeviceTypes; -import org.wso2.carbon.device.application.mgt.common.LifecycleChanger; -import org.wso2.carbon.device.application.mgt.common.Pagination; +import io.entgra.application.mgt.common.ApplicationArtifact; +import io.entgra.application.mgt.common.ApplicationInstaller; +import io.entgra.application.mgt.common.DeviceTypes; +import io.entgra.application.mgt.common.LifecycleChanger; +import io.entgra.application.mgt.common.Pagination; import io.entgra.application.mgt.common.config.RatingConfiguration; import io.entgra.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.ApplicationList; +import io.entgra.application.mgt.common.ApplicationList; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.ApplicationSubscriptionType; -import org.wso2.carbon.device.application.mgt.common.ApplicationType; +import io.entgra.application.mgt.common.ApplicationSubscriptionType; +import io.entgra.application.mgt.common.ApplicationType; import io.entgra.application.mgt.common.dto.CategoryDTO; -import org.wso2.carbon.device.application.mgt.common.Filter; +import io.entgra.application.mgt.common.Filter; import io.entgra.application.mgt.common.dto.DeviceSubscriptionDTO; -import org.wso2.carbon.device.application.mgt.common.LifecycleState; +import io.entgra.application.mgt.common.LifecycleState; import io.entgra.application.mgt.common.dto.TagDTO; import io.entgra.application.mgt.common.exception.ApplicationManagementException; import io.entgra.application.mgt.common.exception.ApplicationStorageManagementException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java index 9e02ad2b9b..91e3f4579b 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ApplicationStorageManagerImpl.java @@ -22,9 +22,9 @@ import net.dongliu.apk.parser.bean.ApkMeta; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.ApplicationInstaller; +import io.entgra.application.mgt.common.ApplicationInstaller; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; -import org.wso2.carbon.device.application.mgt.common.DeviceTypes; +import io.entgra.application.mgt.common.DeviceTypes; import io.entgra.application.mgt.common.exception.ApplicationStorageManagementException; import io.entgra.application.mgt.common.exception.ResourceManagementException; import io.entgra.application.mgt.common.services.ApplicationStorageManager; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java index f468e2630a..69b6a2b21b 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/ReviewManagerImpl.java @@ -20,10 +20,10 @@ package io.entgra.application.mgt.core.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.application.mgt.common.Rating; -import org.wso2.carbon.device.application.mgt.common.ReviewNode; -import org.wso2.carbon.device.application.mgt.common.PaginationRequest; -import org.wso2.carbon.device.application.mgt.common.PaginationResult; +import io.entgra.application.mgt.common.Rating; +import io.entgra.application.mgt.common.ReviewNode; +import io.entgra.application.mgt.common.PaginationRequest; +import io.entgra.application.mgt.common.PaginationResult; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.application.mgt.common.dto.ReviewDTO; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java index 73cc270e11..95cfbe48e0 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/impl/SubscriptionManagerImpl.java @@ -30,15 +30,15 @@ import org.json.JSONObject; import org.wso2.carbon.apimgt.application.extension.dto.ApiApplicationKey; import org.wso2.carbon.apimgt.application.extension.exception.APIManagerException; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse; -import org.wso2.carbon.device.application.mgt.common.ApplicationSubscriptionInfo; -import org.wso2.carbon.device.application.mgt.common.ApplicationType; -import org.wso2.carbon.device.application.mgt.common.DeviceSubscriptionData; -import org.wso2.carbon.device.application.mgt.common.DeviceTypes; -import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; -import org.wso2.carbon.device.application.mgt.common.SubAction; -import org.wso2.carbon.device.application.mgt.common.SubscriptionType; -import org.wso2.carbon.device.application.mgt.common.SubscribingDeviceIdHolder; +import io.entgra.application.mgt.common.ApplicationInstallResponse; +import io.entgra.application.mgt.common.ApplicationSubscriptionInfo; +import io.entgra.application.mgt.common.ApplicationType; +import io.entgra.application.mgt.common.DeviceSubscriptionData; +import io.entgra.application.mgt.common.DeviceTypes; +import io.entgra.application.mgt.common.ExecutionStatus; +import io.entgra.application.mgt.common.SubAction; +import io.entgra.application.mgt.common.SubscriptionType; +import io.entgra.application.mgt.common.SubscribingDeviceIdHolder; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.dto.ApplicationPolicyDTO; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java index 79c36c2e68..fc9b5b35cb 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTask.java @@ -24,8 +24,8 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; -import org.wso2.carbon.device.application.mgt.common.SubscriptionType; +import io.entgra.application.mgt.common.ExecutionStatus; +import io.entgra.application.mgt.common.SubscriptionType; import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; import io.entgra.application.mgt.common.exception.ApplicationManagementException; import io.entgra.application.mgt.common.exception.SubscriptionManagementException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java index d414d366fe..932bbe626d 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/task/ScheduledAppSubscriptionTaskManager.java @@ -24,8 +24,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.quartz.CronExpression; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.application.mgt.common.SubAction; -import org.wso2.carbon.device.application.mgt.common.SubscriptionType; +import io.entgra.application.mgt.common.SubAction; +import io.entgra.application.mgt.common.SubscriptionType; import io.entgra.application.mgt.common.dto.ScheduledSubscriptionDTO; import io.entgra.application.mgt.common.exception.SubscriptionManagementException; import io.entgra.application.mgt.common.services.SubscriptionManager; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java index d433051058..0afcc85ab5 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/APIUtil.java @@ -23,7 +23,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.commons.validator.routines.UrlValidator; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.application.mgt.common.ApplicationType; +import io.entgra.application.mgt.common.ApplicationType; import io.entgra.application.mgt.common.config.MDMConfig; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; @@ -31,7 +31,7 @@ import io.entgra.application.mgt.common.exception.ApplicationManagementException import io.entgra.application.mgt.common.response.Application; import io.entgra.application.mgt.common.response.ApplicationRelease; import io.entgra.application.mgt.common.services.*; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.ErrorResponse; import io.entgra.application.mgt.common.wrapper.CustomAppReleaseWrapper; import io.entgra.application.mgt.common.wrapper.CustomAppWrapper; import io.entgra.application.mgt.common.wrapper.EntAppReleaseWrapper; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java index f9fb0da0e8..012a289528 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/DAOUtil.java @@ -22,8 +22,8 @@ import com.google.gson.reflect.TypeToken; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.json.JSONException; -import org.wso2.carbon.device.application.mgt.common.ExecutionStatus; -import org.wso2.carbon.device.application.mgt.common.SubscriptionType; +import io.entgra.application.mgt.common.ExecutionStatus; +import io.entgra.application.mgt.common.SubscriptionType; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java index ee639406b7..f0819dbd80 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/main/java/io/entgra/application/mgt/core/util/StorageManagementUtil.java @@ -23,7 +23,7 @@ import org.apache.commons.codec.digest.DigestUtils; import org.apache.commons.io.IOUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.ImageArtifact; +import io.entgra.application.mgt.common.ImageArtifact; import io.entgra.application.mgt.common.exception.ApplicationStorageManagementException; import io.entgra.application.mgt.common.exception.ResourceManagementException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java index f0a29efd96..fcb9a0dd3b 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/BaseTestCase.java @@ -130,7 +130,7 @@ public abstract class BaseTestCase { try { conn = this.getDataSource().getConnection(); stmt = conn.createStatement(); - stmt.executeUpdate("RUNSCRIPT FROM '../../../features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql'"); + stmt.executeUpdate("RUNSCRIPT FROM '../../../features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql'"); stmt.executeUpdate("RUNSCRIPT FROM '../../../features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/dbscripts/cdm/h2.sql'"); } finally { diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dao/ApplicationManagementDAOTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dao/ApplicationManagementDAOTest.java index 106e1a08af..be76b9c0b7 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dao/ApplicationManagementDAOTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/dao/ApplicationManagementDAOTest.java @@ -25,8 +25,8 @@ import org.testng.annotations.Test; import io.entgra.application.mgt.core.BaseTestCase; import io.entgra.application.mgt.core.config.ConfigurationManager; import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; -import org.wso2.carbon.device.application.mgt.core.dto.ApplicationsDTO; -import org.wso2.carbon.device.application.mgt.core.dto.DeviceTypeCreator; +import io.entgra.application.mgt.core.dto.ApplicationsDTO; +import io.entgra.application.mgt.core.dto.DeviceTypeCreator; import io.entgra.application.mgt.core.util.ConnectionManagerUtil; import org.wso2.carbon.device.mgt.common.exceptions.TransactionManagementException; import org.wso2.carbon.device.mgt.core.dao.DeviceManagementDAOException; diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java index 4ff7e42c66..2652cbf714 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java @@ -21,7 +21,7 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.testng.annotations.Test; -import org.wso2.carbon.device.application.mgt.common.*; +import io.entgra.application.mgt.common.*; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.exception.ApplicationManagementException; import io.entgra.application.mgt.common.exception.RequestValidatingException; @@ -36,7 +36,7 @@ import io.entgra.application.mgt.common.wrapper.ApplicationWrapper; import io.entgra.application.mgt.core.BaseTestCase; import io.entgra.application.mgt.core.dao.ApplicationDAO; import io.entgra.application.mgt.core.dao.common.ApplicationManagementDAOFactory; -import org.wso2.carbon.device.application.mgt.core.dto.ApplicationsDTO; +import io.entgra.application.mgt.core.dto.ApplicationsDTO; import io.entgra.application.mgt.core.impl.ApplicationManagerImpl; import io.entgra.application.mgt.core.internal.DataHolder; import io.entgra.application.mgt.core.util.ConnectionManagerUtil; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml index 71fe89cfce..f7d8c05866 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/pom.xml @@ -154,12 +154,12 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.core + io.entgra.application.mgt.core provided org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common provided @@ -218,7 +218,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.addons + io.entgra.application.mgt.addons \ No newline at end of file diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java index c9ab612a84..f82ce53f2d 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/ApplicationManagementPublisherAPI.java @@ -31,10 +31,10 @@ import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.application.mgt.common.ApplicationList; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; -import org.wso2.carbon.device.application.mgt.common.Filter; -import org.wso2.carbon.device.application.mgt.common.LifecycleChanger; +import io.entgra.application.mgt.common.ApplicationList; +import io.entgra.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.Filter; +import io.entgra.application.mgt.common.LifecycleChanger; import io.entgra.application.mgt.common.dto.ApplicationDTO; import io.entgra.application.mgt.common.dto.ApplicationReleaseDTO; import io.entgra.application.mgt.common.response.ApplicationRelease; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java index 3b9d653b1f..c3db07a21b 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ApplicationManagementPublisherAdminAPI.java @@ -29,8 +29,8 @@ import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.application.mgt.common.ApplicationList; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.ApplicationList; +import io.entgra.application.mgt.common.ErrorResponse; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java index 0cbb416a71..6ae6cdbaeb 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/admin/ReviewManagementPublisherAdminAPI.java @@ -28,8 +28,8 @@ import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; -import org.wso2.carbon.device.application.mgt.common.PaginationResult; +import io.entgra.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.PaginationResult; import javax.ws.rs.GET; import javax.ws.rs.Path; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java index c0126cf34e..f88c005fb1 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/ApplicationManagementPublisherAPIImpl.java @@ -20,8 +20,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.cxf.jaxrs.ext.multipart.Attachment; import org.apache.cxf.jaxrs.ext.multipart.Multipart; -import org.wso2.carbon.device.application.mgt.common.*; -import org.wso2.carbon.device.application.mgt.common.LifecycleState; +import io.entgra.application.mgt.common.*; +import io.entgra.application.mgt.common.LifecycleState; import io.entgra.application.mgt.common.exception.LifecycleManagementException; import io.entgra.application.mgt.common.exception.RequestValidatingException; import io.entgra.application.mgt.common.response.Application; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java index 65b7f2e9ec..d6be1a9f89 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/java/io/entgra/application/mgt/publisher/api/services/impl/admin/ReviewManagementPublisherAdminAPIImpl.java @@ -18,9 +18,9 @@ package io.entgra.application.mgt.publisher.api.services.impl.admin; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.PaginationRequest; -import org.wso2.carbon.device.application.mgt.common.PaginationResult; -import org.wso2.carbon.device.application.mgt.common.Rating; +import io.entgra.application.mgt.common.PaginationRequest; +import io.entgra.application.mgt.common.PaginationResult; +import io.entgra.application.mgt.common.Rating; import io.entgra.application.mgt.common.exception.ApplicationManagementException; import io.entgra.application.mgt.common.exception.ReviewManagementException; import io.entgra.application.mgt.common.services.ReviewManager; diff --git a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml index 8314c023b3..47dcef91e1 100644 --- a/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.publisher.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -50,7 +50,7 @@ - + diff --git a/components/application-mgt/io.entgra.application.store.api/pom.xml b/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml similarity index 97% rename from components/application-mgt/io.entgra.application.store.api/pom.xml rename to components/application-mgt/io.entgra.application.mgt.store.api/pom.xml index ac60b1e26d..7fc3f3da7e 100644 --- a/components/application-mgt/io.entgra.application.store.api/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.store.api/pom.xml @@ -154,17 +154,17 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.core + io.entgra.application.mgt.core provided org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common provided org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.addons + io.entgra.application.mgt.addons org.wso2.carbon.devicemgt diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java similarity index 96% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java index b2ccfbd810..eb11be7a40 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ApplicationManagementAPI.java @@ -28,10 +28,10 @@ import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; -import org.wso2.carbon.device.application.mgt.common.Filter; +import io.entgra.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.Filter; import io.entgra.application.mgt.common.dto.ApplicationDTO; -import org.wso2.carbon.device.application.mgt.common.ApplicationList; +import io.entgra.application.mgt.common.ApplicationList; import javax.validation.Valid; import javax.ws.rs.Consumes; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java similarity index 99% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java index 55f0deed17..3f0cde85f0 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPI.java @@ -29,8 +29,8 @@ import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.application.mgt.common.PaginationResult; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.PaginationResult; +import io.entgra.application.mgt.common.ErrorResponse; import io.entgra.application.mgt.common.response.Review; import io.entgra.application.mgt.common.wrapper.ReviewWrapper; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java similarity index 99% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java index 26742db9f3..00866b508b 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/SubscriptionManagementAPI.java @@ -29,7 +29,7 @@ import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.ErrorResponse; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import javax.validation.Valid; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java similarity index 98% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java index 3cbd7ece80..7ab8cc071e 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/ReviewManagementStoreAdminAPI.java @@ -28,7 +28,7 @@ import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.ErrorResponse; import javax.ws.rs.Consumes; import javax.ws.rs.DELETE; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java similarity index 98% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java index e7bd335817..fc7719bc63 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/admin/SubscriptionManagementAdminAPI.java @@ -29,7 +29,7 @@ import io.swagger.annotations.SwaggerDefinition; import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.ErrorResponse; import javax.validation.constraints.Size; import javax.ws.rs.Consumes; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java similarity index 97% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java index 05bf95d962..735df25c92 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ApplicationManagementAPIImpl.java @@ -18,8 +18,8 @@ package io.entgra.application.mgt.store.api.services.impl; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.ApplicationList; -import org.wso2.carbon.device.application.mgt.common.Filter; +import io.entgra.application.mgt.common.ApplicationList; +import io.entgra.application.mgt.common.Filter; import io.entgra.application.mgt.common.exception.ApplicationManagementException; import io.entgra.application.mgt.common.response.Application; import io.entgra.application.mgt.common.services.ApplicationManager; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java similarity index 98% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java index 420679989c..8aa8b728af 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/ReviewManagementAPIImpl.java @@ -20,8 +20,8 @@ package io.entgra.application.mgt.store.api.services.impl; import io.swagger.annotations.ApiParam; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.PaginationResult; -import org.wso2.carbon.device.application.mgt.common.Rating; +import io.entgra.application.mgt.common.PaginationResult; +import io.entgra.application.mgt.common.Rating; import io.entgra.application.mgt.common.response.Review; import io.entgra.application.mgt.common.services.ReviewManager; import io.entgra.application.mgt.common.wrapper.ReviewWrapper; @@ -29,7 +29,7 @@ import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.exception.ForbiddenException; import io.entgra.application.mgt.core.exception.NotFoundException; import io.entgra.application.mgt.store.api.services.ReviewManagementAPI; -import org.wso2.carbon.device.application.mgt.common.PaginationRequest; +import io.entgra.application.mgt.common.PaginationRequest; import io.entgra.application.mgt.common.exception.ApplicationManagementException; import io.entgra.application.mgt.common.exception.ReviewManagementException; import io.entgra.application.mgt.core.util.APIUtil; diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java similarity index 96% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java index b6bcc37f26..b64a9fad9b 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/SubscriptionManagementAPIImpl.java @@ -21,18 +21,18 @@ package io.entgra.application.mgt.store.api.services.impl; import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse; -import org.wso2.carbon.device.application.mgt.common.ErrorResponse; -import org.wso2.carbon.device.application.mgt.common.SubAction; -import org.wso2.carbon.device.application.mgt.common.SubscriptionType; +import io.entgra.application.mgt.common.ApplicationInstallResponse; +import io.entgra.application.mgt.common.ErrorResponse; +import io.entgra.application.mgt.common.SubAction; +import io.entgra.application.mgt.common.SubscriptionType; import io.entgra.application.mgt.common.exception.ApplicationManagementException; import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.exception.ApplicationOperationTaskException; -import org.wso2.carbon.device.application.mgt.common.DeviceList; -import org.wso2.carbon.device.application.mgt.common.BasicUserInfo; -import org.wso2.carbon.device.application.mgt.common.BasicUserInfoList; -import org.wso2.carbon.device.application.mgt.common.RoleList; -import org.wso2.carbon.device.application.mgt.common.DeviceGroupList; +import io.entgra.application.mgt.common.DeviceList; +import io.entgra.application.mgt.common.BasicUserInfo; +import io.entgra.application.mgt.common.BasicUserInfoList; +import io.entgra.application.mgt.common.RoleList; +import io.entgra.application.mgt.common.DeviceGroupList; import io.entgra.application.mgt.store.api.services.impl.util.RequestValidationUtil; import io.entgra.application.mgt.core.exception.BadRequestException; import io.entgra.application.mgt.core.exception.ForbiddenException; @@ -260,9 +260,9 @@ public class SubscriptionManagementAPIImpl implements SubscriptionManagementAPI{ * either {@link org.wso2.carbon.device.mgt.common.DeviceIdentifier} if {@param subType} is * equal to DEVICE or {@link String} if {@param subType} is USER, ROLE or GROUP * @param subType subscription type. E.g. DEVICE, USER, ROLE, GROUP - * {@see {@link org.wso2.carbon.device.application.mgt.common.SubscriptionType}} + * {@see {@link io.entgra.application.mgt.common.SubscriptionType}} * @param subAction action subscription action. E.g. INSTALL/UNINSTALL - * {@see {@link org.wso2.carbon.device.application.mgt.common.SubAction}} + * {@see {@link io.entgra.application.mgt.common.SubAction}} * @param timestamp timestamp to schedule the application subscription * @return {@link Response} of the operation */ diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/ReviewManagementStoreAdminAPIImpl.java diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/admin/SubscriptionManagementAdminAPIImpl.java diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/services/impl/util/RequestValidationUtil.java diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/util/Constants.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/util/Constants.java similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/main/java/io/entgra/application/mgt/store/api/util/Constants.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/java/io/entgra/application/mgt/store/api/util/Constants.java diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/webapp/META-INF/permissions.xml b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/META-INF/permissions.xml similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/main/webapp/META-INF/permissions.xml rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/META-INF/permissions.xml diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/webapp/META-INF/webapp-classloading.xml b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/main/webapp/META-INF/webapp-classloading.xml rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/META-INF/webapp-classloading.xml diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml similarity index 96% rename from components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml index c7003a4fdb..47d03da598 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/WEB-INF/cxf-servlet.xml @@ -51,7 +51,7 @@ - + diff --git a/components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/web.xml b/components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/WEB-INF/web.xml similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/main/webapp/WEB-INF/web.xml rename to components/application-mgt/io.entgra.application.mgt.store.api/src/main/webapp/WEB-INF/web.xml diff --git a/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/test/java/io/entgra/application/mgt/store/api/services/CommentMgtTestHelper.java diff --git a/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java b/components/application-mgt/io.entgra.application.mgt.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java similarity index 99% rename from components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java rename to components/application-mgt/io.entgra.application.mgt.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java index 432322ff11..52b6e5e051 100644 --- a/components/application-mgt/io.entgra.application.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java +++ b/components/application-mgt/io.entgra.application.mgt.store.api/src/test/java/io/entgra/application/mgt/store/api/services/ReviewManagementAPITest.java @@ -29,7 +29,7 @@ import io.entgra.application.mgt.core.util.APIUtil; @PowerMockIgnore("javax.ws.rs.*") @SuppressStaticInitializationFor({ - "org.wso2.carbon.device.application.mgt.api.APIUtil" }) + "io.entgra.application.mgt.api.APIUtil" }) @PrepareForTest({ APIUtil.class, ReviewManager.class, ReviewManagementAPITest.class}) @Ignore("Since comment manager logic is invalid temporarily added Ignore annotation to skip running comment management test cases") public class ReviewManagementAPITest diff --git a/components/application-mgt/io.entgra.application.store.api/src/test/resources/log4j.properties b/components/application-mgt/io.entgra.application.mgt.store.api/src/test/resources/log4j.properties similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/test/resources/log4j.properties rename to components/application-mgt/io.entgra.application.mgt.store.api/src/test/resources/log4j.properties diff --git a/components/application-mgt/io.entgra.application.store.api/src/test/resources/testng.xml b/components/application-mgt/io.entgra.application.mgt.store.api/src/test/resources/testng.xml similarity index 100% rename from components/application-mgt/io.entgra.application.store.api/src/test/resources/testng.xml rename to components/application-mgt/io.entgra.application.mgt.store.api/src/test/resources/testng.xml diff --git a/components/application-mgt/pom.xml b/components/application-mgt/pom.xml index 53a4256688..56489b2310 100644 --- a/components/application-mgt/pom.xml +++ b/components/application-mgt/pom.xml @@ -34,12 +34,12 @@ http://wso2.org - org.wso2.carbon.device.application.mgt.core - org.wso2.carbon.device.application.mgt.common - org.wso2.carbon.device.application.mgt.addons - org.wso2.carbon.device.application.mgt.publisher.api - org.wso2.carbon.device.application.mgt.store.api - org.wso2.carbon.device.application.mgt.api + io.entgra.application.mgt.common + io.entgra.application.mgt.core + io.entgra.application.mgt.addons + io.entgra.application.mgt.publisher.api + io.entgra.application.mgt.store.api + io.entgra.application.mgt.api diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml index fd84b4cc62..00eeee8d19 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/pom.xml @@ -56,7 +56,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common provided @@ -91,7 +91,7 @@ org.wso2.carbon.policy.mgt.core, com.google.gson, org.wso2.carbon.device.mgt.core.service.*, - org.wso2.carbon.device.application.mgt.common.*, + io.entgra.application.mgt.common.*, io.entgra.application.mgt.common.services.* diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java index 90f8db4004..b7b94c0199 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.pull.notification/src/main/java/org/wso2/carbon/device/mgt/extensions/pull/notification/internal/PullNotificationServiceComponent.java @@ -40,7 +40,7 @@ import org.wso2.carbon.policy.mgt.core.PolicyManagerService; * bind="setPolicyManagerService" * unbind="unsetPolicyManagerService" * @scr.reference name="org.wso2.carbon.application.mgt.service" - * interface="org.wso2.carbon.device.application.mgt.common.services.ApplicationManager" + * interface="io.entgra.application.mgt.common.services.ApplicationManager" * cardinality="1..1" * policy="dynamic" * bind="setApplicationManagerService" diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index be7d732f59..b87fe21f8e 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -113,7 +113,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common provided @@ -160,7 +160,7 @@ org.wso2.carbon.event.output.adapter.core.exception, org.wso2.carbon.device.mgt.core.operation.mgt, org.wso2.carbon.core, - org.wso2.carbon.device.application.mgt.common.*, + io.entgra.application.mgt.common.*, io.entgra.application.mgt.common.services.* diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index 01c4ef7d00..d683786250 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -406,12 +406,12 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common provided org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.core + io.entgra.application.mgt.core provided diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java index a538a641fd..5d039f27a6 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceManagementServiceImpl.java @@ -43,8 +43,8 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.application.mgt.common.ApplicationInstallResponse; -import org.wso2.carbon.device.application.mgt.common.SubscriptionType; +import io.entgra.application.mgt.common.ApplicationInstallResponse; +import io.entgra.application.mgt.common.SubscriptionType; import io.entgra.application.mgt.common.exception.SubscriptionManagementException; import io.entgra.application.mgt.common.services.SubscriptionManager; import io.entgra.application.mgt.core.util.HelperUtil; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index 3c17f25ec2..f98e8672e1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -83,7 +83,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common test diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml index 0fcf6eee7d..45fd0b296b 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/pom.xml @@ -144,7 +144,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.core + io.entgra.application.mgt.core provided diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml b/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml similarity index 93% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml rename to features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml index 5bdf583f19..7897e9139b 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/pom.xml +++ b/features/application-mgt/io.entgra.application.mgt.api.feature/pom.xml @@ -27,9 +27,9 @@ 4.0.0 - org.wso2.carbon.device.application.mgt.api.feature + io.entgra.application.mgt.api.feature pom - WSO2 Carbon - Application Management API Feature + Entgra - Application Management API Feature https://entgra.io This feature contains the APIs required for Application Management console UI @@ -49,7 +49,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.publisher.api + io.entgra.application.mgt.publisher.api ${project.version} war @@ -72,7 +72,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.store.api + io.entgra.application.mgt.store.api ${project.version} war @@ -95,7 +95,7 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.api + io.entgra.application.mgt.api ${project.version} war @@ -146,7 +146,7 @@ p2-feature-gen - org.wso2.carbon.device.application.mgt.api + io.entgra.application.mgt.api ../../../features/etc/feature.properties diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/src/main/resources/build.properties b/features/application-mgt/io.entgra.application.mgt.api.feature/src/main/resources/build.properties similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/src/main/resources/build.properties rename to features/application-mgt/io.entgra.application.mgt.api.feature/src/main/resources/build.properties diff --git a/features/application-mgt/io.entgra.application.mgt.api.feature/src/main/resources/p2.inf b/features/application-mgt/io.entgra.application.mgt.api.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..cc35cf26a1 --- /dev/null +++ b/features/application-mgt/io.entgra.application.mgt.api.feature/src/main/resources/p2.inf @@ -0,0 +1,5 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/webapps/);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.application.mgt.api_${feature.version}/webapps/api#application-mgt-publisher#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#application-mgt-publisher#v1.0.war,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.application.mgt.api_${feature.version}/webapps/api#application-mgt-store#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#application-mgt-store#v1.0.war,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.application.mgt.api_${feature.version}/webapps/api#application-mgt#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#application-mgt#v1.0.war,overwrite:true);\ diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml b/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml similarity index 73% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml rename to features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml index 66d0322843..76ce4d2f15 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/pom.xml +++ b/features/application-mgt/io.entgra.application.mgt.server.feature/pom.xml @@ -27,10 +27,10 @@ 4.0.0 - org.wso2.carbon.device.application.mgt.server.feature + io.entgra.application.mgt.server.feature pom - WSO2 Carbon - Application Management Server Feature + Entgra - Application Management Server Feature https://entgra.io This feature contains the core bundles required for Back-end Application Management functionality @@ -38,11 +38,11 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.common org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.core + io.entgra.application.mgt.core com.googlecode.plist @@ -63,25 +63,6 @@ com.h2database.wso2 h2-database-engine - - - - - - - - - - - - - - - - - - - @@ -156,7 +137,7 @@ p2-feature-gen - org.wso2.carbon.device.application.mgt.server + io.entgra.application.mgt.server ../../../features/etc/feature.properties @@ -164,16 +145,12 @@ org.eclipse.equinox.p2.type.group:false - - - - - org.wso2.carbon.devicemgt:org.wso2.carbon.device.application.mgt.common:${carbon.device.mgt.version} + org.wso2.carbon.devicemgt:io.entgra.application.mgt.common:${carbon.device.mgt.version} - org.wso2.carbon.devicemgt:org.wso2.carbon.device.application.mgt.core:${carbon.device.mgt.version} + org.wso2.carbon.devicemgt:io.entgra.application.mgt.core:${carbon.device.mgt.version} com.googlecode.plist:dd-plist:${googlecode.plist.version} @@ -181,17 +158,9 @@ commons-validator:commons-validator:${commons-validator.version} - - - - - - - - diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/build.properties b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/build.properties similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/build.properties rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/build.properties diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/conf/application-mgt.xml diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/conf/datasources/application-mgt-datasources.xml diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 similarity index 94% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 index 2550288629..21ce676f3f 100644 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 +++ b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/application-mgt.xml.j2 @@ -26,28 +26,28 @@ {% if application_mgt_conf.extension.application_manager is defined %} {{application_mgt_conf.extension.application_manager}} {% else %} - org.wso2.carbon.device.application.mgt.core.impl.ApplicationManagerImpl + io.entgra.application.mgt.core.impl.ApplicationManagerImpl {% endif %} {% if application_mgt_conf.extension.review_manager is defined %} {{application_mgt_conf.extension.review_manager}} {% else %} - org.wso2.carbon.device.application.mgt.core.impl.ReviewManagerImpl + io.entgra.application.mgt.core.impl.ReviewManagerImpl {% endif %} {% if application_mgt_conf.extension.life_cycle_state_manager is defined %} {{application_mgt_conf.extension.life_cycle_state_manager}} {% else %} - org.wso2.carbon.device.application.mgt.core.lifecycle.LifecycleStateManager + io.entgra.application.mgt.core.lifecycle.LifecycleStateManager {% endif %} {% if application_mgt_conf.extension.subscription_manager is defined %} {{application_mgt_conf.extension.subscription_manager}} {% else %} - org.wso2.carbon.device.application.mgt.core.impl.SubscriptionManagerImpl + io.entgra.application.mgt.core.impl.SubscriptionManagerImpl {% endif %} @@ -61,7 +61,7 @@ {% endif %} {% else %} - org.wso2.carbon.device.application.mgt.core.impl.ApplicationStorageManagerImpl + io.entgra.application.mgt.core.impl.ApplicationStorageManagerImpl repository/resources/apps/ 6 diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/application-mgt-datasources.xml.j2 b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/application-mgt-datasources.xml.j2 similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/application-mgt-datasources.xml.j2 rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/conf_templates/templates/repository/conf/datasources/application-mgt-datasources.xml.j2 diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/h2.sql diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mssql.sql diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/mysql.sql diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/oracle.sql diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql similarity index 100% rename from features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql rename to features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/dbscripts/cdm/application-mgt/postgresql.sql diff --git a/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/p2.inf b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/p2.inf new file mode 100644 index 0000000000..480343ebef --- /dev/null +++ b/features/application-mgt/io.entgra.application.mgt.server.feature/src/main/resources/p2.inf @@ -0,0 +1,10 @@ +instructions.configure = \ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.application.mgt.server_${feature.version}/database/,target:${installFolder}/../../../repository/database/,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.application.mgt.server_${feature.version}/conf/application-mgt.xml,target:${installFolder}/../../conf/application-mgt.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.application.mgt.server_${feature.version}/conf/datasources/application-mgt-datasources.xml,target:${installFolder}/../../conf/datasources/application-mgt-datasources.xml,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.application.mgt.server_${feature.version}/dbscripts/cdm/application-mgt,target:${installFolder}/../../../dbscripts/cdm/application-mgt,overwrite:true);\ +org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/io.entgra.application.mgt.server_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ + +instructions.unconfigure = \ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/datasources/application-mgt-datasources.xml);\ +org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/application-mgt);\ diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/src/main/resources/p2.inf b/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/src/main/resources/p2.inf deleted file mode 100644 index 5f658e814d..0000000000 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.api.feature/src/main/resources/p2.inf +++ /dev/null @@ -1,5 +0,0 @@ -instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.mkdir(path:${installFolder}/../../deployment/server/webapps/);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.api_${feature.version}/webapps/api#application-mgt-publisher#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#application-mgt-publisher#v1.0.war,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.api_${feature.version}/webapps/api#application-mgt-store#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#application-mgt-store#v1.0.war,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.api_${feature.version}/webapps/api#application-mgt#v1.0.war,target:${installFolder}/../../deployment/server/webapps/api#application-mgt#v1.0.war,overwrite:true);\ diff --git a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf b/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf deleted file mode 100644 index 360d6ef9f9..0000000000 --- a/features/application-mgt/org.wso2.carbon.device.application.mgt.server.feature/src/main/resources/p2.inf +++ /dev/null @@ -1,10 +0,0 @@ -instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/database/,target:${installFolder}/../../../repository/database/,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf/application-mgt.xml,target:${installFolder}/../../conf/application-mgt.xml,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf/datasources/application-mgt-datasources.xml,target:${installFolder}/../../conf/datasources/application-mgt-datasources.xml,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/dbscripts/cdm/application-mgt,target:${installFolder}/../../../dbscripts/cdm/application-mgt,overwrite:true);\ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.application.mgt.server_${feature.version}/conf_templates/,target:${installFolder}/../../resources/conf/,overwrite:true);\ - -instructions.unconfigure = \ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../conf/datasources/application-mgt-datasources.xml);\ -org.eclipse.equinox.p2.touchpoint.natives.remove(path:${installFolder}/../../../dbscripts/cdm/application-mgt);\ diff --git a/features/application-mgt/pom.xml b/features/application-mgt/pom.xml index 1aa070544a..0efe38c78f 100644 --- a/features/application-mgt/pom.xml +++ b/features/application-mgt/pom.xml @@ -33,7 +33,7 @@ https://entgra.io - org.wso2.carbon.device.application.mgt.api.feature - org.wso2.carbon.device.application.mgt.server.feature + io.entgra.application.mgt.api.feature + io.entgra.application.mgt.server.feature diff --git a/pom.xml b/pom.xml index eacfe8acda..55a55d6e39 100644 --- a/pom.xml +++ b/pom.xml @@ -175,44 +175,44 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.addons - ${carbon.device.mgt.version} - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.authhandler - ${carbon.device.mgt.version} - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.core - ${carbon.device.mgt.version} - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.common + io.entgra.application.mgt.addons ${carbon.device.mgt.version} + + + + + org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.publisher.api + io.entgra.application.mgt.core ${carbon.device.mgt.version} org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.store.api + io.entgra.application.mgt.common ${carbon.device.mgt.version} org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.publisher.ui + io.entgra.application.mgt.publisher.api ${carbon.device.mgt.version} org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.store.ui + io.entgra.application.mgt.store.api ${carbon.device.mgt.version} + + + + + + + + + + org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common @@ -304,46 +304,46 @@ org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.server.feature - zip - ${carbon.device.mgt.version} - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.extensions.feature - zip - ${carbon.device.mgt.version} - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.api.feature - zip - ${carbon.device.mgt.version} - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.auth.handler.feature - zip - ${carbon.device.mgt.version} - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.publisher.ui.feature - zip - ${carbon.device.mgt.version} - - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.store.ui.feature + io.entgra.application.mgt.server.feature zip ${carbon.device.mgt.version} + + + + + + org.wso2.carbon.devicemgt - org.wso2.carbon.device.application.mgt.feature + io.entgra.application.mgt.api.feature zip ${carbon.device.mgt.version} + + + + + + + + + + + + + + + + + + + + + + + + org.wso2.carbon.devicemgt io.entgra.server.bootup.heartbeat.beacon From 39b26d58dc62cc86933aa97225625211fa83eec8 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 17:48:41 +0530 Subject: [PATCH 40/54] removed unused dependecies --- pom.xml | 45 --------------------------------------------- 1 file changed, 45 deletions(-) diff --git a/pom.xml b/pom.xml index 55a55d6e39..b8aacf28c3 100644 --- a/pom.xml +++ b/pom.xml @@ -178,11 +178,6 @@ io.entgra.application.mgt.addons ${carbon.device.mgt.version} - - - - - org.wso2.carbon.devicemgt io.entgra.application.mgt.core @@ -203,16 +198,6 @@ io.entgra.application.mgt.store.api ${carbon.device.mgt.version} - - - - - - - - - - org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common @@ -308,42 +293,12 @@ zip ${carbon.device.mgt.version} - - - - - - org.wso2.carbon.devicemgt io.entgra.application.mgt.api.feature zip ${carbon.device.mgt.version} - - - - - - - - - - - - - - - - - - - - - - - - org.wso2.carbon.devicemgt io.entgra.server.bootup.heartbeat.beacon From 29b561e9c3beb448ca8a44d2802b73b1afe82b55 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 10 Aug 2021 22:00:15 +0530 Subject: [PATCH 41/54] added config to j2 file --- .../templates/repository/conf/mdm-ui-config.xml.j2 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 index d15f23de86..68742071a6 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 @@ -28,6 +28,13 @@ {% else %} true {% endif %} + + {% if mdm_ui_conf.login_cache_capacity is defined %} + {{mdm_ui_conf.login_cache_capacity}} + {% else %} + 10000 + {% endif %} + application_management From eae469fbc51bc465608b62d15141cd9a5e7c3c78 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 17 Aug 2021 09:53:41 +0530 Subject: [PATCH 42/54] tenant login issue fixed --- .../core/internal/TenantCreateObserver.java | 36 +++++++++++++++++-- .../interceptor/PermissionScopeHandler.java | 1 + .../request/interceptor/util/HandlerUtil.java | 10 ++++-- 3 files changed, 42 insertions(+), 5 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/TenantCreateObserver.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/TenantCreateObserver.java index 79a5309296..98dc6c500e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/TenantCreateObserver.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/internal/TenantCreateObserver.java @@ -21,11 +21,15 @@ import org.apache.axis2.context.ConfigurationContext; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.context.PrivilegedCarbonContext; +import org.wso2.carbon.device.mgt.core.DeviceManagementConstants; import org.wso2.carbon.device.mgt.core.DeviceManagementConstants.User; +import org.wso2.carbon.user.api.AuthorizationManager; +import org.wso2.carbon.user.api.Permission; import org.wso2.carbon.user.api.UserRealm; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.api.UserStoreManager; import org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver; +import org.wso2.carbon.utils.multitenancy.MultitenantConstants; /** * Load configuration files to tenant's registry. @@ -48,10 +52,36 @@ public class TenantCreateObserver extends AbstractAxis2ConfigurationContextObser UserStoreManager userStoreManager = DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm(tenantId) .getUserStoreManager(); + AuthorizationManager authorizationManager = DeviceManagementDataHolder.getInstance().getRealmService() + .getTenantUserRealm(MultitenantConstants.SUPER_TENANT_ID).getAuthorizationManager(); + String tenantAdminName = userRealm.getRealmConfiguration().getAdminUserName(); - userStoreManager.addRole(User.DEFAULT_DEVICE_USER, new String[]{tenantAdminName}, User.PERMISSIONS_FOR_DEVICE_USER); - userStoreManager.addRole(User.DEFAULT_DEVICE_ADMIN, new String[]{tenantAdminName}, - User.PERMISSIONS_FOR_DEVICE_ADMIN); + + if (!userStoreManager.isExistingRole(DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN)) { + userStoreManager.addRole( + DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN, + null, + DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_ADMIN); + } else { + for (Permission permission : DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_ADMIN) { + authorizationManager.authorizeRole(DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN, + permission.getResourceId(), permission.getAction()); + } + } + if (!userStoreManager.isExistingRole(DeviceManagementConstants.User.DEFAULT_DEVICE_USER)) { + userStoreManager.addRole( + DeviceManagementConstants.User.DEFAULT_DEVICE_USER, + null, + DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_USER); + } else { + for (Permission permission : DeviceManagementConstants.User.PERMISSIONS_FOR_DEVICE_USER) { + authorizationManager.authorizeRole(DeviceManagementConstants.User.DEFAULT_DEVICE_USER, + permission.getResourceId(), permission.getAction()); + } + } + userStoreManager.updateRoleListOfUser(tenantAdminName, null, + new String[] {DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN, + DeviceManagementConstants.User.DEFAULT_DEVICE_USER}); if (log.isDebugEnabled()) { log.debug("Device management roles: " + User.DEFAULT_DEVICE_USER + ", " + User.DEFAULT_DEVICE_ADMIN + " created for the tenant:" + tenantDomain + "." diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/PermissionScopeHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/PermissionScopeHandler.java index 96d1d1151f..9ccb10c796 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/PermissionScopeHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/PermissionScopeHandler.java @@ -59,6 +59,7 @@ public class PermissionScopeHandler extends HttpServlet { proxyResponse.setCode(HttpStatus.SC_OK); proxyResponse.setData(jsonObject.toString()); HandlerUtil.handleSuccess(resp, proxyResponse); + return; } HandlerUtil.handleError(resp, null); } diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java index ab702eb9ad..9e4cb0c70b 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java @@ -507,8 +507,14 @@ public class HandlerUtil { if (log.isDebugEnabled()) { log.debug("refreshing the token"); } - HttpPost tokenEndpoint = new HttpPost( - gatewayUrl + HandlerConstants.TOKEN_ENDPOINT); + String iotsCorePort = System.getProperty("iot.core.https.port"); + if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { + iotsCorePort = System.getProperty("iot.core.http.port"); + } + String iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") + + HandlerConstants.COLON + iotsCorePort; + + HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); HttpSession session = req.getSession(false); if (session == null) { log.error("Couldn't find a session, hence it is required to login and proceed."); From 4203226aa511d7230a829d88b32a8a8dfa7cc423 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 24 Aug 2021 15:08:38 +0530 Subject: [PATCH 43/54] fixed tenant enrol issue --- ...ApiApplicationRegistrationServiceImpl.java | 2 +- .../src/main/webapp/WEB-INF/web.xml | 6 ++- .../framework/WebappAuthenticationValve.java | 47 ++++++++++++++++++- 3 files changed, 51 insertions(+), 4 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java index 702db64527..471136864a 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/ApiApplicationRegistrationServiceImpl.java @@ -122,7 +122,7 @@ public class ApiApplicationRegistrationServiceImpl implements ApiApplicationRegi synchronized (ApiApplicationRegistrationServiceImpl.class) { ApiApplicationKey apiApplicationKey = apiManagementProviderService.generateAndRetrieveApplicationKeys( applicationName, registrationProfile.getTags(), - ApiApplicationConstants.DEFAULT_TOKEN_TYPE, username, + ApiApplicationConstants.DEFAULT_TOKEN_TYPE, registrationProfile.getUsername(), registrationProfile.isAllowedToAllDomains(), validityPeriod); return Response.status(Response.Status.CREATED).entity(apiApplicationKey.toString()).build(); } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml index b2d4acf3c4..ab313685bf 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml @@ -37,7 +37,7 @@ doAuthentication - false + true @@ -54,6 +54,10 @@ managed-api-owner admin + + resource-permission-validate + false + ApiPermissionFilter diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java index 9e73d08ffb..3864954fe9 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java @@ -18,6 +18,7 @@ */ package org.wso2.carbon.webapp.authenticator.framework; +import com.google.gson.Gson; import org.apache.catalina.Context; import org.apache.catalina.connector.Request; import org.apache.catalina.connector.Response; @@ -48,6 +49,9 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { private static final Log log = LogFactory.getLog(WebappAuthenticationValve.class); private static final TreeMap nonSecuredEndpoints = new TreeMap<>(); + private static final String PERMISSION_PREFIX = "/permission/admin"; + public static final String AUTHORIZE_PERMISSION = "Authorize-Permission"; + private static InetAddress inetAddress = null; @Override @@ -78,7 +82,8 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { } } - if ((this.isContextSkipped(request) || this.skipAuthentication(request))) { + if ((this.isContextSkipped(request) || this.skipAuthentication(request)) + && (StringUtils.isEmpty(request.getHeader(AUTHORIZE_PERMISSION)))) { this.getNext().invoke(request, response, compositeValve); return; } @@ -99,6 +104,39 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { // This section will allow to validate a given access token is authenticated to access given // resource(permission) if (request.getCoyoteRequest() != null + && StringUtils.isNotEmpty(request.getHeader(AUTHORIZE_PERMISSION)) + && (authenticationInfo.getStatus() == WebappAuthenticator.Status.CONTINUE || + authenticationInfo.getStatus() == WebappAuthenticator.Status.SUCCESS)) { + boolean isAllowed; + try { + isAllowed = AuthenticationFrameworkUtil.isUserAuthorized( + authenticationInfo.getTenantId(), authenticationInfo.getTenantDomain(), + authenticationInfo.getUsername(), + PERMISSION_PREFIX + request.getHeader (AUTHORIZE_PERMISSION)); + } catch (AuthenticationException e) { + String msg = "Could not authorize permission"; + log.error(msg); + AuthenticationFrameworkUtil.handleResponse(request, response, + HttpServletResponse.SC_INTERNAL_SERVER_ERROR, msg); + return; + } + + if (isAllowed) { + Gson gson = new Gson(); + AuthenticationFrameworkUtil.handleResponse(request, response, HttpServletResponse.SC_OK, + gson.toJson(authenticationInfo)); + return; + } else { + log.error("Unauthorized message from user " + authenticationInfo.getUsername()); + AuthenticationFrameworkUtil.handleResponse(request, response, + HttpServletResponse.SC_FORBIDDEN, "Unauthorized to access the API"); + return; + } + } + + // This section will allow to validate a given access token is authenticated to access permission defined per API + if (request.getCoyoteRequest() != null + && isResourcePermissionValidate(request) && (authenticationInfo.getStatus() == WebappAuthenticator.Status.CONTINUE || authenticationInfo.getStatus() == WebappAuthenticator.Status.SUCCESS)) { boolean isAllowed; @@ -112,7 +150,7 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { } } - Tenant tenant = null; + Tenant tenant = null; if (authenticationInfo.getTenantId() != -1) { try { PrivilegedCarbonContext.startTenantFlow(); @@ -178,6 +216,11 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { return (param != null && Boolean.parseBoolean(param)); } + private boolean isResourcePermissionValidate(Request request) { + String param = request.getContext().findParameter("resource-permission-validate"); + return (param == null) || Boolean.parseBoolean(param); + } + private boolean isContextSkipped(Request request) { Context context = request.getContext(); String ctx = context == null ? null :context.getPath(); From ee95c8aca1a96b3fb64f5f8cf2e3b39e352aec39 Mon Sep 17 00:00:00 2001 From: Pahansith Date: Wed, 25 Aug 2021 15:09:55 +0530 Subject: [PATCH 44/54] Fix location update timestamp overwrite issue --- .../details/mgt/dao/impl/DeviceDetailsDAOImpl.java | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java index 04eda09d86..d00cb1d1ed 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/device/details/mgt/dao/impl/DeviceDetailsDAOImpl.java @@ -286,7 +286,11 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO { stmt.setString(8, deviceLocation.getState()); stmt.setString(9, deviceLocation.getCountry()); stmt.setString(10, GeoHashGenerator.encodeGeohash(deviceLocation)); - stmt.setLong(11, System.currentTimeMillis()); + if (deviceLocation.getUpdatedTime() == null) { + stmt.setLong(11, System.currentTimeMillis()); + } else { + stmt.setLong(11, deviceLocation.getUpdatedTime().getTime()); + } stmt.setInt(12, enrollmentId); stmt.setDouble(13, deviceLocation.getAltitude()); stmt.setFloat(14, deviceLocation.getSpeed()); @@ -417,7 +421,11 @@ public class DeviceDetailsDAOImpl implements DeviceDetailsDAO { stmt.setDouble(6, deviceLocation.getLongitude()); stmt.setFloat(7, deviceLocation.getSpeed()); stmt.setFloat(8, deviceLocation.getBearing()); - stmt.setLong(9, System.currentTimeMillis()); + if (deviceLocation.getUpdatedTime() == null) { + stmt.setLong(9, System.currentTimeMillis()); + } else { + stmt.setLong(9, deviceLocation.getUpdatedTime().getTime()); + } stmt.setString(10, GeoHashGenerator.encodeGeohash(deviceLocation)); stmt.setString(11, device.getEnrolmentInfo().getOwner()); stmt.setDouble(12, deviceLocation.getAltitude()); From 5272293a3159d380572fff36b85df6d26eb8d7fd Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Tue, 31 Aug 2021 13:17:29 +0530 Subject: [PATCH 45/54] mdm config tags made configurable --- .../templates/repository/conf/mdm-ui-config.xml.j2 | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 index 68742071a6..ae1c8f4e6e 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/mdm-ui-config.xml.j2 @@ -37,14 +37,15 @@ - application_management - device_management - subscription_management - review_management {% if mdm_ui_conf.app_registration.tags is defined %} {%- for tag in mdm_ui_conf.app_registration.tags -%} {{tag}} {% endfor %} + {% else %} + application_management + device_management + subscription_management + review_management {% endif %} {% if mdm_ui_conf.app_registration.allow_to_all_domains is defined %} From a031579b80ef4e541b6abf09e66370e542dea677 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Wed, 15 Sep 2021 15:12:10 +0530 Subject: [PATCH 46/54] fixed gw, km, iot, apim urls --- .../publisher/APIPublisherServiceImpl.java | 2 +- .../interceptor/DefaultTokenHandler.java | 16 +++----- .../request/interceptor/InvokerHandler.java | 28 +++++++------ .../ui/request/interceptor/LoginHandler.java | 19 +++++---- .../interceptor/OTPInvokerHandler.java | 4 +- .../interceptor/SsoLoginCallbackHandler.java | 12 ++---- .../request/interceptor/SsoLoginHandler.java | 22 ++++++----- .../ui/request/interceptor/UserHandler.java | 10 ++--- .../interceptor/util/HandlerConstants.java | 6 +++ .../request/interceptor/util/HandlerUtil.java | 39 +++++++++++++++---- .../conf/webapp-authenticator-config.xml | 2 +- .../etc/webapp-authenticator-config.xml.j2 | 2 +- 12 files changed, 91 insertions(+), 71 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java index a3cc0525a2..3efc98ddb1 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -92,7 +92,7 @@ public class APIPublisherServiceImpl implements APIPublisherService { APIRevisionDeployment apiRevisionDeployment = new APIRevisionDeployment(); apiRevisionDeployment.setDeployment(API_PUBLISH_ENVIRONMENT); - apiRevisionDeployment.setVhost("localhost"); + apiRevisionDeployment.setVhost(System.getProperty("iot.gateway.host")); apiRevisionDeployment.setDisplayOnDevportal(true); List apiRevisionDeploymentList = new ArrayList<>(); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/DefaultTokenHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/DefaultTokenHandler.java index 7aaae1ca70..7c51545672 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/DefaultTokenHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/DefaultTokenHandler.java @@ -69,14 +69,10 @@ public class DefaultTokenHandler extends HttpServlet { String clientId = authData.getClientId(); String clientSecret = authData.getClientSecret(); - String iotsCorePort = System.getProperty("iot.core.https.port"); - if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { - iotsCorePort = System.getProperty("iot.core.http.port"); - } - - String tokenUrl = - req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") - + HandlerConstants.COLON + iotsCorePort + "/api/device-mgt/v1.0/devices/" + clientId + String iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + + System.getProperty(HandlerConstants.IOT_GW_HOST_ENV_VAR) + + HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme()); + String tokenUrl = iotsCoreUrl + "/api/device-mgt/v1.0/devices/" + clientId + "/" + clientSecret + "/default-token"; HttpGet defaultTokenRequest = new HttpGet(tokenUrl); @@ -131,8 +127,8 @@ public class DefaultTokenHandler extends HttpServlet { URIBuilder ub = new URIBuilder(); ub.setScheme(HandlerConstants.WSS_PROTOCOL); - ub.setHost(System.getProperty(HandlerConstants.IOT_CORE_HOST_ENV_VAR)); - ub.setPort(Integer.parseInt(System.getProperty(HandlerConstants.IOT_CORE_HTTPS_PORT_ENV_VAR))); + ub.setHost(System.getProperty(HandlerConstants.IOT_GW_HOST_ENV_VAR)); + ub.setPort(Integer.parseInt(System.getProperty(HandlerConstants.IOT_GW_HTTPS_PORT_ENV_VAR))); ub.setPath(HandlerConstants.REMOTE_SESSION_CONTEXT); JsonObject responseJsonObj = new JsonObject(); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java index 70004095f2..7cfe352548 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/InvokerHandler.java @@ -73,7 +73,7 @@ public class InvokerHandler extends HttpServlet { private static final long serialVersionUID = -6508020875358160165L; private static AuthData authData; private static String apiEndpoint; - private static String iotsCoreUrl; + private static String kmManagerUrl; @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) { @@ -85,7 +85,7 @@ public class InvokerHandler extends HttpServlet { ProxyResponse proxyResponse = HandlerUtil.execute(postRequest); if (HandlerConstants.TOKEN_IS_EXPIRED.equals(proxyResponse.getExecutorResponse())) { - proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, postRequest, apiEndpoint); + proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, postRequest, kmManagerUrl); if (proxyResponse == null) { return; } @@ -113,14 +113,14 @@ public class InvokerHandler extends HttpServlet { getRequest.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BEARER + authData.getAccessToken()); ProxyResponse proxyResponse = HandlerUtil.execute(getRequest); if (HandlerConstants.TOKEN_IS_EXPIRED.equals(proxyResponse.getExecutorResponse())) { - proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, getRequest, apiEndpoint); + proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, getRequest, kmManagerUrl); if (proxyResponse == null) { return; } } if (proxyResponse.getExecutorResponse().contains(HandlerConstants.EXECUTOR_EXCEPTION_PREFIX)) { if (proxyResponse.getCode() == HttpStatus.SC_UNAUTHORIZED) { - proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, getRequest, apiEndpoint); + proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, getRequest, kmManagerUrl); } else { log.error("Error occurred while invoking the GET API endpoint."); HandlerUtil.handleError(resp, proxyResponse); @@ -143,7 +143,7 @@ public class InvokerHandler extends HttpServlet { headRequest.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BEARER + authData.getAccessToken()); ProxyResponse proxyResponse = HandlerUtil.execute(headRequest); if (HandlerConstants.TOKEN_IS_EXPIRED.equals(proxyResponse.getExecutorResponse())) { - proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, headRequest, apiEndpoint); + proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, headRequest, kmManagerUrl); if (proxyResponse == null) { return; } @@ -170,7 +170,7 @@ public class InvokerHandler extends HttpServlet { ProxyResponse proxyResponse = HandlerUtil.execute(putRequest); if (HandlerConstants.TOKEN_IS_EXPIRED.equals(proxyResponse.getExecutorResponse())) { - proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, putRequest, apiEndpoint); + proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, putRequest, kmManagerUrl); if (proxyResponse == null) { return; } @@ -198,7 +198,7 @@ public class InvokerHandler extends HttpServlet { deleteRequest.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BEARER + authData.getAccessToken()); ProxyResponse proxyResponse = HandlerUtil.execute(deleteRequest); if (HandlerConstants.TOKEN_IS_EXPIRED.equals(proxyResponse.getExecutorResponse())) { - proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, deleteRequest, apiEndpoint); + proxyResponse = HandlerUtil.retryRequestWithRefreshedToken(req, resp, deleteRequest, kmManagerUrl); if (proxyResponse == null) { return; } @@ -302,9 +302,12 @@ public class InvokerHandler extends HttpServlet { */ private static boolean validateRequest(HttpServletRequest req, HttpServletResponse resp) throws IOException { - apiEndpoint = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.gateway.host") + apiEndpoint = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_GW_HOST_ENV_VAR) + HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme()); + kmManagerUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_KM_HOST_ENV_VAR) + + HandlerConstants.COLON + HandlerUtil.getKeymanagerPort(req.getScheme()); + if (HandlerConstants.REPORTS.equalsIgnoreCase(req.getHeader(HandlerConstants.APP_NAME))){ apiEndpoint = System.getProperty("iot.reporting.webapp.host"); if (StringUtils.isBlank(apiEndpoint)){ @@ -373,14 +376,9 @@ public class InvokerHandler extends HttpServlet { if (log.isDebugEnabled()) { log.debug("refreshing the token"); } - String iotsCorePort = System.getProperty("iot.core.https.port"); - if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { - iotsCorePort = System.getProperty("iot.core.http.port"); - } - iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") - + HandlerConstants.COLON + iotsCorePort; + HttpPost tokenEndpoint = new HttpPost( - iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); + kmManagerUrl + HandlerConstants.TOKEN_ENDPOINT); HttpSession session = req.getSession(false); if (session == null) { log.error("Couldn't find a session, hence it is required to login and proceed."); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java index 5acceaabfd..953fbf5a5c 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/LoginHandler.java @@ -59,7 +59,8 @@ public class LoginHandler extends HttpServlet { private static String password; private static String gatewayUrl; private static String uiConfigUrl; - private static String iotsCoreUrl; + private static String iotCoreUrl; + private static String kmManagerUrl; @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) { @@ -201,18 +202,16 @@ public class LoginHandler extends HttpServlet { * Define username and password static parameters. */ private static void validateLoginRequest(HttpServletRequest req) throws LoginException { - String iotsCorePort = System.getProperty(HandlerConstants.IOT_CORE_HTTPS_PORT_ENV_VAR); - if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { - iotsCorePort = System.getProperty(HandlerConstants.IOT_CORE_HTTP_PORT_ENV_VAR); - } username = req.getParameter("username"); password = req.getParameter("password"); gatewayUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_GW_HOST_ENV_VAR) + HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme()); - uiConfigUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_CORE_HOST_ENV_VAR) - + HandlerConstants.COLON + iotsCorePort + HandlerConstants.UI_CONFIG_ENDPOINT; - iotsCoreUrl = HandlerConstants.HTTPS_PROTOCOL + HandlerConstants.SCHEME_SEPARATOR + - System.getProperty(HandlerConstants.IOT_CORE_HOST_ENV_VAR) + HandlerConstants.COLON + iotsCorePort; + iotCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_CORE_HOST_ENV_VAR) + + HandlerConstants.COLON + HandlerUtil.getCorePort(req.getScheme()); + uiConfigUrl = iotCoreUrl + HandlerConstants.UI_CONFIG_ENDPOINT; + kmManagerUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_KM_HOST_ENV_VAR) + + HandlerConstants.COLON + HandlerUtil.getKeymanagerPort(req.getScheme()); + if (username == null || password == null) { String msg = "Invalid login request. Username or Password is not received for login request."; log.error(msg); @@ -229,7 +228,7 @@ public class LoginHandler extends HttpServlet { * @throws IOException IO exception throws if an error occurred when invoking token endpoint */ private ProxyResponse getTokenResult(String encodedClientApp, JsonArray scopes) throws IOException { - HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl+ HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(kmManagerUrl+ HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + encodedClientApp); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); String scopeString = HandlerUtil.getScopeString(scopes); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/OTPInvokerHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/OTPInvokerHandler.java index 7194001cca..c852cce259 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/OTPInvokerHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/OTPInvokerHandler.java @@ -241,8 +241,8 @@ public class OTPInvokerHandler extends HttpServlet { private static boolean validateRequest(HttpServletRequest req, HttpServletResponse resp) throws IOException { String schema = req.getScheme(); - apiEndpoint = schema + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_CORE_HOST_ENV_VAR) - + HandlerConstants.COLON + HandlerUtil.getCorePort(schema); + apiEndpoint = schema + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_GW_HOST_ENV_VAR) + + HandlerConstants.COLON + HandlerUtil.getGatewayPort(schema); if (StringUtils.isBlank(req.getHeader(HandlerConstants.OTP_HEADER))) { log.error("Unauthorized, Please provide OTP token."); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java index 4bd8a3daaa..d402f4795e 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginCallbackHandler.java @@ -49,15 +49,11 @@ public class SsoLoginCallbackHandler extends HttpServlet { protected void doGet(HttpServletRequest req, HttpServletResponse resp) throws IOException { String code = req.getParameter("code"); HttpSession session = req.getSession(false); - String iotsCorePort = System.getProperty(HandlerConstants.IOT_CORE_HTTPS_PORT_ENV_VAR); - if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { - iotsCorePort = System.getProperty(HandlerConstants.IOT_CORE_HTTP_PORT_ENV_VAR); - } - String gatewayUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_GW_HOST_ENV_VAR) - + HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme()); String iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_CORE_HOST_ENV_VAR) - + HandlerConstants.COLON + iotsCorePort; + + HandlerConstants.COLON + HandlerUtil.getCorePort(req.getScheme()); + String keyManagerUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_KM_HOST_ENV_VAR) + + HandlerConstants.COLON + HandlerUtil.getKeymanagerPort(req.getScheme()); if (session == null) { String baseContextPath = req.getContextPath(); @@ -72,7 +68,7 @@ public class SsoLoginCallbackHandler extends HttpServlet { String scope = session.getAttribute("scope").toString(); - HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(keyManagerUrl + HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + session.getAttribute("encodedClientApp")); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java index 7b93b9cad8..f76f72a958 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/SsoLoginHandler.java @@ -72,6 +72,8 @@ public class SsoLoginHandler extends HttpServlet { private static String adminPassword; private static String gatewayUrl; private static String iotsCoreUrl; + private static String apiMgtUrl; + private static String keyManagerUrl; private static int sessionTimeOut; private static String encodedAdminCredentials; private static String encodedClientApp; @@ -99,14 +101,14 @@ public class SsoLoginHandler extends HttpServlet { baseContextPath = req.getContextPath(); applicationName = baseContextPath.substring(1, baseContextPath.indexOf("-ui-request-handler")); - String iotsCorePort = System.getProperty(HandlerConstants.IOT_CORE_HTTPS_PORT_ENV_VAR); - if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { - iotsCorePort = System.getProperty(HandlerConstants.IOT_CORE_HTTP_PORT_ENV_VAR); - } gatewayUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_GW_HOST_ENV_VAR) + HandlerConstants.COLON + HandlerUtil.getGatewayPort(req.getScheme()); iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_CORE_HOST_ENV_VAR) - + HandlerConstants.COLON + iotsCorePort; + + HandlerConstants.COLON + HandlerUtil.getCorePort(req.getScheme()); + apiMgtUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_APIM_HOST_ENV_VAR) + + HandlerConstants.COLON + HandlerUtil.getAPIManagerPort(req.getScheme()); + keyManagerUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty(HandlerConstants.IOT_KM_HOST_ENV_VAR) + + HandlerConstants.COLON + HandlerUtil.getKeymanagerPort(req.getScheme()); // Fetch ui config and persists in session String uiConfigUrl = iotsCoreUrl + HandlerConstants.UI_CONFIG_ENDPOINT; @@ -127,7 +129,7 @@ public class SsoLoginHandler extends HttpServlet { persistAuthSessionData(req, oAuthApp.getClientId(), oAuthApp.getClientSecret(), oAuthApp.getEncodedClientApp(), scopesSsoString); - resp.sendRedirect(iotsCoreUrl + HandlerConstants.AUTHORIZATION_ENDPOINT + + resp.sendRedirect(keyManagerUrl + HandlerConstants.AUTHORIZATION_ENDPOINT + "?response_type=code" + "&client_id=" + clientId + "&state=" + @@ -193,7 +195,7 @@ public class SsoLoginHandler extends HttpServlet { } // Get the details of the registered application - String getApplicationEndpointUrl = iotsCoreUrl + HandlerConstants.APIM_APPLICATIONS_ENDPOINT + + String getApplicationEndpointUrl = apiMgtUrl + HandlerConstants.APIM_APPLICATIONS_ENDPOINT + "?query=" + applicationName; HttpGet getApplicationEndpoint = new HttpGet(getApplicationEndpointUrl); getApplicationEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BEARER + @@ -224,7 +226,7 @@ public class SsoLoginHandler extends HttpServlet { } // Update the grant types of the application - String url = iotsCoreUrl + HandlerConstants.APIM_APPLICATIONS_ENDPOINT + applicationId + "/keys/" + + String url = apiMgtUrl + HandlerConstants.APIM_APPLICATIONS_ENDPOINT + applicationId + "/keys/" + HandlerConstants.PRODUCTION_KEY; HttpPut updateApplicationGrantTypesEndpoint = new HttpPut(url); updateApplicationGrantTypesEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BEARER + @@ -323,7 +325,7 @@ public class SsoLoginHandler extends HttpServlet { * @throws IOException IO exception throws if an error occurred when invoking token endpoint */ private ProxyResponse getTokenResult(String encodedClientApp) throws IOException { - HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(keyManagerUrl + HandlerConstants.TOKEN_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + encodedClientApp); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); @@ -372,7 +374,7 @@ public class SsoLoginHandler extends HttpServlet { */ private void updateSaasApp(String appName) throws ParserConfigurationException, IOException, SAXException { File getAppRequestXmlFile = new File(HandlerConstants.PAYLOADS_DIR + "/get-app-request.xml"); - String identityAppMgtUrl = iotsCoreUrl + HandlerConstants.IDENTITY_APP_MGT_ENDPOINT; + String identityAppMgtUrl = apiMgtUrl + HandlerConstants.IDENTITY_APP_MGT_ENDPOINT; HttpPost getApplicationEndpoint = new HttpPost(identityAppMgtUrl); getApplicationEndpoint.setHeader(HttpHeaders.AUTHORIZATION, HandlerConstants.BASIC + diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java index ef334b8940..170030f399 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/UserHandler.java @@ -54,10 +54,10 @@ public class UserHandler extends HttpServlet { @Override protected void doPost(HttpServletRequest req, HttpServletResponse resp) { try { - String serverUrl = + String keymanagerUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + - System.getProperty(HandlerConstants.IOT_CORE_HOST_ENV_VAR) - + HandlerConstants.COLON + HandlerUtil.getCorePort(req.getScheme()); + System.getProperty(HandlerConstants.IOT_KM_HOST_ENV_VAR) + + HandlerConstants.COLON + HandlerUtil.getKeymanagerPort(req.getScheme()); HttpSession httpSession = req.getSession(false); if (httpSession == null) { HandlerUtil.sendUnAuthorizeResponse(resp); @@ -72,7 +72,7 @@ public class UserHandler extends HttpServlet { String accessToken = authData.getAccessToken(); - HttpPost tokenEndpoint = new HttpPost(serverUrl + HandlerConstants.INTROSPECT_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(keymanagerUrl + HandlerConstants.INTROSPECT_ENDPOINT); tokenEndpoint.setHeader(HttpHeaders.CONTENT_TYPE, ContentType.APPLICATION_FORM_URLENCODED.toString()); DeviceManagementConfig dmc = DeviceConfigurationManager.getInstance().getDeviceManagementConfig(); String adminUsername = dmc.getKeyManagerConfigurations().getAdminUsername(); @@ -86,7 +86,7 @@ public class UserHandler extends HttpServlet { if (tokenStatus.getExecutorResponse().contains(HandlerConstants.EXECUTOR_EXCEPTION_PREFIX)) { if (tokenStatus.getCode() == HttpStatus.SC_UNAUTHORIZED) { - tokenStatus = HandlerUtil.retryRequestWithRefreshedToken(req, resp, tokenEndpoint, serverUrl); + tokenStatus = HandlerUtil.retryRequestWithRefreshedToken(req, resp, tokenEndpoint, keymanagerUrl); } else { log.error("Error occurred while invoking the API to get token status."); HandlerUtil.handleError(resp, tokenStatus); diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java index f2303aba47..3b278ffb5b 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerConstants.java @@ -78,6 +78,12 @@ public class HandlerConstants { public static final String IOT_CORE_HOST_ENV_VAR = "iot.core.host"; public static final String IOT_CORE_HTTP_PORT_ENV_VAR = "iot.core.http.port"; public static final String IOT_CORE_HTTPS_PORT_ENV_VAR = "iot.core.https.port"; + public static final String IOT_APIM_HOST_ENV_VAR = "iot.apim.host"; + public static final String IOT_APIM_HTTP_PORT_ENV_VAR = "iot.apim.http.port"; + public static final String IOT_APIM_HTTPS_PORT_ENV_VAR = "iot.apim.https.port"; + public static final String IOT_KM_HOST_ENV_VAR = "iot.keymanager.host"; + public static final String IOT_KM_HTTP_PORT_ENV_VAR = "iot.keymanager.http.port"; + public static final String IOT_KM_HTTPS_PORT_ENV_VAR = "iot.keymanager.https.port"; public static final String IOT_GW_HOST_ENV_VAR = "iot.gateway.host"; public static final String IOT_GW_HTTP_PORT_ENV_VAR = "iot.gateway.http.port"; public static final String IOT_GW_HTTPS_PORT_ENV_VAR = "iot.gateway.https.port"; diff --git a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java index 9e4cb0c70b..48812430f4 100644 --- a/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java +++ b/components/ui-request-interceptor/io.entgra.ui.request.interceptor/src/main/java/io/entgra/ui/request/interceptor/util/HandlerUtil.java @@ -244,6 +244,35 @@ public class HandlerUtil { } } + /** + * Get api manager port according to request received scheme + * + * @param scheme https or https + * @return {@link String} api manager port + */ + public static String getAPIManagerPort(String scheme) { + String apiManagerPort = System.getProperty(HandlerConstants.IOT_APIM_HTTPS_PORT_ENV_VAR); + if (HandlerConstants.HTTP_PROTOCOL.equals(scheme)) { + apiManagerPort = System.getProperty(HandlerConstants.IOT_APIM_HTTP_PORT_ENV_VAR); + } + return apiManagerPort; + } + + + /** + * Get keymanager port according to request received scheme + * + * @param scheme https or https + * @return {@link String} keymanager port + */ + public static String getKeymanagerPort(String scheme) { + String keymanagerPort = System.getProperty(HandlerConstants.IOT_KM_HTTPS_PORT_ENV_VAR); + if (HandlerConstants.HTTP_PROTOCOL.equals(scheme)) { + keymanagerPort = System.getProperty(HandlerConstants.IOT_KM_HTTP_PORT_ENV_VAR); + } + return keymanagerPort; + } + /** * Get gateway port according to request received scheme * @@ -502,19 +531,13 @@ public class HandlerUtil { * @return If successfully renew tokens, returns TRUE otherwise return FALSE * @throws IOException If an error occurs while witting error response to client side or invoke token renewal API */ - private static boolean refreshToken(HttpServletRequest req, HttpServletResponse resp, String gatewayUrl) + private static boolean refreshToken(HttpServletRequest req, HttpServletResponse resp, String keymanagerUrl) throws IOException { if (log.isDebugEnabled()) { log.debug("refreshing the token"); } - String iotsCorePort = System.getProperty("iot.core.https.port"); - if (HandlerConstants.HTTP_PROTOCOL.equals(req.getScheme())) { - iotsCorePort = System.getProperty("iot.core.http.port"); - } - String iotsCoreUrl = req.getScheme() + HandlerConstants.SCHEME_SEPARATOR + System.getProperty("iot.core.host") - + HandlerConstants.COLON + iotsCorePort; - HttpPost tokenEndpoint = new HttpPost(iotsCoreUrl + HandlerConstants.TOKEN_ENDPOINT); + HttpPost tokenEndpoint = new HttpPost(keymanagerUrl + HandlerConstants.TOKEN_ENDPOINT); HttpSession session = req.getSession(false); if (session == null) { log.error("Couldn't find a session, hence it is required to login and proceed."); diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml index da403d707d..8a8cbcdde7 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml @@ -7,7 +7,7 @@ false https://${iot.keymanager.host}:${iot.keymanager.https.port} ${admin.username} - ${admin.username} + ${admin.password} 100 100 diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-authenticator-config.xml.j2 b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-authenticator-config.xml.j2 index 42ee60946a..631307ad2c 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-authenticator-config.xml.j2 +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf_templates/templates/repository/conf/etc/webapp-authenticator-config.xml.j2 @@ -15,7 +15,7 @@ false https://${iot.keymanager.host}:${iot.keymanager.https.port} ${admin.username} - ${admin.username} + ${admin.password} 100 100 From de963fa01b25dcf9efb9d98075076e0cf085cce5 Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Fri, 24 Sep 2021 15:38:07 +0530 Subject: [PATCH 47/54] updating existing shared scope not required --- .../apimgt/webapp/publisher/APIPublisherServiceImpl.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java index 3efc98ddb1..99d187b2f4 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -135,14 +135,6 @@ public class APIPublisherServiceImpl implements APIPublisherService { scope.setRoles(apiScope.getRoles()); apiProvider.addSharedScope(scope, tenantDomain); } - } else { - // if already available as shared scope -> update - Scope scope = new Scope(); - scope.setName(apiScope.getName()); - scope.setDescription(apiScope.getDescription()); - scope.setKey(apiScope.getKey()); - scope.setRoles(apiScope.getRoles()); - apiProvider.updateSharedScope(scope, tenantDomain); } } From 7bb616075ab866d4ae15e056c40e99758bef724c Mon Sep 17 00:00:00 2001 From: Amalka Subasinghe Date: Fri, 1 Oct 2021 11:03:40 +0530 Subject: [PATCH 48/54] fixed issue in updating apis --- .../publisher/APIPublisherServiceImpl.java | 29 ++++++++++++++----- 1 file changed, 22 insertions(+), 7 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java index 99d187b2f4..34c9348e24 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/APIPublisherServiceImpl.java @@ -162,15 +162,30 @@ public class APIPublisherServiceImpl implements APIPublisherService { api.setStatus(existingAPI.getStatus()); apiProvider.updateAPI(api); + // Assumption: Assume the latest revision is the published one + String latestRevisionUUID = apiProvider.getLatestRevisionUUID(existingAPI.getUuid()); + List latestRevisionDeploymentList = + apiProvider.getAPIRevisionDeploymentList(latestRevisionUUID); + + List apiRevisionList = apiProvider.getAPIRevisions(existingAPI.getUuid()); + if (apiRevisionList.size() >= 5) { + String earliestRevisionUUID = apiProvider.getEarliestRevisionUUID(existingAPI.getUuid()); + List earliestRevisionDeploymentList = + apiProvider.getAPIRevisionDeploymentList(earliestRevisionUUID); + apiProvider.undeployAPIRevisionDeployment(existingAPI.getUuid(), earliestRevisionUUID, earliestRevisionDeploymentList); + apiProvider.deleteAPIRevision(existingAPI.getUuid(), earliestRevisionUUID, tenantDomain); + } + + // create new revision + APIRevision apiRevision = new APIRevision(); + apiRevision.setApiUUID(existingAPI.getUuid()); + apiRevision.setDescription("Updated Revision"); + String apiRevisionId = apiProvider.addAPIRevision(apiRevision, tenantDomain); + + apiProvider.deployAPIRevision(existingAPI.getUuid(), apiRevisionId, latestRevisionDeploymentList); + if (CREATED_STATUS.equals(existingAPI.getStatus())) { apiProvider.changeLifeCycleStatus(tenantDomain, existingAPI.getUuid(), PUBLISH_ACTION, null); - APIRevision apiRevision = new APIRevision(); - apiRevision.setApiUUID(existingAPI.getUuid()); - apiRevision.setDescription("Updated Revision"); - String apiRevisionId = apiProvider.addAPIRevision(apiRevision, tenantDomain); - - List apiRevisionDeploymentList = apiProvider.getAPIRevisionDeploymentList(apiRevisionId); - apiProvider.deployAPIRevision(existingAPI.getUuid(), apiRevisionId, apiRevisionDeploymentList); } } } From 9a86d2fe0620c417310d90b0a38d3071b9d350e5 Mon Sep 17 00:00:00 2001 From: Pahansith Date: Tue, 24 Aug 2021 13:12:38 +0530 Subject: [PATCH 49/54] Add missing scope for the device info operation button --- .../src/main/resources/conf/mdm-ui-config.xml | 1 + 1 file changed, 1 insertion(+) diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml index aa3f169a33..88d9b47d29 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml @@ -183,6 +183,7 @@ perm:metadata:update perm:android:google-account perm:android:update-default-sim + perm:android:info device-mgt From 6393276503235230fa819c3a9c7636aa7498f2c7 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 9 Sep 2021 17:23:40 +0530 Subject: [PATCH 50/54] Fix having UPPER in query of groups retrieval (cherry picked from commit 4681447ba95ec86226a3458b73406b050a1a0243) --- .../carbon/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java index f535138521..7584b5fea7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/dao/impl/AbstractGroupDAOImpl.java @@ -73,10 +73,10 @@ public abstract class AbstractGroupDAOImpl implements GroupDAO { String sql = "SELECT ID, DESCRIPTION, GROUP_NAME, OWNER, STATUS, PARENT_PATH FROM DM_GROUP " + "WHERE TENANT_ID = ?"; if (StringUtils.isNotBlank(request.getGroupName())) { - sql += " AND UPPER(GROUP_NAME) LIKE ?"; + sql += " AND GROUP_NAME LIKE ?"; } if (StringUtils.isNotBlank(request.getOwner())) { - sql += " AND UPPER(OWNER) LIKE ?"; + sql += " AND OWNER LIKE ?"; } if (StringUtils.isNotBlank(request.getStatus())) { sql += " AND STATUS = ?"; From eb05fb9a3fdb0bb77b575c2b484bace3c6661e5b Mon Sep 17 00:00:00 2001 From: sandaru Date: Mon, 13 Sep 2021 14:18:29 +0530 Subject: [PATCH 51/54] Fix web-clip install issue (cherry picked from commit ebe9842d9a7a3dda8c965c55c55708170bf05682) --- .../device/mgt/core/util/MDMAndroidOperationUtil.java | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java index 99cacfd950..a1e5210948 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/util/MDMAndroidOperationUtil.java @@ -68,7 +68,9 @@ public class MDMAndroidOperationUtil { WebApplication webApplication = new WebApplication(); webApplication.setUrl(application.getLocation()); webApplication.setName(application.getName()); - webApplication.setType(application.getType().toString()); +// webApplication.setType(application.getType().toString()); +// Hard-corded "type" to "webapp". Some agent versions accept only "webapp" as the type. + webApplication.setType("webapp"); webApplication.setProperties(application.getProperties()); operation.setPayLoad(webApplication.toJSON()); break; @@ -111,7 +113,9 @@ public class MDMAndroidOperationUtil { WebApplication webApplication = new WebApplication(); webApplication.setUrl(application.getLocation()); webApplication.setName(application.getName()); - webApplication.setType(application.getType().toString()); +// webApplication.setType(application.getType().toString()); +// Hard-corded "type" to "webapp". Some agent versions accept only "webapp" as the type. + webApplication.setType("webapp"); operation.setPayLoad(webApplication.toJSON()); break; default: From 1434a27cde7f31bba13e6864874b5d5e5678e723 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Thu, 23 Sep 2021 18:46:11 +0530 Subject: [PATCH 52/54] Add new device status ASSIGNED (cherry picked from commit 68405ed2295d88d2be945422d19088d10ad64f9a) --- .../java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java index 24c9916066..2e7376ec81 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/src/main/java/org/wso2/carbon/device/mgt/common/EnrolmentInfo.java @@ -32,7 +32,7 @@ public class EnrolmentInfo implements Serializable { public enum Status { CREATED, ACTIVE, INACTIVE, UNREACHABLE, UNCLAIMED, SUSPENDED, BLOCKED, REMOVED, DISENROLLMENT_REQUESTED, CONFIGURED, READY_TO_CONNECT, RETURN_PENDING, RETURNED, DEFECTIVE, WARRANTY_PENDING, WARRANTY_SENT, - WARRANTY_REPLACED + WARRANTY_REPLACED, ASSIGNED } public enum OwnerShip { From b3a229a0e72d6831e55e832db6da436b8b407548 Mon Sep 17 00:00:00 2001 From: Saad Sahibjan Date: Sat, 25 Sep 2021 18:58:23 +0530 Subject: [PATCH 53/54] Update device property table in dm db when updating properties (cherry picked from commit 5f64b0b1ad938f92353f55a97da96a7c7b0e55ba) --- .../type/template/DeviceTypeManager.java | 27 ++++++++++++++++--- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java index 2022447e64..7e65a244e9 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/src/main/java/org/wso2/carbon/device/mgt/extensions/device/type/template/DeviceTypeManager.java @@ -489,13 +489,14 @@ public class DeviceTypeManager implements DeviceManager { throws DeviceManagementException { boolean status = false; if (propertiesExist) { + Device updatedDevice = new Device(); + updatedDevice.setDeviceIdentifier(deviceId.getId()); + updatedDevice.setProperties(propertyList); try { if (log.isDebugEnabled()) { - log.debug("Getting the details of " + deviceType + " device : '" + deviceId.getId() + "'"); + log.debug("Updating device properties of " + deviceType + " device : '" + + deviceId.getId() + "'"); } - Device updatedDevice = new Device(); - updatedDevice.setDeviceIdentifier(deviceId.getId()); - updatedDevice.setProperties(propertyList); deviceTypePluginDAOManager.getDeviceTypeDAOHandler().beginTransaction(); status = deviceTypePluginDAOManager.getDeviceDAO().updateDevice(updatedDevice); deviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction(); @@ -506,6 +507,24 @@ public class DeviceTypeManager implements DeviceManager { } finally { deviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); } + if (propertyBasedDeviceTypePluginDAOManager != null && status) { + try { + if (log.isDebugEnabled()) { + log.debug("Updating device properties of " + deviceType + " device : '" + + deviceId.getId() + "'"); + } + propertyBasedDeviceTypePluginDAOManager.getDeviceTypeDAOHandler().beginTransaction(); + status = propertyBasedDeviceTypePluginDAOManager.getDeviceDAO().updateDevice(updatedDevice); + propertyBasedDeviceTypePluginDAOManager.getDeviceTypeDAOHandler().commitTransaction(); + } catch (DeviceTypeMgtPluginException e) { + propertyBasedDeviceTypePluginDAOManager.getDeviceTypeDAOHandler().rollbackTransaction(); + String msg = "Error while updating properties for " + deviceType + " device : " + + deviceId.getId(); + throw new DeviceManagementException(msg, e); + } finally { + propertyBasedDeviceTypePluginDAOManager.getDeviceTypeDAOHandler().closeConnection(); + } + } } return status; } From f22fc7e46042d5240cb0998e896dc0e072a678c8 Mon Sep 17 00:00:00 2001 From: Pahansith Gunathilake Date: Sun, 3 Oct 2021 15:49:37 +0000 Subject: [PATCH 54/54] Fix test cases kernel-4.6.x --- .../pom.xml | 4 + .../publisher/BaseAPIPublisherTest.java | 12 +- .../io.entgra.application.mgt.core/pom.xml | 6 + .../management/ApplicationManagementTest.java | 65 ++++++---- .../pom.xml | 6 + .../org.wso2.carbon.device.mgt.api/pom.xml | 93 +++++++------ .../service/impl/DeviceAgentServiceTest.java | 122 ------------------ .../DeviceAccessAuthorizationServiceTest.java | 2 +- .../mgt/PermissionManagerServiceTest.java | 60 ++++----- .../GroupManagementProviderServiceTest.java | 60 +++++---- .../mgt/core/PolicyEvaluationTestCase.java | 8 +- .../pom.xml | 24 ++-- .../BaseWebAppAuthenticatorFrameworkTest.java | 1 + .../WebappAuthenticationValveTest.java | 22 +++- .../carbon-home/repository/conf/registry.xml | 100 +++++++------- pom.xml | 7 +- 16 files changed, 258 insertions(+), 334 deletions(-) diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index 1934338712..e4cf00b565 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -220,5 +220,9 @@ + + + true + diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/BaseAPIPublisherTest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/BaseAPIPublisherTest.java index dd2d111c34..cc1c8e757a 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/BaseAPIPublisherTest.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/test/java/org/wso2/carbon/apimgt/webapp/publisher/BaseAPIPublisherTest.java @@ -22,22 +22,11 @@ import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.mockito.Mockito; import org.testng.annotations.BeforeSuite; -import org.wso2.carbon.apimgt.integration.client.IntegrationClientServiceImpl; -import org.wso2.carbon.apimgt.integration.client.internal.APIIntegrationClientDataHolder; -import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient; -import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; -import org.wso2.carbon.apimgt.integration.generated.client.publisher.api.APIIndividualApi; import org.wso2.carbon.apimgt.webapp.publisher.internal.APIPublisherDataHolder; import org.wso2.carbon.apimgt.webapp.publisher.utils.MockAPIIndividualApi; import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.context.internal.OSGiDataHolder; -import org.wso2.carbon.identity.jwt.client.extension.JWTClient; -import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo; -import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; -import org.wso2.carbon.identity.jwt.client.extension.internal.JWTClientExtensionDataHolder; -import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerService; -import org.wso2.carbon.identity.jwt.client.extension.service.JWTClientManagerServiceImpl; import org.wso2.carbon.registry.core.config.RegistryContext; import org.wso2.carbon.registry.core.exceptions.RegistryException; import org.wso2.carbon.registry.core.internal.RegistryDataHolder; @@ -45,6 +34,7 @@ import org.wso2.carbon.registry.core.jdbc.realm.InMemoryRealmService; import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.user.api.UserStoreException; import org.wso2.carbon.user.core.service.RealmService; +import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientException; import java.io.File; import java.io.InputStream; diff --git a/components/application-mgt/io.entgra.application.mgt.core/pom.xml b/components/application-mgt/io.entgra.application.mgt.core/pom.xml index 05104b8b57..5ca9f9a655 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/pom.xml +++ b/components/application-mgt/io.entgra.application.mgt.core/pom.xml @@ -258,6 +258,12 @@ 5.1.34 test + + xerces.wso2 + xercesImpl + 2.8.1.wso2v2 + test + com.h2database.wso2 h2-database-engine diff --git a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java index 2652cbf714..998e10e5b1 100644 --- a/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java +++ b/components/application-mgt/io.entgra.application.mgt.core/src/test/java/io/entgra/application/mgt/core/management/ApplicationManagementTest.java @@ -20,6 +20,7 @@ package io.entgra.application.mgt.core.management; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.apache.cxf.jaxrs.ext.multipart.Attachment; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import io.entgra.application.mgt.common.*; import io.entgra.application.mgt.common.dto.ApplicationDTO; @@ -40,6 +41,7 @@ import io.entgra.application.mgt.core.dto.ApplicationsDTO; import io.entgra.application.mgt.core.impl.ApplicationManagerImpl; import io.entgra.application.mgt.core.internal.DataHolder; import io.entgra.application.mgt.core.util.ConnectionManagerUtil; +import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.exceptions.DeviceManagementException; import org.wso2.carbon.device.mgt.core.dto.DeviceType; import org.wso2.carbon.device.mgt.core.dto.DeviceTypeVersion; @@ -68,7 +70,7 @@ public class ApplicationManagementTest extends BaseTestCase { ConnectionManagerUtil.closeDBConnection(); } - @Test(dependsOnMethods = ("addApplicationCategories")) + @Test(dependsOnMethods = "addApplicationCategories") public void createApplication() throws Exception { log.debug("Creating the first application ....!"); @@ -124,102 +126,117 @@ public class ApplicationManagementTest extends BaseTestCase { manager.createEntApp(applicationWrapper, applicationArtifact); } - @Test + @DataProvider(name = "applicationIdDataProvider") + public static Object[][] applicationId() { + return new Object[][] {{-1}}; + } + + @DataProvider(name = "updateApplicationDataProvider") + public static Object[][] updateApplicationDataProvider() { + return new Object[][] {{-1, new ApplicationUpdateWrapper()}}; + } + + @DataProvider(name = "uuidDataProvider") + public static Object[][] uuidDataProvider() { + return new Object[][] {{"TEST_APP_UUID"}}; + } + + @Test(enabled = false) public void updateApplication(int applicationId, ApplicationUpdateWrapper applicationUpdateWrapper) throws ApplicationManagementException { } - @Test + @Test(enabled = false) public void deleteApplication(int applicationId) throws ApplicationManagementException { } - @Test + @Test(enabled = false) public void retireApplication(int applicationId) throws ApplicationManagementException { } - @Test + @Test(enabled = false) public void deleteApplicationRelease(String releaseUuid) throws ApplicationManagementException { } - @Test + @Test(enabled = false) public ApplicationList getApplications(Filter filter) throws ApplicationManagementException { return null; } - @Test + @Test(enabled = false) public Application getApplicationById(int id, String state) throws ApplicationManagementException { return null; } - @Test + @Test(enabled = false) public ApplicationRelease getApplicationReleaseByUUID(String uuid) throws ApplicationManagementException { return null; } - @Test + @Test(enabled = false) public ApplicationDTO getApplicationByUuid(String uuid, String state) throws ApplicationManagementException { return null; } - @Test + @Test(enabled = false) public ApplicationDTO getApplicationByRelease(String appReleaseUUID) throws ApplicationManagementException { return null; } - @Test + @Test(enabled = false) public List getLifecycleStateChangeFlow(String releaseUuid) throws ApplicationManagementException { return null; } - @Test + @Test(enabled = false) public void changeLifecycleState(String releaseUuid, String stateName) throws ApplicationManagementException { } - @Test + @Test(enabled = false) public void updateApplicationImageArtifact(String uuid, ApplicationArtifact applicationArtifact) throws ApplicationManagementException { } - @Test + @Test(enabled = false) public void updateApplicationArtifact(String deviceType, String appType, String uuid, ApplicationArtifact applicationArtifact) throws ApplicationManagementException { } - @Test + @Test(enabled = false) public ApplicationRelease createRelease(int applicationId, EntAppReleaseWrapper entAppReleaseWrapper, ApplicationArtifact applicationArtifact) throws ApplicationManagementException { return null; } - @Test + @Test(enabled = false) public boolean updateRelease(String deviceType, String applicationType, String releaseUuid, EntAppReleaseWrapper entAppReleaseWrapper, ApplicationArtifact applicationArtifact) throws ApplicationManagementException { return false; } - @Test + @Test(enabled = false) public void validateAppCreatingRequest(ApplicationWrapper applicationWrapper) throws RequestValidatingException { } - @Test + @Test(enabled = false) public void validateReleaseCreatingRequest(EntAppReleaseWrapper entAppReleaseWrapper, String applicationType) throws RequestValidatingException { } - @Test + @Test(enabled = false) public void validateImageArtifacts(Attachment iconFile, Attachment bannerFile, List attachmentList) throws RequestValidatingException { } - @Test + @Test(enabled = false) public void validateBinaryArtifact(Attachment binaryFile, String applicationType) throws RequestValidatingException { } - @Test(dependsOnMethods = ("addDeviceVersions")) + @Test(dependsOnMethods = "addDeviceVersions") public void addApplicationCategories() throws ApplicationManagementException { List categories = new ArrayList<>(); categories.add("Test Category"); @@ -264,17 +281,17 @@ public class ApplicationManagementTest extends BaseTestCase { } } - @Test + @Test(enabled = false) public List getRegisteredTags() throws ApplicationManagementException { return null; } - @Test + @Test(enabled = false) public List getRegisteredCategories() throws ApplicationManagementException { return null; } - @Test + @Test(enabled = false) public void deleteTagMapping(int appId, String tagName) throws ApplicationManagementException { } diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index b129c7affa..9f7a444da1 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -200,6 +200,12 @@ h2-database-engine test + + org.wso2.carbon + org.wso2.carbon.securevault + + test + org.powermock powermock-api-mockito diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index d683786250..3c9272a596 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -145,11 +145,22 @@ + + org.testng + testng + test + org.springframework spring-web provided + + org.apache.cxf + cxf-bundle + 3.0.0-milestone2 + test + org.apache.cxf cxf-bundle-jaxrs @@ -190,11 +201,11 @@ org.wso2.carbon.device.mgt.common provided - - org.wso2.carbon.devicemgt - org.wso2.carbon.device.mgt.extensions - provided - + + org.wso2.carbon.devicemgt + org.wso2.carbon.device.mgt.extensions + provided + org.wso2.carbon.devicemgt org.wso2.carbon.device.mgt.core @@ -332,21 +343,21 @@ jsr311-api provided - - org.wso2.carbon.commons - org.wso2.carbon.application.mgt.stub - provided - + + org.wso2.carbon.commons + org.wso2.carbon.application.mgt.stub + provided + org.wso2.carbon.analytics org.wso2.carbon.analytics.api provided - - org.wso2.carbon.devicemgt - org.wso2.carbon.identity.jwt.client.extension - provided - + + org.wso2.carbon.devicemgt + org.wso2.carbon.identity.jwt.client.extension + provided + org.wso2.carbon org.wso2.carbon.registry.core @@ -363,31 +374,31 @@ ${carbon.identity.framework.version} provided - - - - - - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.receiver.stub - provided - - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.stream.stub - provided - - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.publisher.stub - provided - - - org.wso2.carbon.analytics-common - org.wso2.carbon.event.stream.persistence.stub - provided - + + + + + + + org.wso2.carbon.analytics-common + org.wso2.carbon.event.receiver.stub + provided + + + org.wso2.carbon.analytics-common + org.wso2.carbon.event.stream.stub + provided + + + org.wso2.carbon.analytics-common + org.wso2.carbon.event.publisher.stub + provided + + + org.wso2.carbon.analytics-common + org.wso2.carbon.event.stream.persistence.stub + provided + org.powermock powermock-module-testng @@ -415,4 +426,4 @@ provided - + \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java index 729b1827cd..05415a9671 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/test/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/DeviceAgentServiceTest.java @@ -34,9 +34,6 @@ import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.caching.impl.CacheImpl; import org.wso2.carbon.context.CarbonContext; import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; -import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; -import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherServiceImpl; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; import org.wso2.carbon.device.mgt.common.EnrolmentInfo; @@ -482,125 +479,6 @@ public class DeviceAgentServiceTest { Mockito.reset(eventStreamAdminServiceStub); } - @Test(description = "Test the error scenario of Publishing Events with null event attributes.") - public void testEventPublishWithEventAttributesNULLAndPublishEventsFailure() throws - DeviceAccessAuthorizationException, RemoteException { - PowerMockito.stub(PowerMockito.method(PrivilegedCarbonContext.class, "getThreadLocalCarbonContext")) - .toReturn(this.privilegedCarbonContext); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, - "getDeviceAccessAuthorizationService")).toReturn(this.deviceAccessAuthorizationService); - Mockito.when(this.deviceAccessAuthorizationService.isUserAuthorized(Mockito.any(DeviceIdentifier.class))) - .thenReturn(true); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getEventStreamAdminServiceStub")) - .toReturn(this.eventStreamAdminServiceStub); - EventStreamAttributeDto eventStreamAttributeDto = Mockito.mock(EventStreamAttributeDto.class, - Mockito.RETURNS_MOCKS); - EventStreamDefinitionDto eventStreamDefinitionDto = Mockito.mock(EventStreamDefinitionDto.class, - Mockito.RETURNS_MOCKS); - Mockito.when(this.eventStreamAdminServiceStub.getStreamDefinitionDto(Mockito.anyString())) - .thenReturn(eventStreamDefinitionDto); - Mockito.when(eventStreamDefinitionDto.getPayloadData()).thenReturn(new EventStreamAttributeDto[]{}); - EventsPublisherService eventPublisherService = Mockito.mock(EventsPublisherServiceImpl.class, - Mockito.RETURNS_MOCKS); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getEventPublisherService")) - .toReturn(eventPublisherService); - Map payload = new HashMap<>(); - CacheImpl cache = Mockito.mock(CacheImpl.class); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDynamicEventCache")) - .toReturn(cache); - Response response = this.deviceAgentService.publishEvents(payload, TEST_DEVICE_TYPE, TEST_DEVICE_IDENTIFIER); - Assert.assertNotNull(response, "Response should not be null"); - Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), - "The response status should be 500"); - List payloadList = new ArrayList<>(); - Response response2 = this.deviceAgentService.publishEvents(payloadList, TEST_DEVICE_TYPE, - TEST_DEVICE_IDENTIFIER); - Assert.assertNotNull(response2, "Response should not be null"); - Assert.assertEquals(response2.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), - "The response status should be 500"); - } - - @Test(description = "Test Event publishing success scenario.") - public void testEventPublishWithEventAttributesNULLAndPublishEventsSuccess() - throws DeviceAccessAuthorizationException, RemoteException, DataPublisherConfigurationException { - PowerMockito.stub(PowerMockito.method(PrivilegedCarbonContext.class, "getThreadLocalCarbonContext")) - .toReturn(this.privilegedCarbonContext); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, - "getDeviceAccessAuthorizationService")).toReturn(this.deviceAccessAuthorizationService); - Mockito.when(this.deviceAccessAuthorizationService.isUserAuthorized(Mockito.any(DeviceIdentifier.class))) - .thenReturn(true); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getEventStreamAdminServiceStub")) - .toReturn(this.eventStreamAdminServiceStub); - EventStreamAttributeDto eventStreamAttributeDto = Mockito.mock(EventStreamAttributeDto.class, - Mockito.RETURNS_MOCKS); - EventStreamDefinitionDto eventStreamDefinitionDto = Mockito.mock(EventStreamDefinitionDto.class, - Mockito.RETURNS_MOCKS); - Mockito.when(this.eventStreamAdminServiceStub.getStreamDefinitionDto(Mockito.anyString())) - .thenReturn(eventStreamDefinitionDto); - Mockito.when(eventStreamDefinitionDto.getPayloadData()).thenReturn(new EventStreamAttributeDto[]{}); - EventsPublisherService eventPublisherService = Mockito.mock(EventsPublisherServiceImpl.class, - Mockito.RETURNS_MOCKS); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getEventPublisherService")) - .toReturn(eventPublisherService); - Mockito.when(eventPublisherService.publishEvent(Mockito.anyString(), Mockito.anyString(), Mockito.any(), - Mockito.any(), Mockito.any())).thenReturn(true); - Map payload = new HashMap<>(); - CacheImpl cache = Mockito.mock(CacheImpl.class); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDynamicEventCache")) - .toReturn(cache); - Response response = this.deviceAgentService.publishEvents(payload, TEST_DEVICE_TYPE, TEST_DEVICE_IDENTIFIER); - Assert.assertNotNull(response, "Response should not be null"); - Assert.assertEquals(response.getStatus(), Response.Status.OK.getStatusCode(), - "The response status should be 200"); - List payloadList = new ArrayList<>(); - Response response2 = this.deviceAgentService.publishEvents(payloadList, - TEST_DEVICE_TYPE, TEST_DEVICE_IDENTIFIER); - Assert.assertNotNull(response2, "Response should not be null"); - Assert.assertEquals(response2.getStatus(), Response.Status.OK.getStatusCode(), - "The response status should be 200"); - } - - @Test(description = "Test event publishing when PublishEvents throws DataPublisherConfigurationException.") - public void testPublishEventsDataPublisherConfigurationException() throws DeviceAccessAuthorizationException, - RemoteException, DataPublisherConfigurationException { - PowerMockito.stub(PowerMockito.method(PrivilegedCarbonContext.class, "getThreadLocalCarbonContext")) - .toReturn(this.privilegedCarbonContext); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, - "getDeviceAccessAuthorizationService")).toReturn(this.deviceAccessAuthorizationService); - Mockito.when(this.deviceAccessAuthorizationService.isUserAuthorized(Mockito.any(DeviceIdentifier.class))) - .thenReturn(true); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getEventStreamAdminServiceStub")) - .toReturn(this.eventStreamAdminServiceStub); - EventStreamAttributeDto eventStreamAttributeDto = Mockito.mock(EventStreamAttributeDto.class, - Mockito.RETURNS_MOCKS); - EventStreamDefinitionDto eventStreamDefinitionDto = Mockito.mock(EventStreamDefinitionDto.class, - Mockito.RETURNS_MOCKS); - Mockito.when(this.eventStreamAdminServiceStub.getStreamDefinitionDto(Mockito.anyString())) - .thenReturn(eventStreamDefinitionDto); - Mockito.when(eventStreamDefinitionDto.getPayloadData()).thenReturn(new EventStreamAttributeDto[]{}); - EventsPublisherService eventPublisherService = Mockito.mock(EventsPublisherServiceImpl.class, - Mockito.RETURNS_MOCKS); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getEventPublisherService")) - .toReturn(eventPublisherService); - Mockito.when(eventPublisherService.publishEvent(Mockito.anyString(), Mockito.anyString(), Mockito.any(), - Mockito.any(), Mockito.any())).thenThrow( - new DataPublisherConfigurationException("meta data[0] should have the device Id field")); - Map payload = new HashMap<>(); - CacheImpl cache = Mockito.mock(CacheImpl.class); - PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDynamicEventCache")) - .toReturn(cache); - Response response = this.deviceAgentService.publishEvents(payload, TEST_DEVICE_TYPE, TEST_DEVICE_IDENTIFIER); - Assert.assertNotNull(response, "Response should not be null"); - Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), - "The response status should be 500"); - List payloadList = new ArrayList<>(); - Response response2 = this.deviceAgentService.publishEvents(payloadList, TEST_DEVICE_TYPE, - TEST_DEVICE_IDENTIFIER); - Assert.assertNotNull(response2, "Response should not be null"); - Assert.assertEquals(response2.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), - "The response status should be 500"); - } - @Test(description = "Test Publish events with Axis Fault.") public void testPublishEventsWithAxisFault() throws DeviceAccessAuthorizationException { PowerMockito.stub(PowerMockito.method(PrivilegedCarbonContext.class, "getThreadLocalCarbonContext")) diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/authorization/DeviceAccessAuthorizationServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/authorization/DeviceAccessAuthorizationServiceTest.java index eb8bf8ce0a..759bb1b48b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/authorization/DeviceAccessAuthorizationServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/authorization/DeviceAccessAuthorizationServiceTest.java @@ -157,7 +157,7 @@ public class DeviceAccessAuthorizationServiceTest { //Adding a non Admin User userStoreManager.addUser(NON_ADMIN_ALLOWED_USER, PASSWORD, null, defaultUserClaims, null); //Adding a normal user - userStoreManager.addUser(NORMAL_USER, PASSWORD, null, defaultUserClaims, null); + userStoreManager.addUser(NORMAL_USER, PASSWORD, null, buildDefaultUserClaims(FIRST_NAME, LAST_NAME, EMAIL), null); //Adding role with permission to Admin user userStoreManager.addRole(ADMIN_ROLE, new String[]{ADMIN_USER}, new Permission[]{adminPermission}); //Adding role with permission to non Admin user diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceTest.java index 0bdcc6fb5c..12ebfa503a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceTest.java @@ -31,6 +31,8 @@ import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagementExce import org.wso2.carbon.device.mgt.common.permission.mgt.PermissionManagerService; import org.wso2.carbon.registry.core.exceptions.RegistryException; +import java.util.ArrayList; +import java.util.List; import java.util.Properties; import static org.mockito.MockitoAnnotations.initMocks; @@ -46,11 +48,15 @@ public class PermissionManagerServiceTest { private static final String PERMISSION_PATH = "permission/admin/device-mgt/test/testPermission"; private static final String PERMISSION_METHOD = "ui.execute"; private static final String PERMISSION_NAME = "Test Permission"; + private static final String PERMISSION_CONTEXT = "permission/admin/device-mgt/test/testPermission"; + private static final String INVALID_PERMISSION_CONTEXT = "permission/INVALID"; + //For create properties to retrieve permission. private static final String HTTP_METHOD = "HTTP_METHOD"; private static final String URL = "URL"; private Permission permission; + private final List permissionList = new ArrayList<>(); private PermissionManagerService permissionManagerService; @ObjectFactory @@ -61,12 +67,13 @@ public class PermissionManagerServiceTest { @BeforeClass public void init() throws RegistryException { initMocks(this); - permissionManagerService = PermissionManagerServiceImpl.getInstance(); + this.permissionManagerService = PermissionManagerServiceImpl.getInstance(); this.permission = new Permission(); - permission.setName(PERMISSION_NAME); - permission.setPath(PERMISSION_PATH); - permission.setMethod(PERMISSION_METHOD); - permission.setUrl(PERMISSION_URL); + this.permission.setName(PERMISSION_NAME); + this.permission.setPath(PERMISSION_PATH); + this.permission.setMethod(PERMISSION_METHOD); + this.permission.setUrl(PERMISSION_URL); + this.permissionList.add(this.permission); } @Test (description = "Create a new permission in the permission tree.") @@ -74,7 +81,7 @@ public class PermissionManagerServiceTest { try { PowerMockito.mockStatic(PermissionUtils.class); PowerMockito.when(PermissionUtils.putPermission(permission)).thenReturn(true); - Assert.assertTrue(permissionManagerService.addPermission(permission)); + Assert.assertTrue(permissionManagerService.addPermission(PERMISSION_CONTEXT, this.permissionList)); } catch (PermissionManagementException e) { log.error("Error creating permission " + e.getErrorMessage()); } @@ -83,39 +90,18 @@ public class PermissionManagerServiceTest { @Test (dependsOnMethods = {"testCreatePermission"}, description = "Test for retrieving the created permission " + "from the permission tree.") public void testGetPermission() throws PermissionManagementException { - Permission permission = permissionManagerService.getPermission(createProperties()); - Assert.assertEquals(permission.getMethod(), PERMISSION_METHOD); - Assert.assertEquals(permission.getName(), PERMISSION_NAME); - Assert.assertEquals(permission.getPath(), PERMISSION_PATH); - Assert.assertEquals(permission.getUrl(), PERMISSION_URL); + List permissions = permissionManagerService.getPermission(PERMISSION_CONTEXT); + for (Permission permission : permissions) { + Assert.assertEquals(permission.getMethod(), PERMISSION_METHOD); + Assert.assertEquals(permission.getName(), PERMISSION_NAME); + Assert.assertEquals(permission.getPath(), PERMISSION_PATH); + Assert.assertEquals(permission.getUrl(), PERMISSION_URL); + } } - @Test (dependsOnMethods = {"testCreatePermission"}, - expectedExceptions = {PermissionManagementException.class}, - expectedExceptionsMessageRegExp = "Resource URI/HTTP method is empty") + @Test (dependsOnMethods = {"testCreatePermission"}) public void testGetPermissionError() throws PermissionManagementException { - Permission permission = permissionManagerService.getPermission(createErrorProperty()); - } - - /** - * Create a Property object which will be passed to getPermission method to retrieve a permission. - * @return : Property object which contains permission url and method. - * */ - private Properties createProperties() { - Properties properties = new Properties(); - properties.setProperty(URL, PERMISSION_URL); - properties.setProperty(HTTP_METHOD, PERMISSION_METHOD); - return properties; - } - - /** - * Creates property object with empty properties. - * @return : Properties object with empty set of properties. - * */ - private Properties createErrorProperty() { - Properties properties = new Properties(); - properties.setProperty(URL, ""); - properties.setProperty(HTTP_METHOD, ""); - return properties; + List permissions = permissionManagerService.getPermission(INVALID_PERMISSION_CONTEXT); + Assert.assertNull(permissions); } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceTest.java index b645eac9a0..3073b5ee3d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceTest.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/test/java/org/wso2/carbon/device/mgt/core/service/GroupManagementProviderServiceTest.java @@ -37,6 +37,7 @@ package org.wso2.carbon.device.mgt.core.service; import org.testng.Assert; import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; @@ -101,91 +102,91 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest groupManagementProviderService.createGroup(TestUtils.createDeviceGroup4(), DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_PERMISSIONS); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void updateGroup() throws GroupManagementException, GroupNotExistException { DeviceGroup deviceGroup = groupManagementProviderService.getGroup(TestUtils.createDeviceGroup1().getName(), false); deviceGroup.setName(deviceGroup.getName() + "_UPDATED"); groupManagementProviderService.updateGroup(deviceGroup, deviceGroup.getGroupId()); } - @Test(dependsOnMethods = ("createGroup"), expectedExceptions = {GroupManagementException.class}) + @Test(dependsOnMethods = "createGroup", expectedExceptions = {GroupManagementException.class}) public void getGroupNull() throws GroupManagementException, GroupNotExistException { groupManagementProviderService.getGroup(null, false); } // Rename again to use in different place. - @Test(dependsOnMethods = ("updateGroup")) + @Test(dependsOnMethods = "updateGroup") public void updateGroupSecondTime() throws GroupManagementException, GroupNotExistException { DeviceGroup deviceGroup = groupManagementProviderService.getGroup(TestUtils.createDeviceGroup1().getName() + "_UPDATED", true); deviceGroup.setName(TestUtils.createDeviceGroup1().getName()); groupManagementProviderService.updateGroup(deviceGroup, deviceGroup.getGroupId()); } - @Test(dependsOnMethods = ("createGroup"), expectedExceptions = {GroupManagementException.class, GroupNotExistException.class}) + @Test(dependsOnMethods = "createGroup", expectedExceptions = {GroupManagementException.class, GroupNotExistException.class}) public void updateGroupError() throws GroupManagementException, GroupNotExistException { groupManagementProviderService.updateGroup(null, 1); } - @Test(dependsOnMethods = ("createGroup"), expectedExceptions = {GroupManagementException.class, GroupNotExistException.class}) + @Test(dependsOnMethods = "createGroup", expectedExceptions = {GroupManagementException.class, GroupNotExistException.class}) public void updateGroupErrorNotExist() throws GroupManagementException, GroupNotExistException { DeviceGroup deviceGroup = groupManagementProviderService.getGroup(TestUtils.createDeviceGroup2().getName(), false); deviceGroup.setName(deviceGroup.getName() + "_UPDATED"); groupManagementProviderService.updateGroup(deviceGroup, 6); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void deleteGroup() throws GroupManagementException { DeviceGroup deviceGroup = groupManagementProviderService.getGroup(TestUtils.createDeviceGroup4().getName(), false); Assert.assertTrue(groupManagementProviderService.deleteGroup(deviceGroup.getGroupId(), false)); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void deleteGroupNotExists() throws GroupManagementException { groupManagementProviderService.deleteGroup(8, false); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getGroup() throws GroupManagementException { DeviceGroup deviceGroup = groupManagementProviderService.getGroup(TestUtils.createDeviceGroup3().getName(), false); Assert.assertNotNull(groupManagementProviderService.getGroup(deviceGroup.getGroupId(), false)); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getGroupByName() throws GroupManagementException { Assert.assertNotNull(groupManagementProviderService.getGroup(TestUtils.createDeviceGroup3().getName(), false)); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getGroups() throws GroupManagementException { List deviceGroups = groupManagementProviderService.getGroups(true); Assert.assertNotNull(deviceGroups); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getGroupsByUsername() throws GroupManagementException { List deviceGroups = groupManagementProviderService.getGroups("admin", true); Assert.assertNotNull(deviceGroups); } - @Test(dependsOnMethods = ("createGroup"), expectedExceptions = {GroupManagementException.class}) + @Test(dependsOnMethods = "createGroup", expectedExceptions = {GroupManagementException.class}) public void getGroupsByUsernameError() throws GroupManagementException { groupManagementProviderService.getGroups((String) null, false); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getGroupsByPagination() throws GroupManagementException { PaginationResult result = groupManagementProviderService.getGroups(TestUtils.createPaginationRequest(), true); Assert.assertNotNull(result); } - @Test(dependsOnMethods = ("createGroup"), expectedExceptions = {GroupManagementException.class}) + @Test(dependsOnMethods = "createGroup", expectedExceptions = {GroupManagementException.class}) public void getGroupsByPaginationError() throws GroupManagementException { groupManagementProviderService.getGroups((GroupPaginationRequest) null, true); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getGroupsByUsernameAndPagination() throws GroupManagementException { PaginationResult result = groupManagementProviderService.getGroups("admin", TestUtils.createPaginationRequest(), false); @@ -193,25 +194,30 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest } - @Test(dependsOnMethods = ("createGroup"), expectedExceptions = {GroupManagementException.class}) + @Test(dependsOnMethods = "createGroup", expectedExceptions = {GroupManagementException.class}) public void getGroupsByUsernameAndPaginationError() throws GroupManagementException { groupManagementProviderService.getGroups(null, TestUtils.createPaginationRequest(), true); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getGroupCount() throws GroupManagementException { int x = groupManagementProviderService.getGroupCount(); Assert.assertNotNull(x); } - @Test(dependsOnMethods = ("createGroup")) + @DataProvider(name = "getGroupCountByUsernameProvider") + public static Object[][] userName() { + return new Object[][] {{"admin"}}; + } + + @Test(dependsOnMethods = "createGroup", dataProvider = "getGroupCountByUsernameProvider") public void getGroupCountByUsername(String username) throws GroupManagementException { int x = groupManagementProviderService.getGroupCount(username, null); - Assert.assertNotNull(x); + Assert.assertNotEquals(x, 0); } - @Test(dependsOnMethods = ("updateGroupSecondTime")) + @Test(dependsOnMethods = "updateGroupSecondTime") public void manageGroupSharing() throws GroupManagementException, RoleDoesNotExistException, UserStoreException { groupManagementProviderService.manageGroupSharing(0, null); List newRoles = new ArrayList<>(); @@ -234,25 +240,25 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest TestUtils.createDeviceGroup1().getName(), false).getGroupId(), newRoles); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getRoles() throws GroupManagementException { List roles = groupManagementProviderService.getRoles(1); Assert.assertNotNull(roles); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getDevices() throws GroupManagementException { List devices = groupManagementProviderService.getDevices(1, 1, 50, false); Assert.assertNotNull(devices); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getDeviceCount() throws GroupManagementException { int x = groupManagementProviderService.getDeviceCount(1); Assert.assertEquals(0, x); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void addDevices() throws GroupManagementException, DeviceNotFoundException { DeviceCacheConfiguration configuration = new DeviceCacheConfiguration(); @@ -268,7 +274,7 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest TestUtils.createDeviceGroup3().getName(), false).getGroupId(), list); } - @Test(dependsOnMethods = ("addDevices")) + @Test(dependsOnMethods = "addDevices") public void removeDevice() throws GroupManagementException, DeviceNotFoundException { List list = TestUtils.getDeviceIdentifiersList(); groupManagementProviderService.removeDevice(groupManagementProviderService.getGroup( @@ -277,13 +283,13 @@ public class GroupManagementProviderServiceTest extends BaseDeviceManagementTest TestUtils.createDeviceGroup3().getName(), false).getGroupId(), list); } - @Test(dependsOnMethods = ("createGroup")) + @Test(dependsOnMethods = "createGroup") public void getGroupsByUsernameAndPermissions() throws GroupManagementException { List groups = groupManagementProviderService.getGroups("admin", "/permission/device-mgt/admin/groups", true); Assert.assertNotNull(groups); } - @Test(dependsOnMethods = ("addDevices")) + @Test(dependsOnMethods = "addDevices") public void getGroupsByDeviceIdentifier() throws GroupManagementException { DeviceIdentifier identifier = new DeviceIdentifier(); identifier.setId("12345"); diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyEvaluationTestCase.java b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyEvaluationTestCase.java index bf7a5bb760..cebfef03c7 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyEvaluationTestCase.java +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/src/test/java/org/wso2/carbon/policy/mgt/core/PolicyEvaluationTestCase.java @@ -23,6 +23,7 @@ import junit.framework.Assert; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.testng.annotations.BeforeClass; +import org.testng.annotations.DataProvider; import org.testng.annotations.Test; import org.wso2.carbon.device.mgt.common.Device; import org.wso2.carbon.device.mgt.common.DeviceIdentifier; @@ -90,7 +91,12 @@ public class PolicyEvaluationTestCase extends BasePolicyManagementDAOTest { //administratorPoint.publishChanges(); } - @Test(dependsOnMethods = ("activatePolicies")) + @DataProvider(name = "deviceIdentifierDataProvider") + public static Object[][] deviceIdentifierData() { + return new Object[][] {{new DeviceIdentifier()}}; + } + + @Test(dependsOnMethods = "activatePolicies", dataProvider = "deviceIdentifierDataProvider") public void getEffectivePolicy(DeviceIdentifier identifier) throws DeviceManagementException, PolicyEvaluationException { log.debug("Getting effective policy for device started .........."); diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index 2a91d7682a..0b3c41e084 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -182,6 +182,10 @@ + + org.testng + testng + org.wso2.carbon.identity.framework org.wso2.carbon.identity.core @@ -195,16 +199,6 @@ org.wso2.carbon.identity.inbound.auth.oauth2 org.wso2.carbon.identity.oauth - - - org.wso2.orbit.com.nimbusds - nimbus-jose-jwt - - - com.nimbusds - nimbus-jose-jwt - - org.wso2.carbon @@ -284,7 +278,17 @@ org.apache.sling.testing.osgi-mock test + + org.wso2.carbon + javax.cache.wso2 + 4.6.3-m5 + test + + + + true + diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/java/org/wso2/carbon/webapp/authenticator/framework/BaseWebAppAuthenticatorFrameworkTest.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/java/org/wso2/carbon/webapp/authenticator/framework/BaseWebAppAuthenticatorFrameworkTest.java index fc437004a0..a956c5f3dc 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/java/org/wso2/carbon/webapp/authenticator/framework/BaseWebAppAuthenticatorFrameworkTest.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/java/org/wso2/carbon/webapp/authenticator/framework/BaseWebAppAuthenticatorFrameworkTest.java @@ -18,6 +18,7 @@ package org.wso2.carbon.webapp.authenticator.framework; + import org.testng.annotations.BeforeSuite; import org.wso2.carbon.CarbonConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValveTest.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValveTest.java index 91dfad24ca..bd94dad56c 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValveTest.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValveTest.java @@ -106,12 +106,9 @@ public class WebappAuthenticationValveTest { @Test(description = "This method tests the behaviour of the invoke method of WebAuthenticationValve when " + "secured endpoints are invoked.") - public void testInvokeSecuredEndpoints() throws NoSuchFieldException, IllegalAccessException { - String encodedString = new String(Base64.getEncoder().encode((ADMIN_USER + ":" + ADMIN_USER).getBytes())); + public void testInvokeSecuredEndpointsUnauthorized() throws NoSuchFieldException, IllegalAccessException { + String encodedString = new String(Base64.getEncoder().encode((ADMIN_USER + ":" + ADMIN_USER + "test").getBytes())); Request request = createRequest("basic " + encodedString); - webappAuthenticationValve.invoke(request, null, compositeValve); - encodedString = new String(Base64.getEncoder().encode((ADMIN_USER + ":" + ADMIN_USER + "test").getBytes())); - request = createRequest("basic " + encodedString); Response response = new Response(); org.apache.coyote.Response coyoteResponse = new org.apache.coyote.Response(); Connector connector = new Connector(); @@ -122,6 +119,21 @@ public class WebappAuthenticationValveTest { "Response of un-authorized request is not updated"); } + @Test(description = "This method tests the behaviour of the invoke method of WebAuthenticationValve when " + + "secured endpoints are invoked.") + public void testInvokeSecuredEndpointsAuthorized() throws NoSuchFieldException, IllegalAccessException { + String encodedString = new String(Base64.getEncoder().encode((ADMIN_USER + ":" + ADMIN_USER).getBytes())); + Request request = createRequest("basic " + encodedString); + Response response = new Response(); + org.apache.coyote.Response coyoteResponse = new org.apache.coyote.Response(); + Connector connector = new Connector(); + response.setConnector(connector); + response.setCoyoteResponse(coyoteResponse); + webappAuthenticationValve.invoke(request, response, compositeValve); + Assert.assertEquals(response.getStatus(), HttpServletResponse.SC_ACCEPTED, + "Response of un-authorized request is not updated"); + } + @Test(description = "This method tests the behaviour of invoke method when the request does not satisfy any " + "authenticator requirements") public void testInvokeWithoutProperAuthenticator() throws NoSuchFieldException, IllegalAccessException { diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/resources/carbon-home/repository/conf/registry.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/resources/carbon-home/repository/conf/registry.xml index 0bb97a7dc9..a226ae80a8 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/resources/carbon-home/repository/conf/registry.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/test/resources/carbon-home/repository/conf/registry.xml @@ -1,50 +1,50 @@ - - - - - - - - wso2registry - false - true - / - - - jdbc:h2:./target/databasetest/CARBON_TEST - - org.h2.Driver - 80 - 60000 - 5 - - - false - - - - true - true - true - true - - + + + + + + + + wso2registry + false + true + / + + + jdbc:h2:./target/databasetest/CARBON_TEST + + org.h2.Driver + 80 + 60000 + 5 + + + false + + + + true + true + true + true + + diff --git a/pom.xml b/pom.xml index b8aacf28c3..83ceb160d4 100644 --- a/pom.xml +++ b/pom.xml @@ -1975,7 +1975,7 @@ 2.2.1 - 6.1.1 + 7.4.0 4.6.2 [4.5.0, 5.0.0) 5.1.2 @@ -2000,7 +2000,6 @@ 4.3.1 4.4.2 - 6.8 1.1.0 4.8.2 @@ -2186,7 +2185,7 @@ 0.7.8 0.7.5.201505241946 1.0b3 - 1.7.0 + 1.7.4 1.4.0.wso2v1 1.7.25 @@ -2208,8 +2207,6 @@ [1.6.0, 2.0.0) [1.2.0,1.3.0) - - true