From 8cf830b7c810b67944717246d9726b1d8042a503 Mon Sep 17 00:00:00 2001 From: tcdlpds Date: Wed, 1 May 2024 00:04:53 +0530 Subject: [PATCH] Fix server starting issue with latest WUM --- .../pom.xml | 26 +- .../org.wso2.carbon.apimgt.handlers/pom.xml | 139 - .../handlers/APIMCertificateMGTException.java | 33 - .../handlers/AuthenticationHandler.java | 235 -- .../apimgt/handlers/beans/Certificate.java | 58 - .../carbon/apimgt/handlers/beans/DCR.java | 88 - .../handlers/beans/ValidationResponce.java | 64 - .../config/IOTServerConfiguration.java | 122 - .../apimgt/handlers/invoker/RESTInvoker.java | 110 - .../apimgt/handlers/invoker/RESTResponse.java | 57 - .../apimgt/handlers/utils/AuthConstants.java | 40 - .../carbon/apimgt/handlers/utils/Utils.java | 205 - .../src/main/resources/iot-api-config.xml | 40 - .../handlers/AuthenticationHandlerTest.java | 296 -- .../apimgt/handlers/BaseAPIHandlerTest.java | 60 - .../handlers/IOTServerConfigurationTest.java | 97 - .../carbon/apimgt/handlers/TestUtils.java | 61 - .../apimgt/handlers/mock/MockClient.java | 76 - .../handlers/mock/MockHttpResponse.java | 178 - .../test/resources/accesstoken-response.json | 7 - .../carbon-home/repository/conf/carbon.xml | 658 --- .../conf/iot-api-config-invalid-xml.xml | 40 - .../conf/iot-api-config-invalid.xml | 40 - .../repository/conf/iot-api-config.xml | 40 - .../carbon-home/repository/conf/registry.xml | 52 - .../src/test/resources/dcr-response.json | 6 - .../src/test/resources/ra_cert.pem | 33 - .../src/test/resources/testng.xml | 30 - .../pom.xml | 204 - .../client/IntegrationClientServiceImpl.java | 68 - .../client/OAuthRequestInterceptor.java | 142 - .../client/configs/APIMConfig.java | 90 - .../client/configs/APIMConfigReader.java | 95 - .../client/exception/APIMClientException.java | 58 - .../exception/APIMClientOAuthException.java | 58 - .../InvalidConfigurationStateException.java | 78 - .../APIIntegrationClientDataHolder.java | 45 - .../APIIntegrationClientServiceComponent.java | 81 - .../client/model/ClientProfile.java | 96 - .../integration/client/model/DCRClient.java | 36 - .../client/model/OAuthApplication.java | 103 - .../client/publisher/PublisherClient.java | 96 - .../service/IntegrationClientService.java | 44 - .../integration/client/store/StoreClient.java | 117 - .../apimgt/integration/client/util/Utils.java | 238 -- .../pom.xml | 212 - .../src/main/resources/publisher-api.yaml | 3691 ----------------- .../src/main/resources/store-api.yaml | 2693 ------------ .../pom.xml | 8 +- .../pom.xml | 1 - .../pom.xml | 5 +- .../pom.xml | 158 - .../data/publisher/DataPublisherUtil.java | 124 - .../data/publisher/DeviceDataPublisher.java | 110 - .../config/AnalyticsConfiguration.java | 135 - .../InvalidConfigurationStateException.java | 29 - .../DataPublisherConfigurationException.java | 31 - .../DataPublisherServiceComponent.java | 67 - .../service/EventsPublisherService.java | 41 - .../service/EventsPublisherServiceImpl.java | 100 - .../BaseAnalyticsDataPublisherTest.java | 57 - .../publisher/DataPublisherConfigTest.java | 83 - .../DataPublisherServiceComponentTest.java | 67 - .../publisher/EventPublisherServiceTest.java | 144 - .../publisher/util/TestComponentContext.java | 81 - .../carbon-home/repository/conf/carbon.xml | 658 --- .../data-bridge/data-agent-config-invalid.xml | 69 - .../conf/data-bridge/data-agent-config.xml | 69 - .../device-analytics-config-invalid-xml.xml | 35 - .../etc/device-analytics-config-invalid.xml | 35 - .../conf/etc/device-analytics-config.xml | 36 - .../carbon-home/repository/conf/registry.xml | 52 - .../src/test/resources/client-truststore.jks | Bin 102330 -> 0 bytes .../src/test/resources/testng.xml | 31 - .../pom.xml | 80 - .../wsproxy/exception/WSProxyException.java | 37 - .../wsproxy/inbound/SubscriptionEndpoint.java | 145 - .../SuperTenantSubscriptionEndpoint.java | 104 - .../inbound/TenantSubscriptionEndpoint.java | 103 - .../wsproxy/outbound/AnalyticsClient.java | 133 - .../src/main/webapp/WEB-INF/web.xml | 46 - .../pom.xml | 154 - .../backend/oauth/AuthenticatorException.java | 39 - .../backend/oauth/OauthAuthenticator.java | 155 - .../oauth/OauthAuthenticatorConstants.java | 29 - .../OAuthAuthenticatorDataHolder.java | 49 - .../OAuthAuthenticatorServiceComponent.java | 83 - .../oauth/validator/OAuth2TokenValidator.java | 35 - .../validator/OAuthValidationResponse.java | 59 - .../validator/OAuthValidatorFactory.java | 68 - .../impl/ExternalOAuthValidator.java | 95 - .../validator/impl/LocalOAuthValidator.java | 60 - .../pom.xml | 4 +- .../pom.xml | 107 - .../policy/evaluator/FeatureFilter.java | 48 - .../policy/evaluator/FeatureFilterImpl.java | 250 -- .../carbon/policy/evaluator/FeatureRules.java | 41 - .../carbon/policy/evaluator/PDPException.java | 54 - .../policy/evaluator/PDPServiceImpl.java | 37 - .../carbon/policy/evaluator/PolicyFilter.java | 43 - .../policy/evaluator/PolicyFilterImpl.java | 72 - .../policy/evaluator/spi/PDPService.java | 34 - .../policy/evaluator/utils/Constants.java | 30 - .../pom.xml | 2 +- .../pom.xml | 104 - .../src/main/resources/build.properties | 19 - .../main/resources/conf/iot-api-config.xml | 40 - .../src/main/resources/p2.inf | 2 - .../pom.xml | 118 - .../src/main/resources/build.properties | 19 - .../main/resources/conf/apim-integration.xml | 26 - .../src/main/resources/p2.inf | 2 - .../pom.xml | 144 - .../src/main/resources/build.properties | 19 - .../conf/device-analytics-config.xml | 49 - .../src/main/resources/p2.inf | 4 - pom.xml | 6 +- 117 files changed, 30 insertions(+), 16080 deletions(-) delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/APIMCertificateMGTException.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/Certificate.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/DCR.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/ValidationResponce.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/config/IOTServerConfiguration.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/invoker/RESTInvoker.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/invoker/RESTResponse.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/AuthConstants.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/Utils.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandlerTest.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/BaseAPIHandlerTest.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/IOTServerConfigurationTest.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/TestUtils.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/mock/MockClient.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/mock/MockHttpResponse.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/accesstoken-response.json delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/carbon.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid-xml.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/registry.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/dcr-response.json delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/ra_cert.pem delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/testng.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/IntegrationClientServiceImpl.java delete mode 100755 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/OAuthRequestInterceptor.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/configs/APIMConfig.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/configs/APIMConfigReader.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/APIMClientException.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/APIMClientOAuthException.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/InvalidConfigurationStateException.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/internal/APIIntegrationClientDataHolder.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/internal/APIIntegrationClientServiceComponent.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/ClientProfile.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/DCRClient.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/OAuthApplication.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/service/IntegrationClientService.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/util/Utils.java delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml delete mode 100644 components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/store-api.yaml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherUtil.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DeviceDataPublisher.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/config/AnalyticsConfiguration.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/config/InvalidConfigurationStateException.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/exception/DataPublisherConfigurationException.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/internal/DataPublisherServiceComponent.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/service/EventsPublisherService.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/service/EventsPublisherServiceImpl.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/BaseAnalyticsDataPublisherTest.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherConfigTest.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherServiceComponentTest.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/EventPublisherServiceTest.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/util/TestComponentContext.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/carbon.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/data-bridge/data-agent-config-invalid.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/data-bridge/data-agent-config.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config-invalid-xml.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config-invalid.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/registry.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/client-truststore.jks delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/testng.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/exception/WSProxyException.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SubscriptionEndpoint.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SuperTenantSubscriptionEndpoint.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/TenantSubscriptionEndpoint.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/outbound/AnalyticsClient.java delete mode 100644 components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/webapp/WEB-INF/web.xml delete mode 100644 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml delete mode 100755 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/AuthenticatorException.java delete mode 100755 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/OauthAuthenticator.java delete mode 100755 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/OauthAuthenticatorConstants.java delete mode 100644 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/internal/OAuthAuthenticatorDataHolder.java delete mode 100755 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/internal/OAuthAuthenticatorServiceComponent.java delete mode 100755 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuth2TokenValidator.java delete mode 100755 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuthValidationResponse.java delete mode 100755 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuthValidatorFactory.java delete mode 100755 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/ExternalOAuthValidator.java delete mode 100755 components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/LocalOAuthValidator.java delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureFilter.java delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureFilterImpl.java delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureRules.java delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PDPException.java delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PDPServiceImpl.java delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilter.java delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilterImpl.java delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/spi/PDPService.java delete mode 100644 components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/utils/Constants.java delete mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml delete mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/build.properties delete mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/conf/iot-api-config.xml delete mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/p2.inf delete mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml delete mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/build.properties delete mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/conf/apim-integration.xml delete mode 100644 features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/p2.inf delete mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml delete mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/build.properties delete mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/conf/device-analytics-config.xml delete mode 100644 features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/p2.inf diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/pom.xml index 4842750edf..5e7a9cc8fb 100644 --- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/pom.xml +++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core/pom.xml @@ -81,7 +81,7 @@ Grafana API Management Core Bundle io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.internal - com.google.common.cache;version="[31.0,32)", + com.google.common.cache;version="[32.1,33)";resolution:=optional, com.google.gson;version="[2.9,3)", io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.exception;version="[5.0,6)", io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.bean, @@ -109,9 +109,9 @@ javax.xml.bind;version="[0.0,1)", javax.xml.bind.annotation;version="[0.0,1)", javax.xml.parsers, - org.apache.commons.codec.binary;version="[1.9,2)", + org.apache.commons.codec.binary;version="[1.4,2)", org.apache.commons.lang;version="[2.6,3)", - org.apache.commons.lang3;version="[3.1,4)", + org.apache.commons.lang3;version="[3.11,4)", org.apache.commons.logging;version="[1.2,2)", org.apache.http;version="[4.4,5)", org.apache.http.client, @@ -178,6 +178,12 @@ io.entgra.device.mgt.core io.entgra.device.mgt.core.device.mgt.core + + + com.google.guava + guava + + io.entgra.device.mgt.core @@ -196,6 +202,12 @@ io.entgra.device.mgt.core io.entgra.device.mgt.core.identity.jwt.client.extension provided + + + com.google.guava + guava + + javax.ws.rs @@ -306,23 +318,19 @@ commons-collections.wso2 commons-collections - io.entgra.device.mgt.core io.entgra.device.mgt.core.transport.mgt.email.sender.core - mysql mysql-connector-java test - com.google.code.gson gson - io.swagger swagger-annotations @@ -351,9 +359,7 @@ com.google.guava guava + provided - - - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml deleted file mode 100644 index d31e7093e5..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ /dev/null @@ -1,139 +0,0 @@ - - - - - - apimgt-extensions - io.entgra.device.mgt.core - 5.0.0-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.apimgt.handlers - bundle - WSO2 Carbon - API Security Handler Component - WSO2 Carbon - API Management Security Handler Module - https://entgra.io - - - - - org.ops4j.pax.logging - pax-logging-api - provided - - - - org.apache.synapse - synapse-core - - - org.apache.ws.security.wso2 - wss4j - - - io.entgra.device.mgt.core - io.entgra.device.mgt.core.certificate.mgt.core - - - org.json.wso2 - json - - - org.slf4j - slf4j-simple - test - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.artifactId} - ${project.artifactId} - ${io.entgra.device.mgt.core.version} - WSO2 Carbon - API Security Handler Component - - org.apache.axiom.*, - javax.security.cert.*, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - javax.xml.*, - org.apache.axis2.*, - org.apache.commons.*, - org.apache.http.*, - org.apache.http.util, - org.apache.ws.*;version="${org.apache.ws.security.wso2.version}", - org.json, - org.wso2.carbon.utils, - org.wso2.carbon.context, - com.google.gson, - org.w3c.dom, - org.apache.synapse, - org.apache.synapse.core.axis2, - org.apache.synapse.rest, - io.entgra.device.mgt.core.certificate.mgt.core.* - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - src/test/resources/testng.xml - - - - - 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.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/APIMCertificateMGTException.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/APIMCertificateMGTException.java deleted file mode 100644 index b0e2d41b83..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/APIMCertificateMGTException.java +++ /dev/null @@ -1,33 +0,0 @@ -/* - * Copyright (c) 2016, 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. - */ - - -import io.entgra.device.mgt.core.device.mgt.api.jaxrs..carbon.apimgt.handlers; - -/** - * Error handling class for the apimgt handler. - */ -public class APIMCertificateMGTException extends Exception{ - - private static final long serialVersionUID = -37676242646464497L; - - public APIMCertificateMGTException(String msg, Exception nestedEx) { - super(msg, nestedEx); - } -} - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java deleted file mode 100644 index 885d7f5cc5..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java +++ /dev/null @@ -1,235 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.handlers; - -import com.google.gson.Gson; -import org.apache.axis2.context.MessageContext; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.synapse.core.axis2.Axis2MessageContext; -import org.apache.synapse.rest.AbstractHandler; -import org.wso2.carbon.apimgt.handlers.beans.Certificate; -import org.wso2.carbon.apimgt.handlers.beans.ValidationResponce; -import org.wso2.carbon.apimgt.handlers.config.IOTServerConfiguration; -import org.wso2.carbon.apimgt.handlers.invoker.RESTInvoker; -import org.wso2.carbon.apimgt.handlers.invoker.RESTResponse; -import org.wso2.carbon.apimgt.handlers.utils.AuthConstants; -import org.wso2.carbon.apimgt.handlers.utils.Utils; -import io.entgra.device.mgt.core.certificate.mgt.core.dto.CertificateResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.exception.KeystoreException; -import io.entgra.device.mgt.core.certificate.mgt.core.impl.CertificateGenerator; -import org.wso2.carbon.context.PrivilegedCarbonContext; - -import javax.security.cert.CertificateEncodingException; -import java.io.ByteArrayInputStream; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.security.cert.CertificateException; -import java.security.cert.CertificateFactory; -import java.security.cert.X509Certificate; -import java.util.HashMap; -import java.util.Map; -import java.util.StringTokenizer; - -/** - * Synapse gateway handler for API authentication. - */ -public class AuthenticationHandler extends AbstractHandler { - private static final Log log = LogFactory.getLog(AuthenticationHandler.class); - private RESTInvoker restInvoker; - - private static final String X_JWT_ASSERTION = "X-JWT-Assertion"; - private static final String JWTTOKEN = "JWTToken"; - private static final String AUTHORIZATION = "Authorization"; - private static final String BEARER = "Basic "; - private static final String CONTENT_TYPE = "Content-Type"; - private static final boolean USE_INTERNAL_CERT_VERIFIER = true; - - private IOTServerConfiguration iotServerConfiguration; - - /** - * Setting up configurations at the constructor - */ - public AuthenticationHandler() { - log.info("Engaging API Security Handler.........."); - restInvoker = new RESTInvoker(); - this.iotServerConfiguration = Utils.initConfig(); - } - - /** - * Handling the message and checking the security. - * - * @param messageContext Request message context. - * @return Boolean value of the result of the processing the request. - */ - @Override - public boolean handleRequest(org.apache.synapse.MessageContext messageContext) { - org.apache.axis2.context.MessageContext axisMC = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); - - String ctxPath = messageContext.getTo().getAddress().trim(); - - if (log.isDebugEnabled()) { - log.debug("Authentication handler invoked by: " + ctxPath); - } - Map headers = (Map) axisMC.getProperty(MessageContext.TRANSPORT_HEADERS); - try { - int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId(); - RESTResponse response = null; - if (headers.containsKey(AuthConstants.MDM_SIGNATURE)) { - - String mdmSignature = headers.get(AuthConstants.MDM_SIGNATURE); - if (log.isDebugEnabled()) { - log.debug("Verify Cert:\n" + mdmSignature); - } - URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + "ios"); - Map certVerifyHeaders = this.setHeaders(); - - Certificate certificate = new Certificate(); - certificate.setPem(mdmSignature); - certificate.setTenantId(tenantId); - certificate.setSerial(""); - - Gson gson = new Gson(); - String certVerifyContent = gson.toJson(certificate); - response = restInvoker.invokePOST(certVerifyUrl, certVerifyHeaders, certVerifyContent); - - String str = response.getContent(); - if (log.isDebugEnabled()) { - log.debug("Verify response:" + response.getContent()); - log.debug("Response String : " + str); - } - if (response.getHttpStatus() == 200 && str.contains(JWTTOKEN)) { - ValidationResponce validationResponce = gson.fromJson(str, ValidationResponce.class); - headers.put(X_JWT_ASSERTION, validationResponce.getJWTToken()); - } else { - return false; - } - - } else if (headers.containsKey(AuthConstants.PROXY_MUTUAL_AUTH_HEADER)) { - String subjectDN = headers.get(AuthConstants.PROXY_MUTUAL_AUTH_HEADER); - - if (log.isDebugEnabled()) { - log.debug("Verify subject DN: " + subjectDN); - } - - if (USE_INTERNAL_CERT_VERIFIER) { - CertificateResponse certificateResponse = Utils.getCertificateManagementService() - .verifySubjectDN(subjectDN); - if (certificateResponse != null && certificateResponse.getCommonName() != null - && !certificateResponse.getCommonName().isEmpty()) { - return true; - } - } else { - String deviceType = this.getDeviceType(messageContext.getTo().getAddress().trim()); - URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + deviceType); - Map certVerifyHeaders = this.setHeaders(); - - Certificate certificate = new Certificate(); - certificate.setPem(subjectDN); - certificate.setTenantId(tenantId); - certificate.setSerial(AuthConstants.PROXY_MUTUAL_AUTH_HEADER); - - Gson gson = new Gson(); - String certVerifyContent = gson.toJson(certificate); - response = restInvoker.invokePOST(certVerifyUrl, certVerifyHeaders, certVerifyContent); - if (log.isDebugEnabled()) { - log.debug("Verify response:" + response.getContent()); - } - } - } else if (headers.containsKey(AuthConstants.MUTUAL_AUTH_HEADER)) { - javax.security.cert.X509Certificate[] certs = - (javax.security.cert.X509Certificate[]) axisMC.getProperty(AuthConstants.CLIENT_CERTIFICATE); - CertificateFactory cf = CertificateFactory.getInstance("X.509"); - ByteArrayInputStream bais = new ByteArrayInputStream(certs[0].getEncoded()); - X509Certificate x509 = (X509Certificate) cf.generateCertificate(bais); - bais.close(); - if (x509 != null) { - headers.put(AuthConstants.PROXY_MUTUAL_AUTH_HEADER, CertificateGenerator.getCommonName(x509)); - return true; - } - } else if (headers.containsKey(AuthConstants.ENCODED_PEM)) { - String encodedPem = headers.get(AuthConstants.ENCODED_PEM); - if (log.isDebugEnabled()) { - log.debug("Verify Cert:\n" + encodedPem); - } - String deviceType = this.getDeviceType(messageContext.getTo().getAddress().trim()); - URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + deviceType); - Map certVerifyHeaders = this.setHeaders(); - - Certificate certificate = new Certificate(); - certificate.setPem(encodedPem); - certificate.setTenantId(tenantId); - certificate.setSerial(""); - Gson gson = new Gson(); - String certVerifyContent = gson.toJson(certificate); - response = restInvoker.invokePOST(certVerifyUrl, certVerifyHeaders, certVerifyContent); - if (log.isDebugEnabled()) { - log.debug("Verify response:" + response.getContent()); - } - } else { - log.warn("Unauthorized request for api: " + ctxPath); - return false; - } - if (response != null && !response.getContent().contains("invalid")) { - return true; - } - log.warn("Unauthorized request for api: " + ctxPath); - return false; - } catch (IOException e) { - log.error("Error while processing certificate.", e); - return false; - } catch (URISyntaxException e) { - log.error("Error while processing certificate.", e); - return false; - } catch (CertificateException e) { - log.error("Certificate issue occurred when generating converting PEM to x509Certificate", e); - return false; - } catch (CertificateEncodingException e) { - log.error("Error while attempting to encode certificate.", e); - return false; - } catch (KeystoreException e) { - log.error("Error while attempting to validate certificate.", e); - return false; - } - } - - @Override - public boolean handleResponse(org.apache.synapse.MessageContext messageContext) { - return true; - } - - - private String getDeviceType(String url) { - StringTokenizer parts = new StringTokenizer(url, "/"); - while (parts.hasMoreElements()) { - if (parts.nextElement().equals("device-mgt")) { - return (String) parts.nextElement(); - } - } - return null; - } - - private Map setHeaders() { - Map map = new HashMap<>(); - String accessToken = Utils.getBase64EncodedToken(iotServerConfiguration); - map.put(AUTHORIZATION, BEARER + accessToken); - map.put(CONTENT_TYPE, "application/json"); - return map; - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/Certificate.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/Certificate.java deleted file mode 100644 index b3389a82c5..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/Certificate.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.handlers.beans; - -/** - * This class keeps the certificate data. - */ -public class Certificate { - - // public key of the certificate - private String pem; - // Tenant id - private int tenantId; - // Serial of the certificate. - private String serial; - - public String getPem() { - return pem; - } - - public void setPem(String pem) { - this.pem = pem; - } - - public int getTenantId() { - return tenantId; - } - - public void setTenantId(int tenantId) { - this.tenantId = tenantId; - } - - public String getSerial() { - return serial; - } - - public void setSerial(String serial) { - this.serial = serial; - } -} - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/DCR.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/DCR.java deleted file mode 100644 index ae5e42b59a..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/DCR.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.handlers.beans; - -/** - * This class holds the DCR endpoints data to create an application. - */ -public class DCR { - - private String callbackUrl; - private String owner; - private String clientName; - private String grantType; - private String tokenScope; - private boolean isSaasApp; - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public String getGrantType() { - return grantType; - } - - public void setGrantType(String grantType) { - this.grantType = grantType; - } - - public String getTokenScope() { - return tokenScope; - } - - public void setTokenScope(String tokenScope) { - this.tokenScope = tokenScope; - } - - public boolean getIsSaasApp() { - return isSaasApp; - } - - public void setIsSaasApp(boolean isSaasApp) { - this.isSaasApp = isSaasApp; - } - - public String getCallbackUrl() { - return callbackUrl; - } - - public void setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - public String toJSON() { - return "{\"callbackUrl\": \"" + callbackUrl + "\",\"clientName\": \"" + clientName + "\", \"tokenScope\": " + - "\"" + tokenScope + "\", \"owner\": \"" + owner + "\"," + "\"grantType\": \"" + grantType + - "\", \"saasApp\" :" + isSaasApp + " }\n"; - } -} - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/ValidationResponce.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/ValidationResponce.java deleted file mode 100644 index b9b385e2f3..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/beans/ValidationResponce.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2017, 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.apimgt.handlers.beans; - -/** - * This class holds the data returned from the backend after the certificate was authenticated. - */ -public class ValidationResponce { - - private String JWTToken; // X-JWT-Assertion - private String deviceId; - private String deviceType; - private int tenantId; - - public String getJWTToken() { - return JWTToken; - } - - public void setJWTToken(String JWTToken) { - this.JWTToken = JWTToken; - } - - public String getDeviceId() { - return deviceId; - } - - public void setDeviceId(String deviceId) { - this.deviceId = deviceId; - } - - public String getDeviceType() { - return deviceType; - } - - public void setDeviceType(String deviceType) { - this.deviceType = deviceType; - } - - public int getTenantId() { - return tenantId; - } - - public void setTenantId(int tenantId) { - this.tenantId = tenantId; - } -} - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/config/IOTServerConfiguration.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/config/IOTServerConfiguration.java deleted file mode 100644 index 3beecf11f0..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/config/IOTServerConfiguration.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.handlers.config; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlElementWrapper; -import javax.xml.bind.annotation.XmlRootElement; -import javax.xml.bind.annotation.XmlValue; -import java.util.List; - -/** - * This class initialize the iot-api-config.xml and hold the values, in order to be read from the relevant classes. This - * get initialized at the start of the server when apis get loaded. - */ -@XmlRootElement(name = "ServerConfiguration") -public class IOTServerConfiguration { - - private String hostname; - private String verificationEndpoint; - private String username; - private String password; - private String dynamicClientRegistrationEndpoint; - private String oauthTokenEndpoint; - private List apis; - - @XmlElement(name = "Hostname", required = true) - public String getHostname() { - return hostname; - } - - public void setHostname(String hostname) { - this.hostname = hostname; - } - - @XmlElement(name = "VerificationEndpoint", required = true) - public String getVerificationEndpoint() { - return verificationEndpoint; - } - - public void setVerificationEndpoint(String verificationEndpoint) { - this.verificationEndpoint = verificationEndpoint; - } - - @XmlElement(name = "Username", required = true) - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - @XmlElement(name = "Password", required = true) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } - - @XmlElement(name = "DynamicClientRegistrationEndpoint", required = true) - public String getDynamicClientRegistrationEndpoint() { - return dynamicClientRegistrationEndpoint; - } - - public void setDynamicClientRegistrationEndpoint(String dynamicClientRegistrationEndpoint) { - this.dynamicClientRegistrationEndpoint = dynamicClientRegistrationEndpoint; - } - - @XmlElement(name = "OauthTokenEndpoint", required = true) - public String getOauthTokenEndpoint() { - return oauthTokenEndpoint; - } - - public void setOauthTokenEndpoint(String oauthTokenEndpoint) { - this.oauthTokenEndpoint = oauthTokenEndpoint; - } - - @XmlElementWrapper(name="APIS") - @XmlElement(name = "ContextPath", required = true) - public List getApis() { - return apis; - } - - public void setApis(List apis) { - this.apis = apis; - } - - @XmlRootElement(name = "ContextPath") - public static class ContextPath { - - private String contextPath; - - @XmlValue() - public String getContextPath() { - return contextPath; - } - - public void setContextPath(String contextPath) { - this.contextPath = contextPath; - } - } -} - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/invoker/RESTInvoker.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/invoker/RESTInvoker.java deleted file mode 100644 index bd59e03dc1..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/invoker/RESTInvoker.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.handlers.invoker; - -import org.apache.commons.io.IOUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.http.client.config.RequestConfig; -import org.apache.http.client.methods.*; -import org.apache.http.entity.StringEntity; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.impl.client.HttpClients; -import org.apache.http.impl.conn.PoolingHttpClientConnectionManager; -import org.apache.http.util.EntityUtils; - -import java.io.IOException; -import java.net.URI; -import java.util.Map; -import java.util.Set; - -public class RESTInvoker { - - private static final Log log = LogFactory.getLog(RESTInvoker.class); - - private CloseableHttpClient client = null; - - public RESTInvoker() { - configureHttpClient(); - } - - private void configureHttpClient() { - int connectionTimeout = 120000; - int socketTimeout = 120000; - int maxTotalConnectionsPerRoute = 100; - int maxTotalConnections = 100; - RequestConfig defaultRequestConfig = RequestConfig.custom() - .setExpectContinueEnabled(true) - .setConnectTimeout(connectionTimeout) - .setSocketTimeout(socketTimeout) - .build(); - PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(); - connectionManager.setDefaultMaxPerRoute(maxTotalConnectionsPerRoute); - connectionManager.setMaxTotal(maxTotalConnections); - client = HttpClients.custom() - .setConnectionManager(connectionManager) - .setDefaultRequestConfig(defaultRequestConfig) - .build(); - if (log.isDebugEnabled()) { - log.debug("REST client initialized with " + - "maxTotalConnection = " + maxTotalConnections + - "maxConnectionsPerRoute = " + maxTotalConnectionsPerRoute + - "connectionTimeout = " + connectionTimeout); - } - - } - - public RESTResponse invokePOST(URI uri, Map requestHeaders, String payload) throws IOException { - - HttpPost httpPost = null; - CloseableHttpResponse response = null; - int httpStatus; - String output; - try { - httpPost = new HttpPost(uri); - httpPost.setEntity(new StringEntity(payload)); - if (requestHeaders != null && !requestHeaders.isEmpty()) { - Set keys = requestHeaders.keySet(); - for (String header : keys) { - httpPost.setHeader(header, requestHeaders.get(header)); - } - } - response = sendReceiveRequest(httpPost); - output = IOUtils.toString(response.getEntity().getContent()); - httpStatus = response.getStatusLine().getStatusCode(); - if (log.isDebugEnabled()) { - log.debug("Invoked POST " + uri.toString() + - " - Input payload: " + payload + " - Response message: " + output); - } - EntityUtils.consume(response.getEntity()); - } finally { - if (response != null) { - IOUtils.closeQuietly(response); - } - if (httpPost != null) { - httpPost.releaseConnection(); - } - } - return new RESTResponse(output, httpStatus); - } - - private CloseableHttpResponse sendReceiveRequest(HttpRequestBase requestBase) - throws IOException { - return client.execute(requestBase); - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/invoker/RESTResponse.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/invoker/RESTResponse.java deleted file mode 100644 index 205130b30e..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/invoker/RESTResponse.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.handlers.invoker; - - -/** - * RESTResponse class holds the data retrieved from the HTTP invoke response. - */ -public class RESTResponse { - private String content; - private int httpStatus; - - /** - * Constructor - * - * @param content from the REST invoke response - * @param httpStatus from the REST invoke response - */ - RESTResponse(String content, int httpStatus) { - this.content = content; - this.httpStatus = httpStatus; - } - - - /** - * Get contents of the REST invoke response - * - * @return contents of the REST invoke response - */ - public String getContent() { - return content; - } - - /** - * Get the HTTP Status code from REST invoke response - * - * @return int HTTP status code - */ - public int getHttpStatus() { - return httpStatus; - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/AuthConstants.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/AuthConstants.java deleted file mode 100644 index d9a9ef8a7b..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/AuthConstants.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.handlers.utils; - -/** - * This initializes the constance. - */ -public class AuthConstants { - public static final String MDM_SIGNATURE = "mdm-signature"; - public static final String PROXY_MUTUAL_AUTH_HEADER = "proxy-mutual-auth-header"; - public static final String MUTUAL_AUTH_HEADER = "mutual-auth-header"; - public static final String ONE_TIME_TOKEN_HEADER = "one-time-token"; - public static final String ENCODED_PEM = "encoded-pem"; - public static final String CALLBACK_URL = ""; - public static final String CLIENT_NAME = "IOT-API-MANAGER"; - public static final String GRANT_TYPE = "refresh_token password client_credentials"; - public static final String TOKEN_SCOPE = "default"; - public static final String CONTENT_TYPE_HEADER = "Content-Type"; - public static final String CONTENT_TYPE = "application/json"; - public static final String AUTHORIZATION_HEADER = "Authorization"; - public static final String BASIC_AUTH_PREFIX = "Basic "; - public static final String CLIENT_ID = "clientId"; - public static final String CLIENT_SECRET = "clientSecret"; - public static final String CLIENT_CERTIFICATE = "ssl.client.auth.cert.X509"; -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/Utils.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/Utils.java deleted file mode 100644 index 2e5d2e164a..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/utils/Utils.java +++ /dev/null @@ -1,205 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.handlers.utils; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.apache.ws.security.util.Base64; -import org.json.JSONException; -import org.json.JSONObject; -import org.w3c.dom.Document; -import org.wso2.carbon.apimgt.handlers.APIMCertificateMGTException; -import org.wso2.carbon.apimgt.handlers.beans.DCR; -import org.wso2.carbon.apimgt.handlers.config.IOTServerConfiguration; -import org.wso2.carbon.apimgt.handlers.invoker.RESTInvoker; -import org.wso2.carbon.apimgt.handlers.invoker.RESTResponse; -import io.entgra.device.mgt.core.certificate.mgt.core.service.CertificateManagementService; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.utils.CarbonUtils; - -import javax.xml.XMLConstants; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import java.io.File; -import java.io.IOException; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.HashMap; -import java.util.Map; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -/** - * Contains util methods for synapse gateway authentication handler - */ -public class Utils { - - private static final Log log = LogFactory.getLog(Utils.class); - private static final String IOT_APIS_CONFIG_FILE = "iot-api-config.xml"; - private static String clientId; - private static String clientSecret; - - /** - * This method initializes the iot-api-config.xml file. - * - * @return IoTServerConfiguration Object based on the configuration file. - */ - public static IOTServerConfiguration initConfig() { - return initConfig(CarbonUtils.getCarbonConfigDirPath() + File.separator + IOT_APIS_CONFIG_FILE); - } - - /** - * This methods initialized the iot-api-config.xml from provided path. - * - * @param path The actual file path of iot-api-config.xml - * @return The instance of the IOTServerConfiguration based on the configuration. - */ - public static IOTServerConfiguration initConfig(String path) { - try { - File file = new File(path); - Document doc = Utils.convertToDocument(file); - - JAXBContext fileContext = JAXBContext.newInstance(IOTServerConfiguration.class); - Unmarshaller unmarshaller = fileContext.createUnmarshaller(); - - IOTServerConfiguration iotServerConfiguration = (IOTServerConfiguration) unmarshaller.unmarshal( - doc); - iotServerConfiguration.setHostname(replaceProperties(iotServerConfiguration.getHostname())); - iotServerConfiguration.setVerificationEndpoint( - replaceProperties(iotServerConfiguration.getVerificationEndpoint())); - iotServerConfiguration.setDynamicClientRegistrationEndpoint( - replaceProperties(iotServerConfiguration.getDynamicClientRegistrationEndpoint())); - iotServerConfiguration.setOauthTokenEndpoint( - replaceProperties(iotServerConfiguration.getOauthTokenEndpoint())); - return iotServerConfiguration; - } catch (JAXBException | APIMCertificateMGTException e) { - log.error("Error occurred while initializing Data Source config", e); - return null; - } - } - - /** - * This method gets the values from system variables and sets to xml. - */ - private static String replaceProperties(String text) { - String regex = "\\$\\{(.*?)\\}"; - Pattern pattern = Pattern.compile(regex); - Matcher matchPattern = pattern.matcher(text); - while (matchPattern.find()) { - String sysPropertyName = matchPattern.group(1); - String sysPropertyValue = System.getProperty(sysPropertyName); - if (sysPropertyValue != null && !sysPropertyName.isEmpty()) { - text = text.replaceAll("\\$\\{(" + sysPropertyName + ")\\}", sysPropertyValue); - } - } - return text; - } - - /** - * This class build the iot-api-config.xml file. - * - * @param file The file object of iot-api-config.xml. - * @return Document instance of the file - * @throws APIMCertificateMGTException - */ - private static Document convertToDocument(File file) throws APIMCertificateMGTException { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - try { - factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - return docBuilder.parse(file); - } catch (Exception e) { - throw new APIMCertificateMGTException("Error occurred while parsing file, while converting " + - "to a org.w3c.dom.Document", e); - } - } - - /** - * This method is used to get the base64 encoded token. - * - * @param iotServerConfiguration Instance of the IoTsererConfiguration. - * @return Access token will be returned. - */ - public static String getBase64EncodedToken(IOTServerConfiguration iotServerConfiguration) { - return Base64.encode((iotServerConfiguration.getUsername() + ":" + iotServerConfiguration.getPassword()). - getBytes()); - } - - /** - * This method register an application to get the client key and secret. - * - * @param iotServerConfiguration Instance of the IoTServerConfiguration. - * @throws APIMCertificateMGTException - */ - private static void getClientSecretes(IOTServerConfiguration iotServerConfiguration, RESTInvoker restInvoker) - throws APIMCertificateMGTException { - try { - String username = iotServerConfiguration.getUsername(); - String password = iotServerConfiguration.getPassword(); - DCR dcr = new DCR(); - dcr.setOwner(iotServerConfiguration.getUsername()); - dcr.setClientName(AuthConstants.CLIENT_NAME); - dcr.setGrantType(AuthConstants.GRANT_TYPE); - dcr.setTokenScope(AuthConstants.TOKEN_SCOPE); - dcr.setCallbackUrl(AuthConstants.CALLBACK_URL); - dcr.setIsSaasApp(true); - String dcrContent = dcr.toJSON(); - Map dcrHeaders = new HashMap<>(); - String basicAuth = Base64.encode((username + ":" + password).getBytes()); - dcrHeaders.put(AuthConstants.CONTENT_TYPE_HEADER, AuthConstants.CONTENT_TYPE); - dcrHeaders.put(AuthConstants.AUTHORIZATION_HEADER, AuthConstants.BASIC_AUTH_PREFIX + basicAuth); - URI dcrUrl = new URI(iotServerConfiguration.getDynamicClientRegistrationEndpoint()); - RESTResponse response = restInvoker.invokePOST(dcrUrl, dcrHeaders, dcrContent); - if (log.isDebugEnabled()) { - log.debug("DCR response :" + response.getContent()); - } - JSONObject jsonResponse = new JSONObject(response.getContent()); - clientId = jsonResponse.getString(AuthConstants.CLIENT_ID); - clientSecret = jsonResponse.getString(AuthConstants.CLIENT_SECRET); - } catch (JSONException e) { - throw new APIMCertificateMGTException("Error occurred while converting the json to object", e); - } catch (IOException | URISyntaxException e) { - throw new APIMCertificateMGTException("Error occurred while trying to call DCR endpoint", e); - } - - } - - public static CertificateManagementService getCertificateManagementService() { - - PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - CertificateManagementService certificateManagementService = (CertificateManagementService) - ctx.getOSGiService(CertificateManagementService.class, null); - - if (certificateManagementService == null) { - String msg = "CertificateManagementAdminServiceImpl Management service not initialized."; - log.error(msg); - throw new IllegalStateException(msg); - } - - return certificateManagementService; - } - -} - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml deleted file mode 100644 index 7b1462746b..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/resources/iot-api-config.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - https://${iot.core.host}:${iot.core.https.port}/ - - - https://${iot.core.host}:${iot.core.https.port}/api/certificate-mgt/v1.0/admin/certificates/verify/ - - - admin - admin - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token - - - /services - - \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandlerTest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandlerTest.java deleted file mode 100644 index 5a9370a56e..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandlerTest.java +++ /dev/null @@ -1,296 +0,0 @@ -/* -* Copyright (c) 2017, 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.apimgt.handlers; - -import com.google.gson.Gson; -import junit.framework.Assert; -import org.apache.axiom.om.OMAbstractFactory; -import org.apache.axiom.om.OMDocument; -import org.apache.axiom.soap.SOAPEnvelope; -import org.apache.axis2.addressing.EndpointReference; -import org.apache.axis2.context.ConfigurationContext; -import org.apache.axis2.engine.AxisConfiguration; -import org.apache.http.ProtocolVersion; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.entity.BasicHttpEntity; -import org.apache.http.message.BasicStatusLine; -import org.apache.synapse.MessageContext; -import org.apache.synapse.config.SynapseConfigUtils; -import org.apache.synapse.config.SynapseConfiguration; -import org.apache.synapse.core.SynapseEnvironment; -import org.apache.synapse.core.axis2.Axis2MessageContext; -import org.apache.synapse.core.axis2.Axis2SynapseEnvironment; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.apimgt.handlers.beans.ValidationResponce; -import org.wso2.carbon.apimgt.handlers.invoker.RESTInvoker; -import org.wso2.carbon.apimgt.handlers.mock.MockClient; -import org.wso2.carbon.apimgt.handlers.mock.MockHttpResponse; -import org.wso2.carbon.apimgt.handlers.utils.AuthConstants; - -import java.io.BufferedReader; -import java.io.ByteArrayInputStream; -import java.io.FileReader; -import java.io.IOException; -import java.io.UnsupportedEncodingException; -import java.lang.reflect.Field; -import java.nio.charset.StandardCharsets; -import java.util.HashMap; -import javax.security.cert.X509Certificate; - -/** - * This testcase will focus on covering the methods of {@link AuthenticationHandler} - */ -public class AuthenticationHandlerTest extends BaseAPIHandlerTest { - - private AuthenticationHandler handler; - private SynapseConfiguration synapseConfiguration; - private MockClient mockClient; - - @BeforeClass - public void initTest() { - TestUtils.setSystemProperties(); - this.handler = new AuthenticationHandler(); - this.synapseConfiguration = new SynapseConfiguration(); - } - - @Test(description = "Handle request with empty transport headers") - public void testHandleRequestWithEmptyTransportHeader() throws Exception { - boolean response = this.handler.handleRequest(createSynapseMessageContext("", this.synapseConfiguration, - new HashMap<>(), "https://test.com/testservice")); - Assert.assertFalse(response); - } - - @Test(description = "Handle request with without device type", - dependsOnMethods = "testHandleRequestWithEmptyTransportHeader") - public void testHandleRequestWithoutDeviceType() throws Exception { - HashMap transportHeaders = new HashMap<>(); - transportHeaders.put(AuthConstants.MDM_SIGNATURE, "some cert"); - boolean response = this.handler.handleRequest(createSynapseMessageContext("", this.synapseConfiguration, - transportHeaders, "https://test.com/testservice")); - Assert.assertFalse(response); - } - - @Test(description = "Handle request with device type URI with MDM ceritificate", - dependsOnMethods = "testHandleRequestWithoutDeviceType") - public void testHandleSuccessfulRequestMDMCertificate() throws Exception { - HashMap transportHeaders = new HashMap<>(); - transportHeaders.put(AuthConstants.MDM_SIGNATURE, "some cert"); - setMockClient(); - this.mockClient.setResponse(getValidationResponse()); - boolean response = this.handler.handleRequest(createSynapseMessageContext("", this.synapseConfiguration, - transportHeaders, "https://test.com/testservice/device-mgt/testdevice")); - Assert.assertTrue(response); - this.mockClient.reset(); - } - - @Test(description = "Handle request with device type URI with Mutual Auth Header", - dependsOnMethods = "testHandleSuccessfulRequestMDMCertificate") - public void testHandleSuccessRequestMutualAuthHeader() throws Exception { - HashMap transportHeaders = new HashMap<>(); - transportHeaders.put(AuthConstants.MUTUAL_AUTH_HEADER, "Test Header"); - setMockClient(); - this.mockClient.setResponse(getValidationResponse()); - MessageContext messageContext = createSynapseMessageContext("", this.synapseConfiguration, - transportHeaders, "https://test.com/testservice/device-mgt/testdevice"); - org.apache.axis2.context.MessageContext axisMC = ((Axis2MessageContext) messageContext).getAxis2MessageContext(); - String certStr = getContent(TestUtils.getAbsolutePathOfConfig("ra_cert.pem")); - X509Certificate cert = X509Certificate.getInstance(new ByteArrayInputStream(certStr. - getBytes(StandardCharsets.UTF_8.name()))); - axisMC.setProperty(AuthConstants.CLIENT_CERTIFICATE, new X509Certificate[]{cert}); - boolean response = this.handler.handleRequest(messageContext); - Assert.assertTrue(response); - this.mockClient.reset(); - } - - @Test(description = "Handle request with device type URI with Encoded Pem", - dependsOnMethods = "testHandleSuccessRequestMutualAuthHeader") - public void testHandleSuccessRequestEncodedPem() throws Exception { - HashMap transportHeaders = new HashMap<>(); - transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem"); - setMockClient(); - this.mockClient.setResponse(getValidationResponse()); - MessageContext messageContext = createSynapseMessageContext("", this.synapseConfiguration, - transportHeaders, "https://test.com/testservice/device-mgt/testdevice"); - boolean response = this.handler.handleRequest(messageContext); - Assert.assertTrue(response); - this.mockClient.reset(); - } - - @Test(description = "Handle request with device type URI with Encoded Pem with invalid response", - dependsOnMethods = "testHandleSuccessRequestEncodedPem") - public void testHandleSuccessRequestEncodedPemInvalidResponse() throws Exception { - HashMap transportHeaders = new HashMap<>(); - transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem"); - setMockClient(); - this.mockClient.setResponse(getInvalidResponse()); - MessageContext messageContext = createSynapseMessageContext("", this.synapseConfiguration, - transportHeaders, "https://test.com/testservice/device-mgt/testdevice"); - boolean response = this.handler.handleRequest(messageContext); - Assert.assertFalse(response); - this.mockClient.reset(); - } - - @Test(description = "Handle request with cert management exception ", - dependsOnMethods = "testHandleSuccessRequestEncodedPem") - public void testHandleRequestWithCertMgmtException() throws Exception { - HashMap transportHeaders = new HashMap<>(); - transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem"); - setMockClient(); - this.mockClient.setResponse(null); - MessageContext messageContext = createSynapseMessageContext("", this.synapseConfiguration, - transportHeaders, "https://test.com/testservice/device-mgt/testdevice"); - boolean response = this.handler.handleRequest(messageContext); - Assert.assertFalse(response); - this.mockClient.reset(); - } - - @Test(description = "Handle request with IO exception", - dependsOnMethods = "testHandleRequestWithCertMgmtException") - public void testHandleRequestWithIOException() throws Exception { - HashMap transportHeaders = new HashMap<>(); - transportHeaders.put(AuthConstants.ENCODED_PEM, "encoded pem"); - setMockClient(); - this.mockClient.setResponse(null); - MessageContext messageContext = createSynapseMessageContext("", this.synapseConfiguration, - transportHeaders, "https://test.com/testservice/device-mgt/testdevice"); - boolean response = this.handler.handleRequest(messageContext); - Assert.assertFalse(response); - this.mockClient.reset(); - } - - @Test(description = "Handle request with URI exception", - dependsOnMethods = "testHandleRequestWithIOException") - public void testHandleRequestWithURIException() throws Exception { - TestUtils.resetSystemProperties(); - HashMap transportHeaders = new HashMap<>(); - transportHeaders.put(AuthConstants.MDM_SIGNATURE, "some cert"); - AuthenticationHandler handler = new AuthenticationHandler(); - boolean response = handler.handleRequest(createSynapseMessageContext("", this.synapseConfiguration, - transportHeaders, "https://test.com/testservice/device-mgt/testdevice")); - Assert.assertFalse(response); - TestUtils.setSystemProperties(); - } - - @Test(description = "Handle response") - public void testHandleResponse() throws Exception { - boolean response = this.handler.handleResponse(null); - Assert.assertTrue(response); - } - - - private static MessageContext createSynapseMessageContext( - String payload, SynapseConfiguration config, HashMap transportHeaders, - String address) throws Exception { - org.apache.axis2.context.MessageContext mc = - new org.apache.axis2.context.MessageContext(); - AxisConfiguration axisConfig = config.getAxisConfiguration(); - if (axisConfig == null) { - axisConfig = new AxisConfiguration(); - config.setAxisConfiguration(axisConfig); - } - ConfigurationContext cfgCtx = new ConfigurationContext(axisConfig); - SynapseEnvironment env = new Axis2SynapseEnvironment(cfgCtx, config); - MessageContext synMc = new Axis2MessageContext(mc, config, env); - SOAPEnvelope envelope = - OMAbstractFactory.getSOAP11Factory().getDefaultEnvelope(); - OMDocument omDoc = - OMAbstractFactory.getSOAP11Factory().createOMDocument(); - omDoc.addChild(envelope); - envelope.getBody().addChild(SynapseConfigUtils.stringToOM(payload)); - synMc.setEnvelope(envelope); - synMc.setTo(new EndpointReference(address)); - org.apache.axis2.context.MessageContext axis2MessageContext = - ((Axis2MessageContext) synMc).getAxis2MessageContext(); - axis2MessageContext.setProperty(org.apache.axis2.context.MessageContext.TRANSPORT_HEADERS, transportHeaders); - return synMc; - } - - private void setMockClient() throws NoSuchFieldException, IllegalAccessException { - Field restInvokerField = this.handler.getClass().getDeclaredField("restInvoker"); - restInvokerField.setAccessible(true); - RESTInvoker restInvoker = (RESTInvoker) restInvokerField.get(this.handler); - Field clientField = restInvoker.getClass().getDeclaredField("client"); - clientField.setAccessible(true); - this.mockClient = new MockClient(); - clientField.set(restInvoker, this.mockClient); - } - - private CloseableHttpResponse getDCRResponse() throws IOException { - CloseableHttpResponse mockDCRResponse = new MockHttpResponse(); - String dcrResponseFile = TestUtils.getAbsolutePathOfConfig("dcr-response.json"); - BasicHttpEntity responseEntity = new BasicHttpEntity(); - responseEntity.setContent(new ByteArrayInputStream(getContent(dcrResponseFile). - getBytes(StandardCharsets.UTF_8.name()))); - responseEntity.setContentType(TestUtils.CONTENT_TYPE); - mockDCRResponse.setEntity(responseEntity); - mockDCRResponse.setStatusLine(new BasicStatusLine(new ProtocolVersion("http", 1, 0), 200, "OK")); - return mockDCRResponse; - } - - private CloseableHttpResponse getAccessTokenReponse() throws IOException { - CloseableHttpResponse mockDCRResponse = new MockHttpResponse(); - String dcrResponseFile = TestUtils.getAbsolutePathOfConfig("accesstoken-response.json"); - BasicHttpEntity responseEntity = new BasicHttpEntity(); - responseEntity.setContent(new ByteArrayInputStream(getContent(dcrResponseFile). - getBytes(StandardCharsets.UTF_8.name()))); - responseEntity.setContentType(TestUtils.CONTENT_TYPE); - mockDCRResponse.setEntity(responseEntity); - mockDCRResponse.setStatusLine(new BasicStatusLine(new ProtocolVersion("http", 1, 0), 200, "OK")); - return mockDCRResponse; - } - - private CloseableHttpResponse getValidationResponse() throws UnsupportedEncodingException { - ValidationResponce response = new ValidationResponce(); - response.setDeviceId("1234"); - response.setDeviceType("testdevice"); - response.setJWTToken("1234567788888888"); - response.setTenantId(-1234); - Gson gson = new Gson(); - String jsonReponse = gson.toJson(response); - CloseableHttpResponse mockDCRResponse = new MockHttpResponse(); - BasicHttpEntity responseEntity = new BasicHttpEntity(); - responseEntity.setContent(new ByteArrayInputStream(jsonReponse.getBytes(StandardCharsets.UTF_8.name()))); - responseEntity.setContentType(TestUtils.CONTENT_TYPE); - mockDCRResponse.setEntity(responseEntity); - mockDCRResponse.setStatusLine(new BasicStatusLine(new ProtocolVersion("http", 1, 0), 200, "OK")); - return mockDCRResponse; - } - - private CloseableHttpResponse getInvalidResponse() throws UnsupportedEncodingException { - CloseableHttpResponse mockDCRResponse = new MockHttpResponse(); - BasicHttpEntity responseEntity = new BasicHttpEntity(); - responseEntity.setContent(new ByteArrayInputStream("invalid response".getBytes(StandardCharsets.UTF_8.name()))); - responseEntity.setContentType(TestUtils.CONTENT_TYPE); - mockDCRResponse.setEntity(responseEntity); - mockDCRResponse.setStatusLine(new BasicStatusLine(new ProtocolVersion("http", 1, 0), 400, "Bad Request")); - return mockDCRResponse; - } - - private String getContent(String filePath) throws IOException { - FileReader fileReader = new FileReader(filePath); - BufferedReader bufferedReader = new BufferedReader(fileReader); - String content = ""; - String line; - while ((line = bufferedReader.readLine()) != null) { - content += line + "\n"; - } - bufferedReader.close(); - return content; - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/BaseAPIHandlerTest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/BaseAPIHandlerTest.java deleted file mode 100644 index 57a293e2eb..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/BaseAPIHandlerTest.java +++ /dev/null @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2017, 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.apimgt.handlers; - -import org.testng.annotations.BeforeSuite; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; - -import java.io.File; - -/** - * This is the base test case for API Handler tests. - */ -public class BaseAPIHandlerTest { - - @BeforeSuite - public void init() { - setUpCarbonHome(); - } - - private void setUpCarbonHome() { - if (System.getProperty("carbon.home") == null) { - File file = new File("src/test/resources/carbon-home"); - if (file.exists()) { - System.setProperty("carbon.home", file.getAbsolutePath()); - } - file = new File("carbon-home"); - if (file.exists()) { - System.setProperty("carbon.home", file.getAbsolutePath()); - } - file = new File("../../resources/carbon-home"); - if (file.exists()) { - System.setProperty("carbon.home", file.getAbsolutePath()); - } - file = new File("../../../resources/carbon-home"); - if (file.exists()) { - System.setProperty("carbon.home", file.getAbsolutePath()); - } - } - PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants - .SUPER_TENANT_DOMAIN_NAME); - PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID); - } - -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/IOTServerConfigurationTest.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/IOTServerConfigurationTest.java deleted file mode 100644 index 1b7a88dd3b..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/IOTServerConfigurationTest.java +++ /dev/null @@ -1,97 +0,0 @@ -/* -* Copyright (c) 2017, 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.apimgt.handlers; - -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.apimgt.handlers.config.IOTServerConfiguration; -import org.wso2.carbon.apimgt.handlers.utils.Utils; - -import java.io.File; - -/** - * This class validates the behaviour of {@link IOTServerConfiguration} - */ -public class IOTServerConfigurationTest extends BaseAPIHandlerTest { - private static final String CONFIG_DIR = "carbon-home" + File.separator + "repository" + File.separator + - "conf" + File.separator; - - @BeforeClass - public void initTest(){ - TestUtils.resetSystemProperties(); - } - - @Test(description = "Validating the IoT Server configuration initialization without system properties") - public void initConfigWithoutSystemProps() { - IOTServerConfiguration serverConfiguration = Utils.initConfig(); - Assert.assertTrue(serverConfiguration != null); - Assert.assertEquals(serverConfiguration.getHostname(), "https://${iot.core.host}:${iot.core.https.port}/"); - Assert.assertEquals(serverConfiguration.getVerificationEndpoint(), - "https://${iot.core.host}:${iot.core.https.port}/api/certificate-mgt/v1.0/admin/certificates/verify/"); - Assert.assertEquals(serverConfiguration.getUsername(), "testuser"); - Assert.assertEquals(serverConfiguration.getPassword(), "testuserpwd"); - Assert.assertEquals(serverConfiguration.getDynamicClientRegistrationEndpoint(), - "https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register"); - Assert.assertEquals(serverConfiguration.getOauthTokenEndpoint(), - "https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token"); - Assert.assertEquals(serverConfiguration.getApis().size(), 1); - Assert.assertEquals(serverConfiguration.getApis().get(0).getContextPath(), "/services"); - } - - @Test(description = "Initializing IoT server config with invalid configuration", - dependsOnMethods = "initConfigWithoutSystemProps") - public void initConfigWithInvalidConfig() { - IOTServerConfiguration serverConfig = Utils.initConfig(TestUtils.getAbsolutePathOfConfig(CONFIG_DIR - + "iot-api-config-invalid.xml")); - Assert.assertEquals(serverConfig, null); - } - - @Test(description = "Initializing IoT server config with invalid xml", - dependsOnMethods = "initConfigWithInvalidConfig") - public void initConfigWithInvalidXMLConfig() { - IOTServerConfiguration serverConfig = Utils.initConfig(TestUtils.getAbsolutePathOfConfig(CONFIG_DIR + - "iot-api-config-invalid-xml.xml")); - Assert.assertEquals(serverConfig, null); - } - - @Test(description = "Initializing IoT server config with system configs", - dependsOnMethods = "initConfigWithInvalidXMLConfig") - public void initConfigWithSystemProps() { - TestUtils.setSystemProperties(); - IOTServerConfiguration serverConfiguration = Utils.initConfig(); - Assert.assertTrue(serverConfiguration != null); - Assert.assertEquals(serverConfiguration.getHostname(), "https://" + TestUtils.IOT_CORE_HOST + ":" - + TestUtils.IOT_CORE_HTTPS_PORT - + "/"); - Assert.assertEquals(serverConfiguration.getVerificationEndpoint(), - "https://" + TestUtils.IOT_CORE_HOST + ":" + TestUtils.IOT_CORE_HTTPS_PORT + - "/api/certificate-mgt/v1.0/admin/certificates/" + - "verify/"); - Assert.assertEquals(serverConfiguration.getUsername(), "testuser"); - Assert.assertEquals(serverConfiguration.getPassword(), "testuserpwd"); - Assert.assertEquals(serverConfiguration.getDynamicClientRegistrationEndpoint(), - "https://" + TestUtils.IOT_KEYMANAGER_HOST + ":" + TestUtils.IOT_KEYMANAGER_PORT - + "/client-registration/v0.12/register"); - Assert.assertEquals(serverConfiguration.getOauthTokenEndpoint(), - "https://" + TestUtils.IOT_KEYMANAGER_HOST + ":" + TestUtils.IOT_KEYMANAGER_PORT - + "/oauth2/token"); - Assert.assertEquals(serverConfiguration.getApis().size(), 1); - Assert.assertEquals(serverConfiguration.getApis().get(0).getContextPath(), "/services"); - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/TestUtils.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/TestUtils.java deleted file mode 100644 index 5b22e1c5d9..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/TestUtils.java +++ /dev/null @@ -1,61 +0,0 @@ -/* -* Copyright (c) 2017, 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.apimgt.handlers; - -import org.testng.Assert; - -import java.io.File; -import java.net.URL; - -/** - * Utils class which provides utility methods for other testcases. - */ -public class TestUtils { - static final String IOT_CORE_HOST = "iot.core.wso2.com"; - static final String IOT_CORE_HTTPS_PORT = "9443"; - static final String IOT_KEYMANAGER_HOST = "iot.keymanager.wso2.com"; - static final String IOT_KEYMANAGER_PORT = "9443"; - static final String CONTENT_TYPE = "application/json"; - - private static final String IOT_HOST_PROPERTY = "iot.core.host"; - private static final String IOT_PORT_PROPERTY = "iot.core.https.port"; - private static final String IOT_KEY_MANAGER_HOST_PROPERTY = "iot.keymanager.host"; - private static final String IOT_KEY_MANAGER_PORT_PROPERTY = "iot.keymanager.https.port"; - - static String getAbsolutePathOfConfig(String configFilePath) { - ClassLoader classLoader = TestUtils.class.getClassLoader(); - URL invalidConfig = classLoader.getResource(configFilePath); - Assert.assertTrue(invalidConfig != null); - File file = new File(invalidConfig.getFile()); - return file.getAbsolutePath(); - } - - static void setSystemProperties() { - System.setProperty(IOT_HOST_PROPERTY, IOT_CORE_HOST); - System.setProperty(IOT_PORT_PROPERTY, IOT_CORE_HTTPS_PORT); - System.setProperty(IOT_KEY_MANAGER_HOST_PROPERTY, IOT_KEYMANAGER_HOST); - System.setProperty(IOT_KEY_MANAGER_PORT_PROPERTY, IOT_KEYMANAGER_PORT); - } - - static void resetSystemProperties() { - System.clearProperty(IOT_HOST_PROPERTY); - System.clearProperty(IOT_PORT_PROPERTY); - System.clearProperty(IOT_KEY_MANAGER_HOST_PROPERTY); - System.clearProperty(IOT_KEY_MANAGER_PORT_PROPERTY); - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/mock/MockClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/mock/MockClient.java deleted file mode 100644 index 0c8ab4f6bd..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/mock/MockClient.java +++ /dev/null @@ -1,76 +0,0 @@ -/* -* Copyright (c) 2017, 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.apimgt.handlers.mock; - -import org.apache.http.HttpHost; -import org.apache.http.HttpRequest; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.conn.ClientConnectionManager; -import org.apache.http.impl.client.CloseableHttpClient; -import org.apache.http.params.HttpParams; -import org.apache.http.protocol.HttpContext; - -import java.io.IOException; -import java.util.ArrayList; -import java.util.List; - -/** - * Mock implementation for CloseableHttpClient to be used in test cases. - */ -public class MockClient extends CloseableHttpClient { - private List responses = new ArrayList<>(); - private int responseCount = 0; - - @Override - protected CloseableHttpResponse doExecute(HttpHost httpHost, HttpRequest httpRequest, HttpContext httpContext) - throws IOException { - if (this.responseCount < this.responses.size()) { - this.responseCount++; - CloseableHttpResponse response = this.responses.get(this.responseCount - 1); - if (response == null) { - throw new IOException("test exception"); - } - return response; - } else { - return new MockHttpResponse(); - } - } - - @Override - public void close() throws IOException { - } - - @Override - public HttpParams getParams() { - return null; - } - - @Override - public ClientConnectionManager getConnectionManager() { - return null; - } - - public void setResponse(CloseableHttpResponse reponse) { - this.responses.add(reponse); - } - - public void reset() { - this.responses.clear(); - this.responseCount = 0; - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/mock/MockHttpResponse.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/mock/MockHttpResponse.java deleted file mode 100644 index adfd7652c5..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/java/org/wso2/carbon/apimgt/handlers/mock/MockHttpResponse.java +++ /dev/null @@ -1,178 +0,0 @@ -/* -* Copyright (c) 2017, 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.apimgt.handlers.mock; - -import org.apache.http.Header; -import org.apache.http.HeaderIterator; -import org.apache.http.HttpEntity; -import org.apache.http.ProtocolVersion; -import org.apache.http.StatusLine; -import org.apache.http.client.methods.CloseableHttpResponse; -import org.apache.http.params.HttpParams; - -import java.io.IOException; -import java.util.Locale; - -/** - * Mock http response to be used in the test cases. - * - */ -public class MockHttpResponse implements CloseableHttpResponse { - private HttpEntity httpEntity; - private StatusLine statusLine; - - @Override - public void close() throws IOException { - - } - - @Override - public StatusLine getStatusLine() { - return this.statusLine; - } - - @Override - public void setStatusLine(StatusLine statusLine) { - this.statusLine = statusLine; - } - - @Override - public void setStatusLine(ProtocolVersion protocolVersion, int i) { - - } - - @Override - public void setStatusLine(ProtocolVersion protocolVersion, int i, String s) { - - } - - @Override - public void setStatusCode(int i) throws IllegalStateException { - - } - - @Override - public void setReasonPhrase(String s) throws IllegalStateException { - - } - - @Override - public HttpEntity getEntity() { - return this.httpEntity; - } - - @Override - public void setEntity(HttpEntity httpEntity) { - this.httpEntity = httpEntity; - } - - @Override - public Locale getLocale() { - return null; - } - - @Override - public void setLocale(Locale locale) { - - } - - @Override - public ProtocolVersion getProtocolVersion() { - return null; - } - - @Override - public boolean containsHeader(String s) { - return false; - } - - @Override - public Header[] getHeaders(String s) { - return new Header[0]; - } - - @Override - public Header getFirstHeader(String s) { - return null; - } - - @Override - public Header getLastHeader(String s) { - return null; - } - - @Override - public Header[] getAllHeaders() { - return new Header[0]; - } - - @Override - public void addHeader(Header header) { - - } - - @Override - public void addHeader(String s, String s1) { - - } - - @Override - public void setHeader(Header header) { - - } - - @Override - public void setHeader(String s, String s1) { - - } - - @Override - public void setHeaders(Header[] headers) { - - } - - @Override - public void removeHeader(Header header) { - - } - - @Override - public void removeHeaders(String s) { - - } - - @Override - public HeaderIterator headerIterator() { - return null; - } - - @Override - public HeaderIterator headerIterator(String s) { - return null; - } - - @Override - public HttpParams getParams() { - return null; - } - - @Override - public void setParams(HttpParams httpParams) { - - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/accesstoken-response.json b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/accesstoken-response.json deleted file mode 100644 index 11be1e29eb..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/accesstoken-response.json +++ /dev/null @@ -1,7 +0,0 @@ -{ - "scope": "API_SUBSCRIBER_SCOPE", - "token_type": "Bearer", - "expires_in": 3600, - "refresh_token": "33c3be152ebf0030b3fb76f2c1f80bf8", - "access_token": "292ff0fd256814536baca0926f483c8d" -} \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/carbon.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/carbon.xml deleted file mode 100644 index a5518cb720..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/carbon.xml +++ /dev/null @@ -1,658 +0,0 @@ - - - - - - - - - ${product.name} - - - ${product.key} - - - ${product.version} - - - - - - - - - local:/${carbon.context}/services/ - - - - - - - ${default.server.role} - - - - - - - org.wso2.carbon - - - / - - - - - - - - - 15 - - - - - - - - - 0 - - - - - 9999 - - 11111 - - - - - - 10389 - - 8000 - - - - - - 10500 - - - - - - - org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory - - - - - - - - - java - - - - - - - - - - false - - - false - - - 600 - - - - false - - - - - - - - 30 - - - - - - - - - 15 - - - - - - ${carbon.home}/repository/deployment/server/ - - - 15 - - - ${carbon.home}/repository/conf/axis2/axis2.xml - - - 30000 - - - ${carbon.home}/repository/deployment/client/ - - ${carbon.home}/repository/conf/axis2/axis2_client.xml - - true - - - - - - - - - - admin - Default Administrator Role - - - user - Default User Role - - - - - - - - - - - - ${carbon.home}/repository/resources/security/wso2carbon.jks - - JKS - - wso2carbon - - wso2carbon - - wso2carbon - - - - - - ${carbon.home}/repository/resources/security/client-truststore.jks - - JKS - - wso2carbon - - - - - - - - - - - - - - - - - - - UserManager - - - false - - - - - - - ${carbon.home}/tmp/work - - - - - - true - - - 10 - - - 30 - - - - - - 100 - - - - keystore - certificate - * - - org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor - - - - - jarZip - - org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor - - - - dbs - - org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor - - - - tools - - org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor - - - - toolsAny - - org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor - - - - - - - info - org.wso2.carbon.core.transports.util.InfoProcessor - - - wsdl - org.wso2.carbon.core.transports.util.Wsdl11Processor - - - wsdl2 - org.wso2.carbon.core.transports.util.Wsdl20Processor - - - xsd - org.wso2.carbon.core.transports.util.XsdProcessor - - - - - - false - false - true - svn - http://svnrepo.example.com/repos/ - username - password - true - - - - - - - - - - - - - - - ${require.carbon.servlet} - - - - - true - - - - - - - default repository - ${p2.repo.url} - - - - - - - - true - - - - - - true - - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid-xml.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid-xml.xml deleted file mode 100644 index 2f174b3f03..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config-invalid-xml.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - https://${iot.core.host}:${iot.core.https.port}/ - - - https://${iot.core.host}:${iot.core.https.port}/api/certificate-mgt/v1.0/admin/certificates/verify/ - - - testuser - testuserpwd - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token - - - /services - - - - - - - https://${iot.core.host}:${iot.core.https.port}/ - - - https://${iot.core.host}:${iot.core.https.port}/api/certificate-mgt/v1.0/admin/certificates/verify/ - - - testuser - testuserpwd - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token - - - /services - - \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config.xml deleted file mode 100644 index 4224c27a07..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/iot-api-config.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - https://${iot.core.host}:${iot.core.https.port}/ - - - https://${iot.core.host}:${iot.core.https.port}/api/certificate-mgt/v1.0/admin/certificates/verify/ - - - testuser - testuserpwd - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token - - - /services - - \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/registry.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/registry.xml deleted file mode 100644 index 331c448c87..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/carbon-home/repository/conf/registry.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - wso2registry - false - true - / - - - jdbc:h2:./target/databasetest/CARBON_TEST - - org.h2.Driver - 80 - 60000 - 5 - - - false - - - - true - true - true - true - - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/dcr-response.json b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/dcr-response.json deleted file mode 100644 index 1672f812d7..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/dcr-response.json +++ /dev/null @@ -1,6 +0,0 @@ -{ - "callBackURL": "www.google.lk", - "clientName": null, - "clientId": "HfEl1jJPdg5tbtrxhAwybN05QGoa", - "clientSecret": "l6c0aoLcWR3fwezHhc7XoGOht5Aa" -} \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/ra_cert.pem b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/ra_cert.pem deleted file mode 100644 index 516b08ccee..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/ra_cert.pem +++ /dev/null @@ -1,33 +0,0 @@ ------BEGIN CERTIFICATE----- -MIIFqDCCA5CgAwIBAgIBAjANBgkqhkiG9w0BAQUFADCBizELMAkGA1UEBhMCVVMx -DTALBgNVBAgTBFRlc3QxDTALBgNVBAcTBFRlc3QxETAPBgNVBAoTCFRlc3QgT3Jn -MRYwFAYDVQQLEw1UZXN0IG9yZyB1bml0MRUwEwYDVQQDEwxXU08yIFJvb3QgQ0Ex -HDAaBgkqhkiG9w0BCQEWDXJvb3RAd3NvMi5jb20wHhcNMTUwMTI3MTI1MzAxWhcN -MTcxMDIzMTI1MzAxWjCBgzELMAkGA1UEBhMCVVMxGTAXBgNVBAgTEFRlc3QgUkEg -UHJvdmluY2UxFTATBgNVBAcTDFRlc3QgUkEgQ2l0eTEUMBIGA1UEChMLVGVzdCBS -QSBPcmcxGTAXBgNVBAsTEFRlc3QgUkEgb3JnIHVuaXQxETAPBgNVBAMTCFdTTzIg -UkEgMIICIjANBgkqhkiG9w0BAQEFAAOCAg8AMIICCgKCAgEAtUMgUlYYU3/TPfEe -zNAvBaiOi/jUjfZ9IbxvMl7obDT17/5vU68TCGkZRjyfYUEiGNBisUEFWjSk/sGL -/ofYKUAxw33cd456FLMjaJX/4Zk4y8eYB1m1GGlHejoDyjPhq8S6GDmy+PXbJr8n -lSTROR2mQHkGwYrCreWeU4AYWzdctIFk7U2DKeIvZYSidIIjfSpDXURxrt9LPvig -fMzr5l/WkZfjvk5S+W7rgMtpllxlEPgyDc07pNAdNSq5FB990oaUsVX8o6l6wdC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h+fy+Z7w5X1rTTvhFOoU5J7kedGEqiBatIZmhF5t -UFbT0u350ET5a0Kg83gu5aLwXdoIP9o7bp3XzLBMVNny2RX3tOHUA2HBe/p0h0OU -Ggt3G6oD0gBe9pZI ------END CERTIFICATE----- diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/testng.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/testng.xml deleted file mode 100644 index 3902ad4c3a..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/test/resources/testng.xml +++ /dev/null @@ -1,30 +0,0 @@ - - - - - - - - - - - - - - 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 deleted file mode 100644 index 51b9f17fcb..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/pom.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - - - - apimgt-extensions - io.entgra.device.mgt.core - 5.0.0-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.apimgt.integration.client - bundle - WSO2 Carbon - API Management Integration Client - WSO2 Carbon - API Management Integration Client - https://entgra.io - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.artifactId} - ${project.artifactId} - ${project.version} - APIM Integration - org.wso2.carbon.apimgt.integration.client.internal - - org.wso2.carbon.apimgt.integration.client.*, - !org.wso2.carbon.apimgt.integration.client.internal - - - org.osgi.framework.*;version="${imp.package.version.osgi.framework}", - org.osgi.service.*;version="${imp.package.version.osgi.service}", - 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 - - - - - - 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 - - - - - - - - - - org.apache.felix - org.apache.felix.scr.ds-annotations - provided - - - com.squareup.okhttp3 - okhttp - - - com.squareup.okio - okio - - - io.github.openfeign - feign-okhttp - - - org.ops4j.pax.logging - pax-logging-api - provided - - - - 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 - - - io.github.openfeign - feign-gson - - - - org.testng - testng - - - io.entgra.device.mgt.core - io.entgra.device.mgt.core.identity.jwt.client.extension - - - io.entgra.device.mgt.core - org.wso2.carbon.apimgt.integration.generated.client - - - - diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/IntegrationClientServiceImpl.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/IntegrationClientServiceImpl.java deleted file mode 100644 index 2dcefcce20..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/IntegrationClientServiceImpl.java +++ /dev/null @@ -1,68 +0,0 @@ -/* - * Copyright (c) 2017, 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.apimgt.integration.client; - -import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient; -import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; -import org.wso2.carbon.apimgt.integration.client.store.StoreClient; - -public class IntegrationClientServiceImpl implements IntegrationClientService { - - private static volatile IntegrationClientServiceImpl instance; - private StoreClient storeClient; - private PublisherClient publisherClient; - private OAuthRequestInterceptor oAuthRequestInterceptor; - - private IntegrationClientServiceImpl() { - oAuthRequestInterceptor = new OAuthRequestInterceptor(); - storeClient = new StoreClient(oAuthRequestInterceptor); - publisherClient = new PublisherClient(oAuthRequestInterceptor); - } - - public IntegrationClientServiceImpl(OAuthRequestInterceptor oAuthRequestInterceptor) { - this.oAuthRequestInterceptor = oAuthRequestInterceptor; - storeClient = new StoreClient(oAuthRequestInterceptor); - publisherClient = new PublisherClient(oAuthRequestInterceptor); - } - - public static IntegrationClientServiceImpl getInstance() { - if (instance == null) { - synchronized (IntegrationClientService.class) { - if (instance == null) { - instance = new IntegrationClientServiceImpl(); - } - } - } - return instance; - } - - public void resetUserInfo(String userName, String tenantDomain) { - oAuthRequestInterceptor.removeToken(userName, tenantDomain); - } - - @Override - public StoreClient getStoreClient() { - return storeClient; - } - - @Override - public PublisherClient getPublisherClient() { - return publisherClient; - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/OAuthRequestInterceptor.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/OAuthRequestInterceptor.java deleted file mode 100755 index 46289b3ca1..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/OAuthRequestInterceptor.java +++ /dev/null @@ -1,142 +0,0 @@ -/* - * Copyright (c) 2016, 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. - * - */ - -package org.wso2.carbon.apimgt.integration.client; - -import feign.Feign; -import feign.Logger; -import feign.RequestInterceptor; -import feign.RequestTemplate; -import feign.auth.BasicAuthRequestInterceptor; -import feign.gson.GsonDecoder; -import feign.gson.GsonEncoder; -import feign.jaxrs.JAXRSContract; -import feign.okhttp.OkHttpClient; -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.client.exception.APIMClientOAuthException; -import org.wso2.carbon.apimgt.integration.client.internal.APIIntegrationClientDataHolder; -import org.wso2.carbon.apimgt.integration.client.model.ClientProfile; -import org.wso2.carbon.apimgt.integration.client.model.DCRClient; -import org.wso2.carbon.apimgt.integration.client.model.OAuthApplication; -import org.wso2.carbon.apimgt.integration.client.util.Utils; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import io.entgra.device.mgt.core.identity.jwt.client.extension.JWTClient; -import io.entgra.device.mgt.core.identity.jwt.client.extension.dto.AccessTokenInfo; -import io.entgra.device.mgt.core.identity.jwt.client.extension.exception.JWTClientException; - -import java.util.HashMap; -import java.util.Map; -import java.util.concurrent.ConcurrentHashMap; - -/** - * This is a request interceptor to add oauth token header. - */ -public class OAuthRequestInterceptor implements RequestInterceptor { - - private static final String APPLICATION_NAME = "api_integration_client"; - private static final String GRANT_TYPES = "password refresh_token urn:ietf:params:oauth:grant-type:jwt-bearer"; - private static final String REQUIRED_SCOPE = - "apim:api_create apim:api_view apim:api_publish apim:subscribe apim:tier_view apim:tier_manage " + - "apim:subscription_view apim:subscription_block"; - private static final String APIM_SUBSCRIBE_SCOPE = "apim:subscribe"; - private static final long DEFAULT_REFRESH_TIME_OFFSET_IN_MILLIS = 100000; - private DCRClient dcrClient; - private OAuthApplication oAuthApplication; - private static Map tenantUserTokenMap = new ConcurrentHashMap<>(); - private static final Log log = LogFactory.getLog(OAuthRequestInterceptor.class); - private String username; - private String password; - - /** - * Creates an interceptor that authenticates all requests. - */ - public OAuthRequestInterceptor() { - username = APIMConfigReader.getInstance().getConfig().getUsername(); - password = APIMConfigReader.getInstance().getConfig().getPassword(); - dcrClient = Feign.builder().client(new OkHttpClient(Utils.getSSLClient())).logger(new Slf4jLogger()) - .logLevel(Logger.Level.FULL).requestInterceptor(new BasicAuthRequestInterceptor(username, password)) - .contract(new JAXRSContract()).encoder(new GsonEncoder()).decoder(new GsonDecoder()) - .target(DCRClient.class, Utils.replaceProperties( - APIMConfigReader.getInstance().getConfig().getDcrEndpoint())); - } - - public OAuthRequestInterceptor(String username, String password) { - this.username = username; - this.password = password; - dcrClient = Feign.builder().client(new OkHttpClient(Utils.getSSLClient())).logger(new Slf4jLogger()) - .logLevel(Logger.Level.FULL).requestInterceptor(new BasicAuthRequestInterceptor(username, password)) - .contract(new JAXRSContract()).encoder(new GsonEncoder()).decoder(new GsonDecoder()) - .target(DCRClient.class, Utils.replaceProperties( - APIMConfigReader.getInstance().getConfig().getDcrEndpoint())); - } - - @Override - public void apply(RequestTemplate template) { - if (oAuthApplication == null) { - //had to do on demand initialization due to start up error. - ClientProfile clientProfile = new ClientProfile(); - clientProfile.setClientName(APPLICATION_NAME); - clientProfile.setCallbackUrl(""); - clientProfile.setGrantType(GRANT_TYPES); - clientProfile.setOwner(username); - clientProfile.setSaasApp(true); - oAuthApplication = dcrClient.register(clientProfile); - } - try { - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); - String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername(); - if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { - username = username + "@" + tenantDomain; - } - AccessTokenInfo tenantBasedAccessTokenInfo = tenantUserTokenMap.get(username); - if ((tenantBasedAccessTokenInfo == null || - ((System.currentTimeMillis() + DEFAULT_REFRESH_TIME_OFFSET_IN_MILLIS) > - tenantBasedAccessTokenInfo.getExpiresIn()))) { - - JWTClient jwtClient = APIIntegrationClientDataHolder.getInstance().getJwtClientManagerService() - .getJWTClient(); - tenantBasedAccessTokenInfo = jwtClient.getAccessToken(oAuthApplication.getClientId(), - oAuthApplication.getClientSecret(), username, REQUIRED_SCOPE); - tenantBasedAccessTokenInfo.setExpiresIn( - System.currentTimeMillis() + (tenantBasedAccessTokenInfo.getExpiresIn() * 1000)); - if (tenantBasedAccessTokenInfo.getScopes() == null) { - throw new APIMClientOAuthException("Failed to retrieve scopes from access token"); - } - - if (tenantBasedAccessTokenInfo.getScopes().contains(APIM_SUBSCRIBE_SCOPE)) { - tenantUserTokenMap.put(username, tenantBasedAccessTokenInfo); - } - - } - if (tenantBasedAccessTokenInfo.getAccessToken() != null) { - String headerValue = "Bearer " + tenantBasedAccessTokenInfo.getAccessToken(); - template.header("Authorization", headerValue); - } - } catch (JWTClientException e) { - throw new APIMClientOAuthException("failed to retrieve oauth token using jwt", e); - } - } - - public void removeToken(String username, String tenantDomain) { - if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { - username = username + "@" + tenantDomain; - } - tenantUserTokenMap.remove(username); - } - -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/configs/APIMConfig.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/configs/APIMConfig.java deleted file mode 100644 index 1e3d34c746..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/configs/APIMConfig.java +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2017, 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.apimgt.integration.client.configs; - -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; - -/** - * This holds the configuration api manager integration. - */ -@XmlRootElement(name = "APIMConfiguration") -public class APIMConfig { - - String dcrEndpoint; - String tokenEndpoint; - String publisherEndpoint; - String storeEndpoint; - String username; - String password; - - @XmlElement(name = "DCREndpoint", required = true) - public String getDcrEndpoint() { - return dcrEndpoint; - } - - public void setDcrEndpoint(String dcrEndpoint) { - this.dcrEndpoint = dcrEndpoint; - } - - @XmlElement(name = "TokenEndpoint", required = true) - public String getTokenEndpoint() { - return tokenEndpoint; - } - - public void setTokenEndpoint(String tokenEndpoint) { - this.tokenEndpoint = tokenEndpoint; - } - - @XmlElement(name = "PublisherEndpoint", required = true) - public String getPublisherEndpoint() { - return publisherEndpoint; - } - - public void setPublisherEndpoint(String publisherEndpoint) { - this.publisherEndpoint = publisherEndpoint; - } - - @XmlElement(name = "StoreEndpoint", required = true) - public String getStoreEndpoint() { - return storeEndpoint; - } - - public void setStoreEndpoint(String storeEndpoint) { - this.storeEndpoint = storeEndpoint; - } - - @XmlElement(name = "Username", required = true) - public String getUsername() { - return username; - } - - public void setUsername(String username) { - this.username = username; - } - - @XmlElement(name = "Password", required = true) - public String getPassword() { - return password; - } - - public void setPassword(String password) { - this.password = password; - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/configs/APIMConfigReader.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/configs/APIMConfigReader.java deleted file mode 100644 index 58f39f1a5b..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/configs/APIMConfigReader.java +++ /dev/null @@ -1,95 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.integration.client.configs; - -import org.w3c.dom.Document; -import org.wso2.carbon.apimgt.integration.client.exception.APIMClientException; -import org.wso2.carbon.apimgt.integration.client.exception.InvalidConfigurationStateException; -import org.wso2.carbon.utils.CarbonUtils; - -import javax.xml.XMLConstants; -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import java.io.File; - -/** - * This holds the configuration parser for api integration.xml - */ -public class APIMConfigReader { - - private static APIMConfig config; - private static APIMConfigReader configReader= new APIMConfigReader(); - private static boolean isInitialized = false; - private static final String API_INTEGRATION_CONFIG_PATH = - CarbonUtils.getCarbonConfigDirPath() + File.separator + "apim-integration.xml"; - - private APIMConfigReader() { - - } - - private static String apimIntegrationXmlFilePath = ""; - - //TOD file may be a part of another file - public static APIMConfigReader getInstance() { - if (!isInitialized) { - try { - init(); - } catch (APIMClientException e) { - throw new InvalidConfigurationStateException("Webapp Authenticator Configuration is not " + - "initialized properly"); - } - } - return configReader; - } - - public static void init() throws APIMClientException { - try { - File apimConfigFile = new File(API_INTEGRATION_CONFIG_PATH); - Document doc = convertToDocument(apimConfigFile); - - JAXBContext ctx = JAXBContext.newInstance(APIMConfig.class); - Unmarshaller unmarshaller = ctx.createUnmarshaller(); - config = (APIMConfig) unmarshaller.unmarshal(doc); - isInitialized = true; - } catch (JAXBException e) { - throw new APIMClientException("Error occurred while un-marshalling APIMConfig", e); - } - } - - private static Document convertToDocument(File file) throws APIMClientException { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - try { - factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - return docBuilder.parse(file); - } catch (Exception e) { - throw new APIMClientException("Error occurred while parsing file 'apim-integration.xml' to a org.w3c.dom.Document", e); - } - } - - public APIMConfig getConfig() { - return config; - } - -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/APIMClientException.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/APIMClientException.java deleted file mode 100644 index f893f6d276..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/APIMClientException.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.integration.client.exception; - -/** - * This holds api client exception. - */ -public class APIMClientException extends Exception { - - private static final long serialVersionUID = -3976392476319079281L; - private String responseReason; - private int responseStatus; - private String methodKey; - - APIMClientException(String methodKey, String reason, int status) { - super("Exception occured while invoking " + methodKey + " status = " + status + " reason = " + reason); - this.methodKey = methodKey; - this.responseReason = reason; - this.responseStatus = status; - } - - APIMClientException(String message) { - super(message); - } - - public APIMClientException(String message, Exception e) { - super(message, e); - } - - public String getResponseReason() { - return responseReason; - } - - public int getResponseStatus() { - return responseStatus; - } - - public String getMethodKey() { - return methodKey; - } - -} \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/APIMClientOAuthException.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/APIMClientOAuthException.java deleted file mode 100644 index 359b4b621e..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/APIMClientOAuthException.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.integration.client.exception; - -/** - * This holds api client exception. - */ -public class APIMClientOAuthException extends RuntimeException { - - private static final long serialVersionUID = -3976392476319079281L; - private String responseReason; - private int responseStatus; - private String methodKey; - - APIMClientOAuthException(String methodKey, String reason, int status) { - super("Exception occured while invoking " + methodKey + " status = " + status + " reason = " + reason); - this.methodKey = methodKey; - this.responseReason = reason; - this.responseStatus = status; - } - - public APIMClientOAuthException(String message) { - super(message); - } - - public APIMClientOAuthException(String message, Exception e) { - super(message, e); - } - - public String getResponseReason() { - return responseReason; - } - - public int getResponseStatus() { - return responseStatus; - } - - public String getMethodKey() { - return methodKey; - } - -} \ No newline at end of file diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/InvalidConfigurationStateException.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/InvalidConfigurationStateException.java deleted file mode 100644 index dedb63c4bd..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/exception/InvalidConfigurationStateException.java +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.integration.client.exception; - -/** - * This error is thrown when there is an issue with the client. - */ -public class InvalidConfigurationStateException extends RuntimeException { - - private static final long serialVersionUID = -3151279311329070397L; - - private String errorMessage; - private int errorCode; - - public InvalidConfigurationStateException(int errorCode, String message) { - super(message); - this.errorCode = errorCode; - } - - public InvalidConfigurationStateException(int errorCode, String message, Throwable cause) { - super(message, cause); - this.errorCode = errorCode; - } - - public int getErrorCode() { - return errorCode; - } - - - public String getErrorMessage() { - return errorMessage; - } - - public void setErrorMessage(String errorMessage) { - this.errorMessage = errorMessage; - } - - public InvalidConfigurationStateException(String msg, Exception nestedEx) { - super(msg, nestedEx); - setErrorMessage(msg); - } - - public InvalidConfigurationStateException(String message, Throwable cause) { - super(message, cause); - setErrorMessage(message); - } - - public InvalidConfigurationStateException(String msg) { - super(msg); - setErrorMessage(msg); - } - - public InvalidConfigurationStateException() { - super(); - } - - public InvalidConfigurationStateException(Throwable cause) { - super(cause); - } - -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/internal/APIIntegrationClientDataHolder.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/internal/APIIntegrationClientDataHolder.java deleted file mode 100644 index 56584dfdac..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/internal/APIIntegrationClientDataHolder.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.integration.client.internal; - - -import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; - -/** - * This holds the required service for this component - */ -public class APIIntegrationClientDataHolder { - private static APIIntegrationClientDataHolder thisInstance = new APIIntegrationClientDataHolder(); - private JWTClientManagerService jwtClientManagerService; - private APIIntegrationClientDataHolder() { - } - - - public static APIIntegrationClientDataHolder getInstance() { - return thisInstance; - } - - public void setJwtClientManagerService(JWTClientManagerService jwtClientManagerService) { - this.jwtClientManagerService = jwtClientManagerService; - } - - public JWTClientManagerService getJwtClientManagerService() { - return jwtClientManagerService; - } -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/internal/APIIntegrationClientServiceComponent.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/internal/APIIntegrationClientServiceComponent.java deleted file mode 100644 index 536a5e6c34..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/internal/APIIntegrationClientServiceComponent.java +++ /dev/null @@ -1,81 +0,0 @@ -/* - * Copyright (c) 2017, 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.apimgt.integration.client.internal; - -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.IntegrationClientServiceImpl; -import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader; -import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService; -import org.osgi.service.component.annotations.*; -import io.entgra.device.mgt.core.identity.jwt.client.extension.service.JWTClientManagerService; - -@Component( - name = "org.wso2.carbon.api.integration.client", - immediate = true) -public class APIIntegrationClientServiceComponent { - - private static Log log = LogFactory.getLog(APIIntegrationClientServiceComponent.class); - - @Activate - protected void activate(ComponentContext componentContext) { - try { - if (log.isDebugEnabled()) { - log.debug("Initializing apimgt client bundle"); - } - - /* Initializing webapp publisher configuration */ - APIMConfigReader.init(); - BundleContext bundleContext = componentContext.getBundleContext(); - bundleContext.registerService(IntegrationClientService.class.getName(), IntegrationClientServiceImpl.getInstance(), null); - - if (log.isDebugEnabled()) { - log.debug("apimgt client bundle has been successfully initialized"); - } - } catch (Throwable e) { - log.error("Error occurred while initializing apimgt client bundle", e); - } - } - - @Deactivate - protected void deactivate(ComponentContext componentContext) { - //do nothing - } - - @Reference( - name = "api.integration.client.service", - service = org.wso2.carbon.apimgt.impl.APIManagerConfigurationService.class, - cardinality = ReferenceCardinality.MANDATORY, - policy = ReferencePolicy.DYNAMIC, - bind = "setJWTClientManagerService", - unbind = "unsetJWTClientManagerService") - protected void setJWTClientManagerService(JWTClientManagerService jwtClientManagerService) { - if (jwtClientManagerService != null) { - log.debug("jwtClientManagerService service is initialized"); - } - APIIntegrationClientDataHolder.getInstance().setJwtClientManagerService(jwtClientManagerService); - } - - protected void unsetJWTClientManagerService(JWTClientManagerService jwtClientManagerService) { - APIIntegrationClientDataHolder.getInstance().setJwtClientManagerService(null); - } - -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/ClientProfile.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/ClientProfile.java deleted file mode 100644 index fe1821d3a4..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/ClientProfile.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.integration.client.model; - -/** - * DTO fo DCR request. - */ -public class ClientProfile { - - private String clientName; - private String callbackUrl; - private String tokenScope; - private String owner; - private String grantType; - private boolean saasApp; - - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public String getCallbackUrl() { - return callbackUrl; - } - - public void setCallbackUrl(String callbackUrl) { - this.callbackUrl = callbackUrl; - } - - public String getTokenScope() { - return tokenScope; - } - - public void setTokenScope(String tokenScope) { - this.tokenScope = tokenScope; - } - - public String getOwner() { - return owner; - } - - public void setOwner(String owner) { - this.owner = owner; - } - - public String getGrantType() { - return grantType; - } - - public void setGrantType(String grantTypem) { - this.grantType = grantTypem; - } - - public boolean isSaasApp() { - return saasApp; - } - - public void setSaasApp(boolean saasApp) { - this.saasApp = saasApp; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("{\n"); - - sb.append(" clientName: ").append(clientName).append("\n"); - sb.append(" callbackUrl: ").append("callbackUrl").append("\n"); - sb.append(" grantType: ").append(grantType).append("\n"); - sb.append(" tokenScope: ").append(tokenScope).append("\n"); - sb.append(" owner: ").append(owner).append("\n"); - sb.append(" saasApp: ").append(saasApp).append("\n"); - sb.append("}\n"); - return sb.toString(); - } - -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/DCRClient.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/DCRClient.java deleted file mode 100644 index 2adcfa45ad..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/DCRClient.java +++ /dev/null @@ -1,36 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.integration.client.model; - -import javax.ws.rs.*; -import javax.ws.rs.core.MediaType; - -/** - * DCR Rest resource. - */ -@Path("/") -public interface DCRClient { - - // DCR APIs - @POST - @Produces(MediaType.APPLICATION_JSON) - @Consumes(MediaType.APPLICATION_JSON) - OAuthApplication register(ClientProfile registrationProfile); - -} diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/OAuthApplication.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/OAuthApplication.java deleted file mode 100644 index 7f3bf458f4..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/model/OAuthApplication.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2016, 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.apimgt.integration.client.model; - -public class OAuthApplication { - - private String jsonString; - private String appOwner; - private String clientName; - private String callBackURL; - private String isSaasApplication; - private String clientId; - private String clientSecret; - - public String getJsonString() { - return jsonString; - } - - public void setJsonString(String jsonString) { - this.jsonString = jsonString; - } - - public String getAppOwner() { - return appOwner; - } - - public void setAppOwner(String appOwner) { - this.appOwner = appOwner; - } - - public String getClientName() { - return clientName; - } - - public void setClientName(String clientName) { - this.clientName = clientName; - } - - public String getCallBackURL() { - return callBackURL; - } - - public void setCallBackURL(String callBackURL) { - this.callBackURL = callBackURL; - } - - public String getIsSaasApplication() { - return isSaasApplication; - } - - public void setIsSaasApplication(String isSaasApplication) { - this.isSaasApplication = isSaasApplication; - } - - public String getClientId() { - return clientId; - } - - public void setClientId(String clientId) { - this.clientId = clientId; - } - - public String getClientSecret() { - return clientSecret; - } - - public void setClientSecret(String clientSecret) { - this.clientSecret = clientSecret; - } - - @Override - public String toString() { - StringBuilder sb = new StringBuilder(); - sb.append("class OAuthApplication {\n"); - - sb.append(" jsonString: ").append(jsonString).append("\n"); - sb.append(" appOwner: ").append(appOwner).append("\n"); - sb.append(" clientName: ").append(clientName).append("\n"); - sb.append(" callBackURL: ").append(callBackURL).append("\n"); - sb.append(" isSaasApplication: ").append(isSaasApplication).append("\n"); - sb.append(" clientId: ").append(isSaasApplication).append("\n"); - sb.append(" clientSecret: ").append(clientSecret).append("\n"); - sb.append("}\n"); - return sb.toString(); - } - -} 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 deleted file mode 100644 index 3887d59c66..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/publisher/PublisherClient.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2017, 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.apimgt.integration.client.publisher; - -import feign.Feign; -import feign.Logger; -import feign.RequestInterceptor; -import feign.gson.GsonDecoder; -import feign.gson.GsonEncoder; -import feign.okhttp.OkHttpClient; -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.core.util.Utils; - -/** - * Publisher client generated using swagger. - */ -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; - - - /** - * PublisherClient constructor - Initialize a PublisherClient instance - * - */ - public PublisherClient(RequestInterceptor requestInterceptor) { - Feign.Builder builder = Feign.builder().client(new OkHttpClient( - org.wso2.carbon.apimgt.integration.client.util.Utils.getSSLClient())).logger(new - Slf4jLogger()) - .logLevel(Logger.Level.FULL) - .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); - } - - 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/service/IntegrationClientService.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/service/IntegrationClientService.java deleted file mode 100644 index a98571ef4f..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/service/IntegrationClientService.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2017, 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.apimgt.integration.client.service; - - -import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient; -import org.wso2.carbon.apimgt.integration.client.store.StoreClient; - -/** - * This is a service that can be called upon to access store and publisher. - */ -public interface IntegrationClientService { - - - void resetUserInfo(String username, String tenantDomain); - - /** - * - * @return API Store Client. - */ - StoreClient getStoreClient(); - - /** - * - * @return API Publisher Client. - */ - PublisherClient getPublisherClient(); - -} 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 deleted file mode 100644 index db751f204e..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/store/StoreClient.java +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Copyright (c) 2017, 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.apimgt.integration.client.store; - -import feign.Feign; -import feign.Logger; -import feign.Request; -import feign.RequestInterceptor; -import feign.Retryer; -import feign.gson.GsonDecoder; -import feign.gson.GsonEncoder; -import feign.okhttp.OkHttpClient; -import feign.slf4j.Slf4jLogger; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.apimgt.integration.client.configs.APIMConfigReader; -import org.wso2.carbon.apimgt.integration.generated.client.store.api.*; -import org.wso2.carbon.core.util.Utils; - -import java.util.concurrent.TimeUnit; - -/** - * API Store client, created using swagger gen. - */ -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; - - - public StoreClient(RequestInterceptor requestInterceptor) { - - Feign.Builder builder = Feign.builder().client(new OkHttpClient( - org.wso2.carbon.apimgt.integration.client.util.Utils.getSSLClient())).logger(new - Slf4jLogger()) - .logLevel(Logger.Level.FULL) - .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); - - } - - 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.client/src/main/java/org/wso2/carbon/apimgt/integration/client/util/Utils.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/util/Utils.java deleted file mode 100644 index 369f357ddd..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.client/src/main/java/org/wso2/carbon/apimgt/integration/client/util/Utils.java +++ /dev/null @@ -1,238 +0,0 @@ -/* -* Copyright (c) 2016, 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.apimgt.integration.client.util; - -import okhttp3.OkHttpClient; -import org.apache.commons.lang.StringUtils; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.ServerConfiguration; - -import javax.net.ssl.HostnameVerifier; -import javax.net.ssl.KeyManagerFactory; -import javax.net.ssl.SSLContext; -import javax.net.ssl.SSLSession; -import javax.net.ssl.SSLSocketFactory; -import javax.net.ssl.TrustManager; -import javax.net.ssl.TrustManagerFactory; -import javax.net.ssl.X509TrustManager; -import java.io.FileInputStream; -import java.io.IOException; -import java.io.InputStream; -import java.net.InetSocketAddress; -import java.net.Proxy; -import java.net.ProxySelector; -import java.net.SocketAddress; -import java.net.URI; -import java.security.KeyManagementException; -import java.security.KeyStore; -import java.security.KeyStoreException; -import java.security.NoSuchAlgorithmException; -import java.security.UnrecoverableKeyException; -import java.security.cert.CertificateException; -import java.util.ArrayList; -import java.util.List; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class Utils { - - private static final Log log = LogFactory.getLog(Utils.class); - - private static final String KEY_STORE_TYPE = "JKS"; - /** - * Default truststore type of the client - */ - private static final String TRUST_STORE_TYPE = "JKS"; - /** - * Default keymanager type of the client - */ - private static final String KEY_MANAGER_TYPE = "SunX509"; //Default Key Manager Type - /** - * Default trustmanager type of the client - */ - private static final String TRUST_MANAGER_TYPE = "SunX509"; //Default Trust Manager Type - - private static final String SSLV3 = "SSLv3"; - - private static final String DEFAULT_HOST = "localhost"; - - private static final String DEFAULT_HOST_IP = "127.0.0.1"; - - - //This method is only used if the mb features are within DAS. - public static String replaceProperties(String text) { - String regex = "\\$\\{(.*?)\\}"; - Pattern pattern = Pattern.compile(regex); - Matcher matchPattern = pattern.matcher(text); - while (matchPattern.find()) { - String sysPropertyName = matchPattern.group(1); - String sysPropertyValue = System.getProperty(sysPropertyName); - if (sysPropertyValue != null && !sysPropertyName.isEmpty()) { - text = text.replaceAll("\\$\\{(" + sysPropertyName + ")\\}", sysPropertyValue); - } - } - return text; - } - - public static OkHttpClient getSSLClient() { - - boolean isIgnoreHostnameVerification = Boolean.parseBoolean(System.getProperty("org.wso2" - + ".ignoreHostnameVerification")); - OkHttpClient okHttpClient; - final String proxyHost = System.getProperty("http.proxyHost"); - final String proxyPort = System.getProperty("http.proxyPort"); - final String nonProxyHostsValue = System.getProperty("http.nonProxyHosts"); - - final ProxySelector proxySelector = new ProxySelector() { - @Override - public List select(URI uri) { - List proxyList = new ArrayList<>(); - String host = uri.getHost(); - - if (!StringUtils.isEmpty(host)) { - if (host.startsWith(DEFAULT_HOST_IP) || host.startsWith(DEFAULT_HOST) || StringUtils - .isEmpty(nonProxyHostsValue) || StringUtils.contains(nonProxyHostsValue, host) || - StringUtils.isEmpty(proxyHost) || StringUtils.isEmpty(proxyPort)) { - proxyList.add(Proxy.NO_PROXY); - } else { - proxyList.add(new Proxy(Proxy.Type.HTTP, - new InetSocketAddress(proxyHost, Integer.parseInt(proxyPort)))); - } - } else { - log.error("Host is null. Host could not be empty or null"); - } - return proxyList; - } - - @Override - public void connectFailed(URI uri, SocketAddress sa, IOException ioe) { - throw new UnsupportedOperationException("Not supported yet."); - } - }; - - X509TrustManager trustAllCerts = new X509TrustManager() { - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return new java.security.cert.X509Certificate[0]; - } - public void checkClientTrusted( - java.security.cert.X509Certificate[] certs, String authType) { - } - public void checkServerTrusted( - java.security.cert.X509Certificate[] certs, String authType) { - } - }; - if(isIgnoreHostnameVerification) { - okHttpClient = new OkHttpClient.Builder() - .sslSocketFactory(getSimpleTrustedSSLSocketFactory(), trustAllCerts) - .hostnameVerifier(new HostnameVerifier() { - @Override - public boolean verify(String s, SSLSession sslSession) { - return true; - } - }).proxySelector(proxySelector).build(); - return okHttpClient; - }else { - SSLSocketFactory trustedSSLSocketFactory = getTrustedSSLSocketFactory(); - okHttpClient = new OkHttpClient.Builder().sslSocketFactory(trustedSSLSocketFactory) - .proxySelector(proxySelector).build(); - return okHttpClient; - } - } - - private static SSLSocketFactory getSimpleTrustedSSLSocketFactory() { - try { - TrustManager[] trustAllCerts = new TrustManager[]{ - new X509TrustManager() { - public java.security.cert.X509Certificate[] getAcceptedIssuers() { - return null; - } - public void checkClientTrusted( - java.security.cert.X509Certificate[] certs, String authType) { - } - public void checkServerTrusted( - java.security.cert.X509Certificate[] certs, String authType) { - } - } - }; - SSLContext sc = SSLContext.getInstance("SSL"); - sc.init(null, trustAllCerts, new java.security.SecureRandom()); - return sc.getSocketFactory(); - } catch (KeyManagementException | NoSuchAlgorithmException e) { - return null; - } - - } - - private static SSLSocketFactory getTrustedSSLSocketFactory() { - try { - String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password"); - String keyStoreLocation = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Location"); - String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty( - "Security.TrustStore.Password"); - String trustStoreLocation = ServerConfiguration.getInstance().getFirstProperty( - "Security.TrustStore.Location"); - KeyStore keyStore = loadKeyStore(keyStoreLocation,keyStorePassword,KEY_STORE_TYPE); - KeyStore trustStore = loadTrustStore(trustStoreLocation,trustStorePassword); - - return initSSLConnection(keyStore,keyStorePassword,trustStore); - } catch (KeyManagementException | NoSuchAlgorithmException | KeyStoreException - |CertificateException | IOException | UnrecoverableKeyException e) { - log.error("Error while creating the SSL socket factory due to "+e.getMessage(),e); - return null; - } - - } - - private static SSLSocketFactory initSSLConnection(KeyStore keyStore,String keyStorePassword,KeyStore trustStore) throws NoSuchAlgorithmException, UnrecoverableKeyException, - KeyStoreException, KeyManagementException { - KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KEY_MANAGER_TYPE); - keyManagerFactory.init(keyStore, keyStorePassword.toCharArray()); - TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TRUST_MANAGER_TYPE); - trustManagerFactory.init(trustStore); - - // Create and initialize SSLContext for HTTPS communication - SSLContext sslContext = SSLContext.getInstance(SSLV3); - sslContext.init(keyManagerFactory.getKeyManagers(), trustManagerFactory.getTrustManagers(), null); - SSLContext.setDefault(sslContext); - return sslContext.getSocketFactory(); - } - - - private static KeyStore loadKeyStore(String keyStorePath, String ksPassword,String type) - throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException { - InputStream fileInputStream = null; - try { - char[] keypassChar = ksPassword.toCharArray(); - KeyStore keyStore = KeyStore.getInstance(type); - fileInputStream = new FileInputStream(keyStorePath); - keyStore.load(fileInputStream, keypassChar); - return keyStore; - } finally { - if (fileInputStream != null) { - fileInputStream.close(); - } - } - } - - private static KeyStore loadTrustStore(String trustStorePath, String tsPassword) - throws KeyStoreException, IOException, CertificateException, NoSuchAlgorithmException { - return loadKeyStore(trustStorePath,tsPassword,TRUST_STORE_TYPE); - } -} 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 deleted file mode 100644 index 78a5d81d7f..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/pom.xml +++ /dev/null @@ -1,212 +0,0 @@ - - - - - - apimgt-extensions - io.entgra.device.mgt.core - 5.0.0-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.apimgt.integration.generated.client - bundle - WSO2 Carbon - API Management Integration Generated Client - WSO2 Carbon - API Management Integration Client - https://entgra.io - - - - - - 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 - - - - process-resources - replace-for-swagger-genenerated-code-publisher - - replace - - - ${project.basedir}/target/generated-sources/swagger/src/main/java/org/wso2/carbon/apimgt/integration/generated/client/publisher/model/API.java - - - CURRENT_TENANT - current_tenant - - - ALL_TENANTS - all_tenants - - - SPECIFIC_TENANTS - specific_tenants - - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.artifactId} - ${project.artifactId} - ${project.version} - APIM Integration - - org.wso2.carbon.apimgt.integration.generated.client.publisher.api.*, - org.wso2.carbon.apimgt.integration.generated.client.publisher.model.*, - 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.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 - - - 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 deleted file mode 100644 index b2068857a7..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/publisher-api.yaml +++ /dev/null @@ -1,3691 +0,0 @@ - -swagger: '2.0' -###################################################### -# Prolog -###################################################### -info: - version: "0.12.0" - 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. - contact: - 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 -###################################################### -paths: - /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}" - summary: | - Retrieve/Search APIs - description: | - This operation provides you a list of available APIs qualifying under a given search condition. - - 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 - in: query - description: | - **Search condition**. - - 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. - - Eg. - "provider:wso2*" will match an API if the provider of the API starts with "wso2". - - 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. - - 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). - 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' - -#----------------------------------------------------- -# 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 - 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 - schema: - $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: - Location: - description: | - The URL of the newly created resource. - 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 - 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. - schema: - $ref: '#/definitions/Error' - -###################################################### -# 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 - 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) - 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 - 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' - 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 API does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# 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}" - 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) - 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 - 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' - -#----------------------------------------------------- -# 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" - 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) - 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' - -################################################################ -# The swagger resource of "Individual API" resource APIs -################################################################ - - /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 - 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) - 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 - 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 API does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# 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 - 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) - 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 - 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 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 download a thumbnail image of an API. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - API (Individual) - responses: - 200: - description: | - OK. - 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 - 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' - -#---------------------------------------------------------------------------- -# 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 upload a thumbnail image of an API. The thumbnail to be uploaded should be given as a form data parameter `file`. - 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) - responses: - 200: - description: | - OK. - Image updated - schema: - $ref : '#/definitions/FileInfo' - 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 "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 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 - description: Version of the new API. - type: string - 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 - schema: - $ref: '#/definitions/Error' - 404: - description: | - Not Found. - API to copy does not exist. - 401: - description: | - Unauthenticated request. - 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 **] - - in: query - type: string - 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) - responses: - 200: - description: | - OK. - Lifecycle changed successfully. - headers: - ETag: - description: | - 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 API lifecycle has been modified 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. - 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: - 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 retrive a list of documents belonging to an API by providing the id of the API. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Document (Collection) - responses: - 200: - description: | - OK. - Document list is returned. - schema: - $ref: '#/definitions/DocumentList' - 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). - 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# 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 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: '#/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: - 201: - 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' - headers: - Location: - description: | - Location to the newly created 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 - 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}': - -#----------------------------------------------------- -# Retrieve a particular document of 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/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 retrieve a particular document's metadata associated with 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) - responses: - 200: - description: | - OK. - 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). - 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' - -#----------------------------------------------------- -# 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 - description: | - This operation can be used to update metadata of an API's document. - 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) - responses: - 200: - description: | - OK. - 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). - 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' - -#----------------------------------------------------- -# 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: '#/parameters/apiId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Wsdl (Individual) - responses: - 200: - description: | - OK. - 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 (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 API does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' -#----------------------------------------------------- -# Add a wsdl to the registry -#----------------------------------------------------- - 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 - description: | - This operation can be used to add a WSDL definition to an existing API. - parameters: - - $ref: '#/parameters/apiId' - - in: body - name: body - description: | - JSON payload including WSDL definition that needs to be added - required: true - schema: - $ref: '#/definitions/Wsdl' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Wsdl (Individual) - responses: - 200: - description: | - OK. - 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 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 "Individual Application" resource APIs -###################################################### - '/applications/{applicationId}': - -#----------------------------------------------------- -# Retrieve the details about a certain application -#----------------------------------------------------- - 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 - description: | - This operation can be used to retrieve details of an individual application specifying the application id in the URI. - parameters: - - $ref: '#/parameters/applicationId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Application (Individual) - responses: - 200: - description: | - OK. - 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). - 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 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: - 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 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: '#/parameters/apiId-Q' - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Subscription (Collection) - responses: - 200: - description: | - OK. - Subscription list returned. - schema: - $ref: '#/definitions/SubscriptionList' - 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' - -###################################################### -# 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 get details of a single subscription. - parameters: - - $ref: '#/parameters/subscriptionId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Subscription (Individual) - 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 - 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: '#/parameters/subscriptionId-Q' - - name: blockState - 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) - 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' - 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 -#----------------------------------------------------- - 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' - 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. - 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: - 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: - 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: | - 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: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/tierLevel' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Throttling Tier (Collection) - responses: - 200: - description: | - OK. - List of tiers returned. - 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: - 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' - -#----------------------------------------------------- -# Create a new 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/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: | - 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: - - in: body - name: body - description: | - Tier object that should to be added - required: true - schema: - $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 URL of newly created entity. - schema: - $ref: '#/definitions/Tier' - headers: - Location: - description: | - Location of the newly created tier. - 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' - type: string - 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 Tier" resource APIs -###################################################### - '/tiers/{tierLevel}/{tierName}': - -#----------------------------------------------------- -# Retrieve a certain tier -#----------------------------------------------------- - 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 - 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"`. - parameters: - - $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. - 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 (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 Tier does not exist. - schema: - $ref: '#/definitions/Error' - 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 - 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. - 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) - responses: - 200: - description: | - OK. - 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 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' - -#----------------------------------------------------- -# 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 - 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. - parameters: - - $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. - 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 - description: | - This operation can be used to update tier permissions which controls access for the particular tier based on the subscribers' roles. - 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) - responses: - 200: - description: | - OK. - Successfully updated tier permissions - schema: - type: array - items: - $ref: '#/definitions/Tier' - headers: - ETag: - description: | - 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 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: - description: | - Forbidden. - The request must be conditional but no condition has been specified. - schema: - $ref: '#/definitions/Error' - 404: - description: | - Not Found. - Requested tier 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 "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 - description: | - This operation can be used to retrieve the list of gateway environments available. - parameters: - - $ref: '#/parameters/apiId-Q' - tags: - - Environment (Collection) - responses: - 200: - description: | - OK. - Environment list is returned. - schema: - $ref: '#/definitions/EnvironmentList' - 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). - 404: - 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: - 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 provides you a list of available all global level mediation policies. - 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) - responses: - 200: - description: | - OK. - 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). - 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' - - - -###################################################### -# 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 approve or reject a workflow task. - 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) - responses: - 200: - description: | - OK. - Workflow request information is returned. - schema: - $ref: '#/definitions/Workflow' - headers: - Content-Type: - description: | - The content type of the body. - type: string - 400: - description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' - 404: - 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: - 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: string - example: ["http","https"] - tags: - type: array - description: Search keywords related to the API - items: - type: string - example: ["substract","add"] - tiers: - type: array - description: The subscription tiers selected for the particular API - items: - 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: - type: string - example: basic - description: Accepts one of the following, basic or digest. - enum: - - basic - - digest - username: - type: string - example: admin - password: - 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"] - 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: - properties: - businessOwner: - type: string - example: businessowner - businessOwnerEmail: - type: string - 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 - accessControlAllowMethods: - type: array - items: - 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: - 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: - 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: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorDoc - type: - type: string - enum: - - HOWTO - - SAMPLES - - PUBLIC_FORUM - - SUPPORT_FORUM - - API_MESSAGE_FORMAT - - SWAGGER_DOC - - OTHER - example: HOWTO - summary: - type: string - example: "Summary of Calculator Documentation" - sourceType: - type: string - enum: - - INLINE - - URL - - FILE - example: INLINE - sourceUrl: - type: string - example: "" - otherTypeName: - type: string - example: "" - visibility: - 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: - type: string - description: | - Link to the next subset of sequences qualified. - Empty if no more sequences are to be returned. - example: "" - previous: - 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: - type: string - example: json_fault.xml - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - type: - type: string - enum: - - in - - out - - fault - example: in -#----------------------------------------------------- -# The Mediation resource -#----------------------------------------------------- - Mediation: - title: Mediation - required: - - name - - type - - config - properties: - id: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: json_fault.xml - type: - type: string - 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 - - -# The Tier List resource -#----------------------------------------------------- - TierList: - title: Tier List - properties: - count: - type: integer - description: | - Number of Tiers 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: "/tiers/api?limit=1&offset=2" - previous: - 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: - type: string - example: Platinum - description: - type: string - example: "Allows 50 request(s) per minute." - tierLevel: - 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: - 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: - 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: - 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: - 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: '#/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 - message: - type: string - description: | - Description about individual errors occurred - -#----------------------------------------------------- -# The Environment resource -#----------------------------------------------------- - Environment: - title: Environment - required: - - name - - type - - serverUrl - - endpoints - - showInApiConsole - properties: - name: - type: string - example: Production and Sandbox - type: - type: string - example: hybrid - serverUrl: - 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: - 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.integration.generated.client/src/main/resources/store-api.yaml b/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/store-api.yaml deleted file mode 100644 index a57b96d4ab..0000000000 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.integration.generated.client/src/main/resources/store-api.yaml +++ /dev/null @@ -1,2693 +0,0 @@ -# Copyright (c) 2017, 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. -################################################################################ - -swagger: '2.0' -###################################################### -# Prolog -###################################################### -info: - version: "0.12.0" - title: "WSO2 API Manager - Store" - description: | - This specifies a **RESTful API** for WSO2 **API Manager** - Store. - - Please see [full swagger definition](https://raw.githubusercontent.com/wso2/carbon-apimgt/v6.1.66/components/apimgt/org.wso2.carbon.apimgt.rest.api.store/src/main/resources/store-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" - 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/store/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: Internal/subscriber - name: apim:subscribe - key: apim:subscribe - -###################################################### -# The "API Collection" resource APIs -###################################################### -paths: - /apis: - -#----------------------------------------------------- -# Retrieving the list of all APIs qualifying under a given search condition -#----------------------------------------------------- - get: - x-wso2-curl: "curl https://localhost:9443/api/am/store/v0.12/apis" - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" https://localhost:9443/api/am/store/v0.12/apis" - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/apis - 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 API provide Account Status Validation.\",\n \"status\": \"PUBLISHED\",\n \"name\": \"AccountVal\",\n \"context\": \"/account/1.0.0\",\n \"id\": \"2e81f147-c8a8-4f68-b4f0-69e0e7510b01\"\n },\n {\n \"provider\": \"admin\",\n \"version\": \"1.0.0\",\n \"description\": null,\n \"status\": \"PUBLISHED\",\n \"name\": \"api1\",\n \"context\": \"/api1/1.0.0\",\n \"id\": \"3e22d2fb-277a-4e9e-8c7e-1c0f7f73960e\"\n },\n {\n \"provider\": \"admin\",\n \"version\": \"2.0.0\",\n \"description\": \"Verify a phone number\",\n \"status\": \"PUBLISHED\",\n \"name\": \"PhoneVerification\",\n \"context\": \"/phoneverify/2.0.0\",\n \"id\": \"c43a325c-260b-4302-81cb-768eafaa3aed\"\n }\n ],\n \"count\": 3,\n \"next\": \"\"\n}" - summary: | - Retrieve/Search APIs - description: | - This operation provides you a list of available APIs qualifying under a given search condition. - - 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. - - This operation supports retriving APIs of other tenants. The required tenant domain need to be specified as a header `X-WSO2-Tenant`. If not specified super tenant's APIs will be retrieved. If you used an Authorization header, the user's tenant associated with the access token will be used. - - **NOTE:** - * By default, this operation retrieves Published APIs. In order to retrieve Prototyped APIs, you need to use **query** parameter and specify **status:PROTOTYPED**. - * This operation does not require an Authorization header by default. But if it is provided, it will be validated and checked for permissions of the user, hence you may be able to see APIs which are restricted for special permissions/roles. - parameters: - - $ref : '#/parameters/limit' - - $ref : '#/parameters/offset' - - $ref : '#/parameters/requestedTenant' - - name : query - in: query - description: | - **Search condition**. - - 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. - - Eg. - "provider:wso2*" will match an API if the provider of the API starts with "wso2". - - Supported attribute modifiers are [**version, context, status, - description, subcontext, doc, provider, tag**] - - If no advanced attribute modifier has been specified, search will match the - given query string against API Name. - - 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). - 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' - -###################################################### -# The "Individual API" resource APIs -###################################################### - /apis/{apiId}: - -#----------------------------------------------------- -# Retrieve the details of an API definition -#----------------------------------------------------- - get: - x-wso2-curl: "curl https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed" - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed" - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\r\n \"thumbnailUrl\": null,\r\n \"tiers\": [\"Unlimited\"],\r\n \"businessInformation\": {\r\n \"technicalOwner\": \"John Doe\",\r\n \"technicalOwnerEmail\": \"architecture@pizzashack.com\",\r\n \"businessOwner\": \"Jane Roe\",\r\n \"businessOwnerEmail\": \"marketing@pizzashack.com\"\r\n },\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\\\"},\\\"Content-Type\\\":{\\\"description\\\":\\\"The content type of the body.\\\",\\\"type\\\":\\\"string\\\"}},\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"description\\\":\\\"Created. Successful response with the newly created object as entity in the body. Location header contains URL of newly created entity.\\\"}}}},\\\"/order/{orderId}\\\":{\\\"get\\\":{\\\"x-auth-type\\\":\\\"Application & Application User\\\",\\\"x-throttling-tier\\\":\\\"Unlimited\\\",\\\"description\\\":\\\"Get details of an Order\\\",\\\"parameters\\\":[{\\\"description\\\":\\\"Order Id\\\",\\\"name\\\":\\\"orderId\\\",\\\"format\\\":\\\"string\\\",\\\"type\\\":\\\"string\\\",\\\"required\\\":true,\\\"in\\\":\\\"path\\\"}],\\\"responses\\\":{\\\"200\\\":{\\\"schema\\\":{\\\"$ref\\\":\\\"#/definitions/Order\\\"},\\\"headers\\\":{},\\\"description\\\":\\\"OK Requested Order will be returned\\\"}}}}},\\\"schemes\\\":[\\\"https\\\"],\\\"produces\\\":[\\\"application/json\\\"],\\\"swagger\\\":\\\"2.0\\\",\\\"definitions\\\":{\\\"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 \"isDefaultVersion\": false,\r\n \"endpointURLs\": [ {\r\n \"environmentName\": \"Production and Sandbox\",\r\n \"environmentType\": \"hybrid\",\r\n \"environmentURLs\": {\r\n \"http\": \"http://localhost:8280//pizzashack/1.0.0\",\r\n \"https\": \"https://localhost:8243//pizzashack/1.0.0\"\r\n }\r\n }],\r\n \"transport\": [\r\n \"http\",\r\n \"https\"\r\n ],\r\n \"tags\": [\"pizza\"],\r\n \"version\": \"1.0.0\",\r\n \"description\": \"This document describe a RESTFul API for Pizza Shack online pizza delivery store.\\r\\n\",\r\n \"provider\": \"admin\",\r\n \"name\": \"PizzaShackAPI\",\r\n \"context\": \"/pizzashack/1.0.0\",\r\n \"id\": \"8848faaa-7fd1-478a-baa2-48a4ebb92c98\",\r\n \"status\": \"PUBLISHED\"\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. - - `X-WSO2-Tenant` header can be used to retrive an API of 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. - - **NOTE:** - * This operation does not require an Authorization header by default. But if it is provided, it will be validated and checked for permissions of the user, hence you may be able to see APIs which are restricted for special permissions/roles. \n - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - - $ref: '#/parameters/requestedTenant' - 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. - 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' - 304: - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource. - 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - - - /apis/{apiId}/swagger: -#----------------------------------------------------- -# Retrieve the API swagger definition -#----------------------------------------------------- - get: - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed/swagger - x-wso2-curl: "curl https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed/swagger" - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed/swagger" - 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\": \"2.0.0\"\n }\n}\n" - summary: | - Get swagger definition - description: | - You can use this operation to retrieve the swagger definition of an API. - - `X-WSO2-Tenant` header can be used to retrive the swagger definition an API of 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. - - **NOTE:** - * This operation does not require an Authorization header by default. But in order to see a restricted API's swagger definition, you need to provide Authorization header. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - - $ref: '#/parameters/requestedTenant' - 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. - 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. - 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# Generate SDK for an API -#----------------------------------------------------- - /apis/generate-sdk/: - post: - x-scope: apim:subscribe - x-wso2-request: | - POST https://localhost:9443/api/am/store/v0.12/apis/generate-sdk?apiId=e93fb282-b456-48fc-8981-003fb89086ae&language=java - Authorization: Bearer 2e29904b-f3b0-366e-ba13-b469abedd88e - x-wso2-curl: "curl -k -H \"Authorization: Bearer 2e29904b-f3b0-366e-ba13-b469abedd88e\" -X POST 'https://localhost:9443/api/am/store/v0.12/apis/generate-sdk?apiId=5721d128-76d0-4cb9-b300-2bd9578beddb&language=java' > PizzaAPI_Java_SDK.zip" - x-wso2-response: "HTTP/1.1 200 OK \nContent-Disposition: attachment; filename=\"PizzaShackAPI_1.0.0_java.zip\"\nContent-Type: application/zip\n\n[zip content]" - summary: | - Generate SDK for an API - description: | - This operation can be used to generate SDK for an API by providing the id of the API along with the preferred language. - parameters: - - $ref: '#/parameters/apiId-Q' - - $ref: '#/parameters/language' - - $ref : '#/parameters/requestedTenant' - tags: - - API (Individual) - responses: - 200: - description: | - OK. - SDK generated successfully. - headers: - Content-Type: - description: | - The content type of the body. - type: string - 400: - description: | - Bad request. - SDK language is not supported. - schema: - $ref: '#/definitions/Error' - 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - 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: - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed/documents - x-wso2-curl: "curl https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed/documents" - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed/documents" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"850a4f34-db2c-4d23-9d85-3f95fbfb082c\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n },\n {\n \"sourceType\": \"URL\",\n \"sourceUrl\": \"http://wiki.cdyne.com/index.php/Phone_Verification\",\n \"otherTypeName\": null,\n \"documentId\": \"98e18be8-5861-43c7-ba26-8cbbccd3a76f\",\n \"summary\": \"This is the URL for online documentation\",\n \"name\": \"Online Documentation\",\n \"type\": \"SAMPLES\"\n },\n {\n \"sourceType\": \"FILE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"b66451ff-c6c2-4f6a-b91d-3821dc119b04\",\n \"summary\": \"This is a sample documentation pdf\",\n \"name\": \"Introduction to PhoneVerification API PDF\",\n \"type\": \"HOWTO\"\n }\n ],\n \"count\": 3,\n \"next\": \"\"\n}" - summary: | - Get a list of documents of an API - description: | - This operation can be used to retrive a list of documents belonging to an API by providing the id of the API. - - `X-WSO2-Tenant` header can be used to retrive documents of an API 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. - - **NOTE:** - * This operation does not require an Authorization header by default. But in order to see a restricted API's documents, you need to provide Authorization header. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/requestedTenant' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Document (Collection) - responses: - 200: - description: | - OK. - Document list is returned. - schema: - $ref: '#/definitions/DocumentList' - 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). - 404: - description: | - Not Found. - Requested API does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Individual Document" resource APIs -###################################################### - '/apis/{apiId}/documents/{documentId}': - -#----------------------------------------------------- -# Retrieve a particular document of a certain API -#----------------------------------------------------- - get: - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed/documents/850a4f34-db2c-4d23-9d85-3f95fbfb082c - x-wso2-curl: "curl \"https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed/documents/850a4f34-db2c-4d23-9d85-3f95fbfb082c\"" - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" https://localhost:9443/api/am/store/v0.12/apis/c43a325c-260b-4302-81cb-768eafaa3aed/documents/850a4f34-db2c-4d23-9d85-3f95fbfb082c" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"sourceType\": \"INLINE\",\n \"sourceUrl\": null,\n \"otherTypeName\": null,\n \"documentId\": \"850a4f34-db2c-4d23-9d85-3f95fbfb082c\",\n \"summary\": \"This is a sample documentation for v1.0.0\",\n \"name\": \"PhoneVerification API Documentation\",\n \"type\": \"HOWTO\"\n}" - summary: | - Get a document of an API - description: | - This operation can be used to retrieve a particular document's metadata associated with an API. - - `X-WSO2-Tenant` header can be used to retrive a document of an API 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. - - **NOTE:** - * This operation does not require an Authorization header by default. But in order to see a restricted API's document, you need to provide Authorization header. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/documentId' - - $ref: '#/parameters/requestedTenant' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Document (Individual) - responses: - 200: - description: | - OK. - 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. - 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. - 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' - - -################################################################ -# 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-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5/content - x-wso2-curl: "curl \"https://localhost:9443/api/am/store/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5/content\" > sample.pdf" - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" \"https://localhost:9443/api/am/store/v0.12/apis/890a4f4d-09eb-4877-a323-57f6ce2ed79b/documents/0bcb7f05-599d-4e1a-adce-5cb89bfe58d5/content\" > sample.pdf" - 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 - 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` - - `X-WSO2-Tenant` header can be used to retrive the content of a document of an API 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. - - **NOTE:** - * This operation does not require an Authorization header by default. But in order to see a restricted API's document content, you need to provide Authorization header. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/documentId' - - $ref: '#/parameters/requestedTenant' - - $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. - 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. - 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' - -################################################################ -# The thumbnail resource of "Individual API" resource APIs -################################################################ - - /apis/{apiId}/thumbnail: -#------------------------------------------------------------------------------------------------- -# Downloads a thumbnail image of an API -#------------------------------------------------------------------------------------------------- - get: - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/apis/e93fb282-b456-48fc-8981-003fb89086ae/thumbnail - x-wso2-curl: "curl https://localhost:9443/api/am/store/v0.12/apis/e93fb282-b456-48fc-8981-003fb89086ae/thumbnail > image.jpg" - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" https://localhost:9443/api/am/store/v0.12/apis/e93fb282-b456-48fc-8981-003fb89086ae/thumbnail > image.jpg" - 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 download a thumbnail image of an API. - - `X-WSO2-Tenant` header can be used to retrive a thumbnail of an API 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. - - **NOTE:** - * This operation does not require an Authorization header by default. But in order to see a restricted API's thumbnail, you need to provide Authorization header. - parameters: - - $ref: '#/parameters/apiId' - - $ref: '#/parameters/requestedTenant' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - API (Individual) - responses: - 200: - description: | - OK. - 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. - 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. - 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' - -###################################################### -# The "Application Collection" resource APIs -###################################################### - /applications: - -#----------------------------------------------------- -# Retrieve a list of all applications of a certain subscriber -#----------------------------------------------------- - get: - x-scope: apim:subscribe - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/applications - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/store/v0.12/applications\"" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"groupId\": \"\",\n \"subscriber\": \"admin\",\n \"throttlingTier\": \"Unlimited\",\n \"applicationId\": \"367a2361-8db5-4140-8133-c6c8dc7fa0c4\",\n \"description\": \"\",\n \"status\": \"APPROVED\",\n \"name\": \"app1\"\n },\n {\n \"groupId\": \"\",\n \"subscriber\": \"admin\",\n \"throttlingTier\": \"Unlimited\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"description\": null,\n \"status\": \"APPROVED\",\n \"name\": \"DefaultApplication\"\n }\n ],\n \"count\": 2,\n \"next\": \"\"\n}" - summary: | - Retrieve/Search applications - description: | - This operation can be used to retrieve list of applications that is belonged to the user associated with the provided access token. - parameters: - - $ref: '#/parameters/groupId' - - name : query - in: query - description: | - **Search condition**. - - You can search for an application by specifying the name as "query" attribute. - - Eg. - "app1" will match an application if the name is exactly "app1". - - Currently this does not support wildcards. Given name must exactly match the application name. - type: string - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Application (Collection) - responses: - 200: - description: | - OK. - Application list returned. - schema: - $ref: '#/definitions/ApplicationList' - 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). - 400: - description: | - Bad Request. - Invalid request or validation error. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported. - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# Create a new application -#----------------------------------------------------- - post: - x-scope: apim:subscribe - 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/store/v0.12/applications\"" - x-wso2-request: "POST https://localhost:9443/api/am/store/v0.12/applications\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\n \"throttlingTier\": \"Unlimited\",\n \"description\": \"sample app description\",\n \"name\": \"sampleapp\",\n \"callbackUrl\": \"http://my.server.com/callback\"\n}" - x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/store/v0.12/applications/c30f3a6e-ffa4-4ae7-afce-224d1f820524\nContent-Type: application/json\n\n{\n \"groupId\": null,\n \"callbackUrl\": \"http://my.server.com/callback\",\n \"subscriber\": \"admin\",\n \"throttlingTier\": \"Unlimited\",\n \"applicationId\": \"c30f3a6e-ffa4-4ae7-afce-224d1f820524\",\n \"description\": \"sample app description\",\n \"status\": \"APPROVED\",\n \"name\": \"sampleapp\",\n \"keys\": []\n}" - summary: | - Create a new application - description: | - This operation can be used to create a new application specifying the details of the application in the payload. - parameters: - - in: body - name: body - description: | - Application object that is to be created. - required: true - schema: - $ref: '#/definitions/Application' - - $ref: '#/parameters/Content-Type' - tags: - - Application (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/Application' - headers: - Location: - description: | - Location of the newly created Application. - 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 - 400: - description: | - Bad Request. - Invalid request or validation error - schema: - $ref: '#/definitions/Error' - 409: - description: | - Conflict. - Application already exists. - schema: - $ref: '#/definitions/Error' - 415: - description: | - Unsupported media type. - The entity of the request was in a not supported format. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Individual Application" resource APIs -###################################################### - '/applications/{applicationId}': - -#----------------------------------------------------- -# Retrieve the details about a certain application -#----------------------------------------------------- - get: - x-scope: apim:subscribe - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/store/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015\"" - x-wso2-request: | - GET https://localhost:9443/api/am/store/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 \"callbackUrl\": null,\n \"subscriber\": \"admin\",\n \"throttlingTier\": \"Unlimited\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"description\": null,\n \"status\": \"APPROVED\",\n \"name\": \"DefaultApplication\",\n \"keys\": [ {\n \"consumerKey\": \"AVoREWiB16kY_GTIzscl40GYYZQa\",\n \"consumerSecret\": \"KXQxmS8W3xDvvJH4AfR6xrhKIeIa\",\n \"keyState\": \"COMPLETED\",\n \"keyType\": \"PRODUCTION\",\n \"supportedGrantTypes\": null,\n \"token\": {\n \"validityTime\": 3600,\n \"accessToken\": \"3887da6d111f0429c6dff47a46e87209\",\n \"tokenScopes\": [\n \"am_application_scope\",\n \"default\"\n ]\n }\n }]\n}" - summary: | - Get details of an application - description: | - This operation can be used to retrieve details of an individual application specifying the application id in the URI. - parameters: - - $ref: '#/parameters/applicationId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Application (Individual) - responses: - 200: - description: | - OK. - 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. - 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. - 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' - -#----------------------------------------------------- -# Update a certain application -#----------------------------------------------------- - put: - x-scope: apim:subscribe - 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/store/v0.12/applications/c30f3a6e-ffa4-4ae7-afce-224d1f820524\"" - x-wso2-request: "PUT https://localhost:9443/api/am/store/v0.12/applications/c30f3a6e-ffa4-4ae7-afce-224d1f820524\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\n \"callbackUrl\": \"\",\n \"throttlingTier\": \"Bronze\",\n \"description\": \"sample app description updated\",\n \"name\": \"sampleapp\"\n}" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"groupId\": null,\n \"callbackUrl\": \"\",\n \"subscriber\": \"admin\",\n \"throttlingTier\": \"Bronze\",\n \"applicationId\": \"c30f3a6e-ffa4-4ae7-afce-224d1f820524\",\n \"description\": \"sample app description updated\",\n \"status\": \"APPROVED\",\n \"name\": \"sampleapp\",\n \"keys\": []\n}" - summary: | - Update an application - description: | - This operation can be used to update an application. Upon succesfull you will retrieve the updated application as the response. - parameters: - - $ref: '#/parameters/applicationId' - - in: body - name: body - description: | - Application object that needs to be updated - required: true - schema: - $ref: '#/definitions/Application' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Application (Individual) - responses: - 200: - description: | - OK. - Application updated. - schema: - $ref: '#/definitions/Application' - 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. - 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' - -#----------------------------------------------------- -# Delete a certain application -#----------------------------------------------------- - delete: - x-scope: apim:subscribe - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE \"https://localhost:9443/api/am/store/v0.12/applications/367a2361-8db5-4140-8133-c6c8dc7fa0c4\"" - x-wso2-request: | - DELETE https://localhost:9443/api/am/store/v0.12/applications/367a2361-8db5-4140-8133-c6c8dc7fa0c4 - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK" - summary: | - Remove an application - description: | - This operation can be used to remove an application specifying its id. - parameters: - - $ref: '#/parameters/applicationId' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Application (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 "Application Keys of a Given Type" resource APIs -###################################################### - '/applications/{applicationId}/keys/{keyType}': - -#----------------------------------------------------------- -# Retrieve key details of a given type (PRODUCTION/SANDBOX) -#----------------------------------------------------------- - get: - x-scope: apim:subscribe - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/store/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015/keys/PRODUCTION\"" - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015/keys/PRODUCTION - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n {\n \"consumerKey\": \"QwEtRHd4NJkcFuRUfAT5af8XEEoa\",\n \"consumerSecret\": \"7Fairfeu321ENjOR9w2xgJl3i70a\",\n \"supportedGrantTypes\": [\n \"refresh_token\",\n \"urn:ietf:params:oauth:grant-type:saml2-bearer\",\n \"password\",\n \"client_credentials\",\n \"iwa:ntlm\"\n ],\n \"callbackUrl\": \"http://sample/com/callback\",\n \"keyState\": \"COMPLETED\",\n \"keyType\": \"PRODUCTION\"}\n" - summary: | - Get key details of a given type - description: | - This operation can be used to retrieve key details of an individual application specifying the key type in the URI. - parameters: - - $ref: '#/parameters/applicationId' - - $ref: '#/parameters/keyType' - - $ref: '#/parameters/groupId' - - $ref: '#/parameters/Accept' - tags: - - Application (Individual) - - Application Keys - responses: - 200: - description: | - OK. - Application key details returned. - schema: - $ref: '#/definitions/ApplicationKey' - headers: - Content-Type: - description: | - The content type of the body. - type: string - 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' - -#----------------------------------------------------- -# Update grant types and callback url of an application -#----------------------------------------------------- - put: - x-scope: apim:subscribe - 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/store/v0.12/applications/c30f3a6e-ffa4-4ae7-afce-224d1f820524/keys/SANDBOX\"" - x-wso2-request: | - PUT https://localhost:9443/api/am/store/v0.12/applications/896658a0-b4ee-4535-bbfa-806c894a4015/keys/SANDBOX - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - { - "supportedGrantTypes": [ - "refresh_token", - "urn:ietf:params:oauth:grant-type:saml2-bearer", - "password", - "client_credentials", - "iwa:ntlm" - ], - "callbackUrl": "http://sample/com/callback" - } - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n {\n \"consumerKey\": \"QwEtRHd4NJkcFuRUfAT5af8XEEoa\",\n \"consumerSecret\": \"7Fairfeu321ENjOR9w2xgJl3i70a\",\n \"supportedGrantTypes\": [\n \"refresh_token\",\n \"urn:ietf:params:oauth:grant-type:saml2-bearer\",\n \"password\",\n \"client_credentials\",\n \"iwa:ntlm\"\n ],\n \"callbackUrl\": \"http://sample/com/callback\",\n \"keyState\": \"COMPLETED\",\n \"keyType\": \"PRODUCTION\"}\n" - summary: | - Update grant types and callback url of an application - description: | - This operation can be used to update grant types and callback url of an application. (Consumer Key and Consumer Secret are ignored) Upon succesfull you will retrieve the updated key details as the response. - parameters: - - $ref: '#/parameters/applicationId' - - $ref: '#/parameters/keyType' - - in: body - name: body - description: | - Grant types/Callback URL update request object - required: true - schema: - $ref: '#/definitions/ApplicationKey' - tags: - - Application (Individual) - - Application Keys - responses: - 200: - description: | - Ok. - Grant types or/and callback url is/are updated. - schema: - $ref: '#/definitions/ApplicationKey' - 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 "Generate Keys" Processing Function resource API -###################################################### - '/applications/generate-keys': - -#----------------------------------------------------- -# Generate keys for an application -#----------------------------------------------------- - post: - x-scope: apim:subscribe - 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/store/v0.12/applications/generate-keys?applicationId=c30f3a6e-ffa4-4ae7-afce-224d1f820524\"" - x-wso2-request: "POST https://localhost:9443/api/am/store/v0.12/applications/generate-keys?applicationId=c30f3a6e-ffa4-4ae7-afce-224d1f820524\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\n \"validityTime\": \"3600\",\n \"keyType\": \"PRODUCTION\",\n \"accessAllowDomains\": [\"ALL\"\n ]\n}" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"consumerSecret\": \"8V7DDKtKGtuG_9GDjaOJ5sijdX0a\",\n \"consumerKey\": \"LOFL8He72MSGVil4SS_bsh9O8MQa\",\n \"keyState\": \"APPROVED\",\n \"keyType\": \"PRODUCTION\",\n \"supportedGrantTypes\": [\n \"urn:ietf:params:oauth:grant-type:saml2-bearer\",\n \"iwa:ntlm\",\n \"refresh_token\",\n \"client_credentials\",\n \"password\"\n ],\n \"token\": {\n \"validityTime\": 3600,\n \"accessToken\": \"fd2cdc4906fbc162e033d57f85a71c21\",\n \"tokenScopes\": [\n \"am_application_scope\",\n \"default\"\n ]\n }\n}" - summary: | - Generate keys for application - description: | - This operation can be used to generate client Id and client secret for an application - parameters: - - $ref: '#/parameters/applicationId-Q' - - in: body - name: body - description: | - Application object the keys of which are to be generated - required: true - schema: - $ref: '#/definitions/ApplicationKeyGenerateRequest' - - $ref: '#/parameters/Content-Type' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Application (Individual) - responses: - 200: - description: | - OK. - Keys are generated. - schema: - $ref: '#/definitions/ApplicationKey' - 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 - 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 (Will be supported in future). - schema: - $ref: '#/definitions/Error' - '/applications/scopes/{applicationId}': - get: - x-scope: 'apim:subscribe' - x-wso2-request: |- - GET https://127.0.0.1:9443/api/am/store/v0.12/applications/scopes/896658a0-b4ee-4535-bbfa-806c894a4015 - Authorization: Beareraa0ddec1ac656744234477f20fafcb0d - x-wso2-curl: 'curl -k -H "Authorization: Bearer aa0ddec1ac656744234477f20fafcb0d" "https://127.0.0.1:9443/api/am/store/v0.12/applications/scopes/896658a0-b4ee-4535-bbfa-806c894a4015"' - x-wso2-response: |- - HTTP/1.1 200 OK - Content-Type: application/json - - { - "groupId": "", - "callbackUrl": null, - "subscriber": "admin", - "throttlingTier": "Unlimited", - "applicationId": "896658a0-b4ee-4535-bbfa-806c894a4015", - "description": null, - "status": "APPROVED", - "name": "DefaultApplication", - "keys": [ { - "consumerKey": "AVoREWiB16kY_GTIzscl40GYYZQa", - "consumerSecret": "KXQxmS8W3xDvvJH4AfR6xrhKIeIa", - "keyState": "COMPLETED", - "keyType": "PRODUCTION", - "supportedGrantTypes": null, - "token": { - "validityTime": 3600, - "accessToken": "3887da6d111f0429c6dff47a46e87209", - "tokenScopes": [ - "am_application_scope", - "default" - ] - } - }] - } - summary: | - Get scopes associated with a particular application based on subscribed APIs - description: | - Get scopes associated with a particular application based on subscribed APIs - parameters: - - $ref: '#/parameters/applicationId' - - $ref: '#/parameters/filterByUserRoles' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Application (Individual) - responses: - '200': - description: | - OK. - Scope returned. - schema: - $ref: '#/definitions/ScopeList' - 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. - type: string - Last-Modified: - description: | - Date and time the resource has been modifed the last time. - Used by caches, or in conditional reuquests. - type: string - '304': - description: | - Not Modified. - Empty body because the client has already the latest version of the requested resource. - '401': - description: | - Un authorized. - The user is not authorized to view the application . - schema: - $ref: '#/definitions/Error' - '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 and application -#----------------------------------------------------- - get: - x-scope: apim:subscribe - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/store/v0.12/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed\"" - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed - 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 \"tier\": \"Bronze\",\n \"subscriptionId\": \"03b8ef2b-5ae5-41f5-968e-52fa7fbd5d33\",\n \"apiIdentifier\": \"admin-PhoneVerification-2.0.0\",\n \"applicationId\": \"896658a0-b4ee-4535-bbfa-806c894a4015\",\n \"status\": \"UNBLOCKED\"\n },\n {\n \"tier\": \"Bronze\",\n \"subscriptionId\": \"5ed42650-9f5e-4dd4-94f3-3f09f1b17354\",\n \"apiIdentifier\": \"admin-PhoneVerification-2.0.0\",\n \"applicationId\": \"846118a5-3b25-4c22-a983-2d0278936f09\",\n \"status\": \"UNBLOCKED\"\n }\n ],\n \"count\": 2,\n \"next\": \"\"\n}" - 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 applications which are subscibed to a specific API. - `GET https://localhost:9443/api/am/store/v0.12/subscriptions?apiId=c43a325c-260b-4302-81cb-768eafaa3aed` - - 2. Retrieving APIs which are subscribed by a specific application. - `GET https://localhost:9443/api/am/store/v0.12/subscriptions?applicationId=c43a325c-260b-4302-81cb-768eafaa3aed` - - **IMPORTANT:** - * It is mandatory to provide either **apiId** or **applicationId**. - parameters: - - $ref: '#/parameters/apiId-Q' - - $ref: '#/parameters/applicationId-Q' - - $ref: '#/parameters/groupId' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/limit' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Subscription (Collection) - responses: - 200: - description: | - OK. - Subscription list returned. - schema: - $ref: '#/definitions/SubscriptionList' - 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' - -#----------------------------------------------------- -# Create a new subscription -#----------------------------------------------------- - post: - x-scope: apim:subscribe - 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/store/v0.12/subscriptions\"" - x-wso2-request: "POST https://localhost:9443/api/am/store/v0.12/subscriptions\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"c43a325c-260b-4302-81cb-768eafaa3aed\",\n \"applicationId\": \"c30f3a6e-ffa4-4ae7-afce-224d1f820524\"\n}" - x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/store/v0.12/subscriptions/5b65808c-cdf2-43e1-a695-de63e3ad0ae9\nContent-Type: application/json\n\n{\n \"tier\": \"Gold\",\n \"subscriptionId\": \"5b65808c-cdf2-43e1-a695-de63e3ad0ae9\",\n \"apiIdentifier\": \"admin-PhoneVerification-2.0.0\",\n \"applicationId\": \"c30f3a6e-ffa4-4ae7-afce-224d1f820524\",\n \"status\": \"UNBLOCKED\"\n}" - summary: | - Add a new subscription - description: | - This operation can be used to add a new subscription providing the id of the API and the application. - parameters: - - in: body - name: body - description: | - Subscription object that should to be added - required: true - schema: - $ref: '#/definitions/Subscription' - - $ref: '#/parameters/Content-Type' - tags: - - Subscription (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/Subscription' - headers: - Location: - description: | - Location to the newly created subscription. - 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 - 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 "Multiple Subscriptions" resource API -###################################################### - '/subscriptions/multiple': -#----------------------------------------------------- -# Create a batch of Subscriptions -#----------------------------------------------------- - post: - x-scope: apim:subscribe - 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/store/v0.12/subscriptions/multiple\"" - x-wso2-request: "POST https://localhost:9443/api/am/store/v0.12/subscriptions/multiple\nAuthorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\n\n{\n \"tier\": \"Gold\",\n \"apiIdentifier\": \"c43a325c-260b-4302-81cb-768eafaa3aed\",\n \"applicationId\": \"c30f3a6e-ffa4-4ae7-afce-224d1f820524\"\n}" - x-wso2-response: "HTTP/1.1 201 Created\nLocation: https://localhost:9443/api/am/store/v0.12/subscriptions/5b65808c-cdf2-43e1-a695-de63e3ad0ae9\nContent-Type: application/json\n\n{\n \"tier\": \"Gold\",\n \"subscriptionId\": \"5b65808c-cdf2-43e1-a695-de63e3ad0ae9\",\n \"apiIdentifier\": \"admin-PhoneVerification-2.0.0\",\n \"applicationId\": \"c30f3a6e-ffa4-4ae7-afce-224d1f820524\",\n \"status\": \"UNBLOCKED\"\n}" - summary: | - Add new subscriptions - description: | - This operation can be used to add a new subscriptions providing the ids of the APIs and the applications. - parameters: - - in: body - name: body - description: | - Subscription objects that should to be added - required: true - schema: - type: array - items: - $ref: '#/definitions/Subscription' - - $ref: '#/parameters/Content-Type' - tags: - - Subscription (Multitple) - responses: - 200: - description: | - OK. - Successful response with the newly created objects as entity in the body. - schema: - type: array - items: - $ref: '#/definitions/Subscription' - 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 - 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 Subscription" resource APIs -###################################################### - '/subscriptions/{subscriptionId}': - -#----------------------------------------------------- -# Retrieve a certain subscription -#----------------------------------------------------- - get: - x-scope: apim:subscribe - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" \"https://localhost:9443/api/am/store/v0.12/subscriptions/5b65808c-cdf2-43e1-a695-de63e3ad0ae9\"" - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/subscriptions/5b65808c-cdf2-43e1-a695-de63e3ad0ae9 - Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8 - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"tier\": \"Gold\",\n \"subscriptionId\": \"5b65808c-cdf2-43e1-a695-de63e3ad0ae9\",\n \"apiIdentifier\": \"admin-PhoneVerification-2.0.0\",\n \"applicationId\": \"c30f3a6e-ffa4-4ae7-afce-224d1f820524\",\n \"status\": \"UNBLOCKED\"\n}" - summary: | - Get details of a subscription - description: | - This operation can be used to get details of a single subscription. - parameters: - - $ref: '#/parameters/subscriptionId' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Subscription (Individual) - responses: - 200: - description: | - OK. - Subscription returned - schema: - $ref: '#/definitions/Subscription' - 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. - 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. - '404': - description: | - Not Found. - Requested Subscription does not exist. - schema: - $ref: '#/definitions/Error' - -#----------------------------------------------------- -# Delete a certain subscription -#----------------------------------------------------- - delete: - x-scope: apim:subscribe - x-wso2-curl: "curl -k -H \"Authorization: Bearer ae4eae22-3f65-387b-a171-d37eaa366fa8\" -X DELETE \"https://localhost:9443/api/am/store/v0.12/subscriptions/5b65808c-cdf2-43e1-a695-de63e3ad0ae9\"" - x-wso2-request: | - DELETE https://localhost:9443/api/am/store/v0.12/subscriptions/5b65808c-cdf2-43e1-a695-de63e3ad0ae9 - x-wso2-response: "HTTP/1.1 200 OK" - summary: | - Remove a subscription - description: | - This operation can be used to remove a subscription. - parameters: - - $ref: '#/parameters/subscriptionId' - - $ref: '#/parameters/If-Match' - - $ref: '#/parameters/If-Unmodified-Since' - tags: - - Subscription (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 "Tier Collection" resource APIs -###################################################### - /tiers/{tierLevel}: - -#----------------------------------------------------- -# Retrieve the list of all available tiers -#----------------------------------------------------- - get: - x-wso2-curl: "curl \"https://localhost:9443/api/am/store/v0.12/tiers/api\"" - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/tiers/api - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" https://localhost:9443/api/am/store/v0.12/tiers/api" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"stopOnQuotaReach\": true,\n \"tierLevel\": \"api\",\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 \"stopOnQuotaReach\": true,\n \"tierLevel\": \"api\",\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 \"stopOnQuotaReach\": true,\n \"tierLevel\": \"api\",\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 \"stopOnQuotaReach\": true,\n \"tierLevel\": \"api\",\n \"requestCount\": 0,\n \"description\": \"Allows unlimited requests\",\n \"name\": \"Unlimited\",\n \"attributes\": {}\n }\n ],\n \"count\": 4,\n \"next\": \"\"\n}" - summary: | - Get available tiers - description: | - This operation can be used to retrieve all the tiers available for the provided tier level. Tier level should be specified as a path parameter and should be one of `api` and `application`. - - `X-WSO2-Tenant` header can be used to retrive tiers 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. - - **NOTE**: - * API tiers are the ones that is available during subscription of an application to an API. Hence they are also called subscription tiers and are same as the subscription policies in Admin REST API. - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/tierLevel' - - $ref: '#/parameters/requestedTenant' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Throttling Tier (Collection) - responses: - 200: - description: | - OK. - List of tiers returned. - schema: - type: array - items: - $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: | - 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 Tier" resource APIs -###################################################### - '/tiers/{tierLevel}/{tierName}': - -#----------------------------------------------------- -# Retrieve a certain tier -#----------------------------------------------------- - get: - x-wso2-curl: "curl \"https://localhost:9443/api/am/store/v0.12/tiers/api/Bronze\"" - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/tiers/api/Bronze - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" https://localhost:9443/api/am/store/v0.12/tiers/api/Bronze" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"unitTime\": 60000,\n \"tierPlan\": \"FREE\",\n \"stopOnQuotaReach\": true,\n \"tierLevel\": \"api\",\n \"requestCount\": 1,\n \"description\": \"Allows 1 request(s) per minute.\",\n \"name\": \"Bronze\",\n \"attributes\": {}\n}" - summary: | - Get details of a tier - description: | - This operation can be used to retrieve details of a single tier by specifying the tier level and tier name. - - `X-WSO2-Tenant` header can be used to retrive tiers 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/tierName' - - $ref: '#/parameters/tierLevel' - - $ref: '#/parameters/requestedTenant' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - - $ref: '#/parameters/If-Modified-Since' - tags: - - Throttling Tier (Individual) - responses: - 200: - description: | - OK. - 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 (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 Tier does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. - The requested media type is not supported. - schema: - $ref: '#/definitions/Error' - -###################################################### -# The "Tag Collection" resource API -###################################################### - /tags: - -#----------------------------------------------------- -# Retrieve the list of tags qualifying under a search condition -#----------------------------------------------------- - get: - x-wso2-curl: "curl \"https://localhost:9443/api/am/store/v0.12/tags\"" - x-wso2-request: | - GET https://localhost:9443/api/am/store/v0.12/tags - x-wso2-curl-tenant: "curl -k -H \"X-WSO2-Tenant:test.com\" https://localhost:9443/api/am/store/v0.12/tags" - x-wso2-response: "HTTP/1.1 200 OK\nContent-Type: application/json\n\n{\n \"previous\": \"\",\n \"list\": [\n {\n \"weight\": 1,\n \"name\": \"mobile\"\n },\n {\n \"weight\": 1,\n \"name\": \"multimedia\"\n },\n {\n \"weight\": 1,\n \"name\": \"phone\"\n }\n ],\n \"count\": 3,\n \"next\": \"\"\n}" - summary: | - Get all tags - description: | - This operation can be used to retrieve a list of tags that are already added to APIs. - - `X-WSO2-Tenant` header can be used to retrive tags 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. - - **NOTE:** - * This operation does not require an Authorization header by default. But in order to see a restricted API's tags, you need to provide Authorization header. - parameters: - - $ref: '#/parameters/limit' - - $ref: '#/parameters/offset' - - $ref: '#/parameters/requestedTenant' - - $ref: '#/parameters/Accept' - - $ref: '#/parameters/If-None-Match' - tags: - - Tag (Collection) - responses: - 200: - description: | - OK. - Tag list is returned. - schema: - $ref: '#/definitions/TagList' - 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). - 404: - description: | - Not Found. Requested API does not exist. - schema: - $ref: '#/definitions/Error' - 406: - description: | - Not Acceptable. The requested media type is not supported - schema: - $ref: '#/definitions/Error' - -###################################################### -# Parameters - required by some of the APIs above -###################################################### -parameters: - -# Requested Tenant domain -# Specified as a header parameter - 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. - required: false - type: string - -# 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 - -# API Identifier -# Specified as part of the path expression - language: - name: language - in: query - description: | - Programming language to generate SDK. - required: true - type: string - - -# 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 - -# Filter By user roles -# Specified as part of the query string - filterByUserRoles: - name: filterByUserRoles - in: query - description : | - Filter user by roles. - required : false - type: boolean - -# Application Identifier -# Specified as part of the query string - applicationId-Q: - name: applicationId - in: query - description: | - Application Identifier consisting of the UUID of the Application. - required: true - type: string - -# Group Identifier of the application - groupId: - name: groupId - in: query - description: | - Application Group Id - required: false - type: string - -# Subscription Identifier -# Specified as part of the path expression - subscriptionId: - name: subscriptionId - in: path - 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 Type -# Specified as part of the path expression - tierLevel: - name: tierLevel - in: path - description: | - List API or Application type tiers. - type: string - enum: - - api - - application - 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 - -# Application Key Type -# Specified as part of the path expression - keyType: - name: keyType - in: path - description: | - **Application Key Type** standing for the type of the keys (i.e. Production or Sandbox). - required: true - type: string - enum: - - PRODUCTION - - SANDBOX - -# 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 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. - 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. - 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 - -###################################################### -# 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: - 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: PUBLISHED - thumbnailUri: - type: string - example: /apis/01234567-0123-0123-0123-012345678901/thumbnail - scopes: - type: array - items: - $ref: '#/definitions/ScopeInfo' -#----------------------------------------------------- -# The API resource -#----------------------------------------------------- - API: - title: API object - required: - - name - - context - - version - - provider - - status - - apiDefinition - 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 thecontext 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: PUBLISHED - isDefaultVersion: - type: boolean - example: false - transport: - type: array - items: - description: | - Supported transports for the API (http and/or https). - type: string - example: ["http","https"] - tags: - type: array - description: Search keywords related to the API - items: - type: string - example: ["substract","add"] - tiers: - type: array - description: The subscription tiers selected for the particular API - items: - type: string - example: ["Unlimited"] - thumbnailUrl: - type: string - example: "" - additionalProperties: - description: | - Custom(user defined) properties of API - type: object - additionalProperties: - type: string - example: {} - endpointURLs: - type: array - items: - properties: - environmentName: - type: string - example: Production and Sandbox - environmentType: - type: string - example: hybrid - environmentURLs: - properties: - http: - type: string - description: HTTP environment URL - example: "http://localhost:8280/phoneverify/1.0.0" - https: - type: string - description: HTTPS environment URL - example: "https://localhost:8243/phoneverify/1.0.0" - businessInformation: - properties: - businessOwner: - type: string - example: businessowner - businessOwnerEmail: - type: string - example: businessowner@wso2.com - technicalOwner: - type: string - example: technicalowner - technicalOwnerEmail: - type: string - example: technicalowner@wso2.com - -#----------------------------------------------------- -# The Application List resource -#----------------------------------------------------- - ApplicationList: - title: Application List - properties: - count: - type: integer - description: | - Number of applications 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: "/applications?limit=1&offset=2&groupId=" - previous: - type: string - description: | - Link to the previous subset of resources qualified. - Empty if current subset is the first subset returned. - example: "/applications?limit=1&offset=0&groupId=" - list: - type: array - items: - $ref: '#/definitions/ApplicationInfo' - -#----------------------------------------------------- -# 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: - description: | - If subscriber is not given user invoking the API will be taken as the subscriber. - type: string - example: admin - throttlingTier: - type: string - example: Unlimited - callbackUrl: - type: string - example: "" - description: - type: string - example: Sample calculator application - status: - type: string - example: APPROVED - default: "" - groupId: - type: string - example: "" - keys: - type: array - items: - $ref: '#/definitions/ApplicationKey' - example: [] - -#----------------------------------------------------- -# The Application Info resource -#----------------------------------------------------- - ApplicationInfo: - title: Application info object with basic application details - 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 - status: - type: string - example: APPROVED - groupId: - type: string - example: "" - -#----------------------------------------------------- -# The Document List resource -#----------------------------------------------------- - DocumentList: - title: Document List - properties: - count: - 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: - 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 - properties: - documentId: - type: string - example: 01234567-0123-0123-0123-012345678901 - name: - type: string - example: CalculatorDoc - type: - type: string - enum: - - HOWTO - - SAMPLES - - PUBLIC_FORUM - - SUPPORT_FORUM - - API_MESSAGE_FORMAT - - SWAGGER_DOC - - OTHER - example: HOWTO - summary: - type: string - example: "Summary of Calculator Documentation" - sourceType: - type: string - enum: - - INLINE - - URL - - FILE - example: INLINE - sourceUrl: - type: string - example: "" - otherTypeName: - type: string - example: "" - -#----------------------------------------------------- -# The Tier List resource -#----------------------------------------------------- - TierList: - title: Tier List - properties: - count: - type: integer - description: | - Number of Tiers 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: "/tiers/api?limit=1&offset=2" - previous: - 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: - type: string - example: Platinum - description: - type: string - example: "Allows 50 request(s) per minute." - tierLevel: - type: string - enum: - - api - - application - 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 - tierPlan: - description: | - This attribute declares whether this tier is available under commercial or free - type: string - enum: - - FREE - - COMMERCIAL - example: FREE - stopOnQuotaReach: - description: | - If this attribute is set to false, you are capabale of sending requests - even if the request count exceeded within a unit time - type: boolean - example: true - TierPermissions: - $ref: '#/definitions/TierPermissionInfo' -#----------------------------------------------------- -# The Subscription List resource -#----------------------------------------------------- - SubscriptionList: - title: Subscription List - properties: - count: - 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 - description: The UUID of the subscription - example: faae5fcc-cbae-40c4-bf43-89931630d313 - applicationId: - type: string - description: The UUID of the application - example: b3ade481-30b0-4b38-9a67-498a40873a6d - apiIdentifier: - type: string - description: The unique identifier of the API. - example: admin-PizzaShackAPI-1.0.0 - tier: - type: string - example: Unlimited - status: - type: string - enum: - - BLOCKED - - PROD_ONLY_BLOCKED - - UNBLOCKED - - ON_HOLD - - REJECTED - example: UNBLOCKED - - -#----------------------------------------------------- -# The Tag resource -#----------------------------------------------------- - Tag: - title: Tag - required: - - name - - weight - properties: - name: - type: string - example: tag1 - weight: - type: integer - example: 5 - -#----------------------------------------------------- -# The Tag List resource -#----------------------------------------------------- - TagList: - title: Tag List - properties: - count: - type: integer - description: | - Number of Tags 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: "/tags?limit=1&offset=2" - previous: - type: string - description: | - Link to the previous subset of resources qualified. - Empty if current subset is the first subset returned. - example: "/tags?limit=1&offset=0" - list: - type: array - items: - $ref: '#/definitions/Tag' - -#----------------------------------------------------- -# The Error resource -#----------------------------------------------------- - Error: - title: Error object returned with 4XX HTTP status - required: - - code - - message - 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: '#/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 - message: - type: string - description: | - Description about Individual errors occurred - -#----------------------------------------------------- -# The Token resource -#----------------------------------------------------- - Token : - title: Token details for invoking APIs - properties: - accessToken: - type: string - description: Access token - example: 01234567890123456789012345678901 - tokenScopes: - type: array - items: - type: string - description: Valid scopes for the access token - example: ["default"] - validityTime: - type: integer - format: int64 - description: Maximum validity time for the access token - example: 3600 - -#----------------------------------------------------- -# The Application Key resource -#----------------------------------------------------- - ApplicationKey : - title: Application key details - properties: - consumerKey: - type: string - description: The consumer key associated with the application and identifying the client - example: vYDoc9s7IgAFdkSyNDaswBX7ejoa - consumerSecret: - type: string - description: The client secret that is used to authenticate the client with the authentication server - example: TIDlOFkpzB7WjufO3OJUhy1fsvAa - supportedGrantTypes: - type: array - items: - type: string - description: The grant types that are supported by the application - example: ["client_credentials","password"] - callbackUrl: - type: string - description: Callback URL - example: "http://sample.com/callback/url" - keyState: - type: string - description: Describes the state of the key generation. - example: APPROVED - keyType: - description: Describes to which endpoint the key belongs - type: string - enum: - - PRODUCTION - - SANDBOX - example: PRODUCTION - groupId: - type: string - description: Application group id (if any). - example: 02 - token: - $ref: '#/definitions/Token' - -#----------------------------------------------------- -# The Application Key Generation Request schema -#----------------------------------------------------- - ApplicationKeyGenerateRequest : - title: Application key generation request object - required: - - keyType - - validityTime - - accessAllowDomains - properties: - keyType: - type: string - enum: - - PRODUCTION - - SANDBOX - example: PRODUCTION - validityTime: - type: string - example: 3600 - supportedGrantTypes: - type: array - items: - type: string - description: The grant types that are supported by the application - example: ["client_credentials","password"] - callbackUrl: - type: string - description: Callback URL - example: "" - accessAllowDomains: - type: array - items: - type: string - description: Allowed domains for the access token - example: ["ALL"] - scopes: - type: array - items: - type: string - description: Allowed scopes for the access token - example: ["am_application_scope","default"] - -#----------------------------------------------------- -# Scope Info resource -#----------------------------------------------------- - ScopeInfo: - title: API Scope info object with scope details - properties: - key: - type: string - example: admin_scope - name: - type: string - example: admin scope - roles: - type: array - items: - type: string - description: Allowed roles for the scope - example: ["manager","developer"] - -#----------------------------------------------------- -# Tier Permission Info resource -#----------------------------------------------------- - TierPermissionInfo: - title: Tier Permission info object with tier permission details - properties: - type: - type: string - enum: - - allow - - deny - roles: - type: array - items: - type: string - description: roles for this permission - example: ["manager","developer"] - - ApplicationScope : - title: Scope of the APIs - properties: - key: - type: string - description: Key of scope - example: apim:fileread - name: - type: string - description: Name of the scope - example: apim file read - roles : - type: string - description: Roles scope is bounded to - example : admin, role1 - description: - type: string - description: Description of the scope - - ScopeList : - title : Scope list - properties: - list : - type : array - items: - $ref: '#/definitions/ApplicationScope' - - -#----------------------------------------------------- -# END-OF-FILE -#----------------------------------------------------- \ No newline at end of file diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.organization.api/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.organization.api/pom.xml index 4cdf1c9f1f..83db52b885 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.organization.api/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.organization.api/pom.xml @@ -144,9 +144,8 @@ provided - org.apache.cxf + org.apache.cxf.wso2 cxf-bundle - 3.0.0-milestone2 test @@ -234,6 +233,10 @@ org.wso2.orbit.com.fasterxml.jackson.core jackson-core + + com.fasterxml.jackson.core + jackson-databind + @@ -267,6 +270,7 @@ org.wso2.orbit.com.fasterxml.jackson.core jackson-annotations + provided org.hibernate diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.organization/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.organization/pom.xml index f05dd89d70..df9fbe8578 100644 --- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.organization/pom.xml +++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.organization/pom.xml @@ -243,7 +243,6 @@ com.google.guava guava - ${guava.version} provided diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml index d95fa8e1df..047c073084 100644 --- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml +++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/pom.xml @@ -82,8 +82,8 @@ io.entgra.device.mgt.core.device.mgt.core.internal com.fasterxml.jackson.databind;version="[2.14,3)", - com.google.common.collect;version="[31.0,32)", - com.google.common.reflect;version="[31.0,32)", + com.google.common.collect;version="[32.1,33)";resolution:=optional, + com.google.common.reflect;version="[32.1,33)";resolution:=optional, com.google.gson;version="[2.9,3)", com.google.gson.reflect;version="[2.9,3)", io.entgra.device.mgt.core.apimgt.annotations;version="[5.0,6)", @@ -501,6 +501,7 @@ com.google.guava guava + provided com.squareup.okhttp3 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 deleted file mode 100644 index 43d912832e..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ /dev/null @@ -1,158 +0,0 @@ - - - - - - - io.entgra.device.mgt.core - device-mgt - 5.0.0-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.device.mgt.analytics.data.publisher - bundle - WSO2 Carbon - Device Analytics - WSO2 Carbon - Device Analytics - https://entgra.io - - - - org.apache.felix - org.apache.felix.scr.ds-annotations - provided - - - org.testng - testng - - - org.wso2.tomcat - tomcat - - - org.wso2.tomcat - tomcat-servlet-api - - - org.wso2.carbon - org.wso2.carbon.core - - - org.ops4j.pax.logging - pax-logging-api - provided - - - org.wso2.carbon - org.wso2.carbon.utils - - - org.wso2.carbon.analytics-common - org.wso2.carbon.databridge.agent - - - org.wso2.carbon.analytics-common - org.wso2.carbon.databridge.commons - - - org.wso2.carbon - org.wso2.carbon.securevault - - - org.apache.sling - org.apache.sling.testing.osgi-mock - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.artifactId} - ${project.artifactId} - ${io.entgra.device.mgt.core.version} - Data Publisher - org.wso2.carbon.device.mgt.analytics.data.publisher.internal - - !org.wso2.carbon.device.mgt.analytics.data.publisher.internal, - org.wso2.carbon.device.mgt.analytics.data.publisher.*;version="${io.entgra.device.mgt.core.version}" - - - 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}", - org.wso2.carbon.utils;version="${carbon.kernel.version.range}", - org.wso2.carbon.databridge.*;version="${carbon.analytics.common.version.range}", - org.json;version="${commons-json.version}", - javax.xml.*, - javax.xml.parsers;version="${javax.xml.parsers.import.pkg.version}";resolution:=optional, - org.w3c.dom, - org.wso2.carbon.base, - org.wso2.carbon.utils.multitenancy - - - - - - 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 - - - - - - org.apache.maven.plugins - maven-surefire-plugin - - - src/test/resources/testng.xml - - - - - - - diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherUtil.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherUtil.java deleted file mode 100644 index 1d65b3092e..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherUtil.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2016, 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.analytics.data.publisher; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Document; -import org.wso2.carbon.databridge.agent.exception.DataEndpointConfigurationException; -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; - -import javax.xml.XMLConstants; -import javax.xml.parsers.DocumentBuilder; -import javax.xml.parsers.DocumentBuilderFactory; -import java.io.File; -import java.util.ArrayList; -import java.util.regex.Matcher; -import java.util.regex.Pattern; - -public class DataPublisherUtil { - - private static final Log log = LogFactory.getLog(DataPublisherUtil.class); - - private DataPublisherUtil(){ - } - - public static Document convertToDocument(File file) throws DataPublisherConfigurationException { - DocumentBuilderFactory factory = DocumentBuilderFactory.newInstance(); - factory.setNamespaceAware(true); - try { - factory.setFeature(XMLConstants.FEATURE_SECURE_PROCESSING, true); - factory.setFeature("http://apache.org/xml/features/disallow-doctype-decl", true); - DocumentBuilder docBuilder = factory.newDocumentBuilder(); - return docBuilder.parse(file); - } catch (Exception e) { - throw new DataPublisherConfigurationException("Error occurred while parsing file, while converting " + - "to a org.w3c.dom.Document", e); - } - } - - public static ArrayList getEndpointGroups(String urlSet) { - ArrayList urlGroups = new ArrayList<>(); - Pattern regex = Pattern.compile("\\{.*?\\}"); - Matcher regexMatcher = regex.matcher(urlSet); - - while(regexMatcher.find()) { - urlGroups.add(regexMatcher.group().replace("{", "").replace("}", "")); - } - - if (urlGroups.size() == 0) { - urlGroups.add(urlSet.replace("{", "").replace("}", "")); - } - return urlGroups; - } - - public static String[] getEndpoints(String aURLGroup) throws DataEndpointConfigurationException { - boolean isLBURL = false; - boolean isFailOverURL = false; - if (aURLGroup.contains(",")) { - isLBURL = true; - } - - if (aURLGroup.contains("|")) { - isFailOverURL = true; - } - - if (isLBURL && isFailOverURL) { - String msg = "Invalid data endpoints URL set provided : " + aURLGroup + - ", a URL group can be configured as failover OR load balancing endpoints."; - log.error(msg); - throw new DataEndpointConfigurationException(msg); - } else { - String[] urls; - if (isLBURL) { - urls = aURLGroup.split(","); - } else if (isFailOverURL) { - urls = aURLGroup.split("\\|"); - } else { - urls = new String[]{aURLGroup}; - } - return urls; - } - } - - public static int obtainHashId(String deviceId, int urlGroupsCount) { - byte[] chars = deviceId.getBytes(); - int sum = 0; - for (byte b : chars) { - sum += b; - } - return sum % urlGroupsCount; - } - - @SuppressWarnings("Duplicates") - public static String replaceProperty(String urlWithPlaceholders) { - String regex = "\\$\\{(.*?)\\}"; - Pattern pattern = Pattern.compile(regex); - Matcher matchPattern = pattern.matcher(urlWithPlaceholders); - while (matchPattern.find()) { - String sysPropertyName = matchPattern.group(1); - String sysPropertyValue = System.getProperty(sysPropertyName); - if (sysPropertyValue != null && !sysPropertyName.isEmpty()) { - urlWithPlaceholders = urlWithPlaceholders.replaceAll("\\$\\{(" + sysPropertyName + ")\\}", sysPropertyValue); - } - } - return urlWithPlaceholders; - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DeviceDataPublisher.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DeviceDataPublisher.java deleted file mode 100644 index 18d5be4287..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DeviceDataPublisher.java +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2016, 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.analytics.data.publisher; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.databridge.agent.DataPublisher; -import org.wso2.carbon.databridge.agent.exception.DataEndpointAgentConfigurationException; -import org.wso2.carbon.databridge.agent.exception.DataEndpointAuthenticationException; -import org.wso2.carbon.databridge.agent.exception.DataEndpointConfigurationException; -import org.wso2.carbon.databridge.agent.exception.DataEndpointException; -import org.wso2.carbon.databridge.commons.exception.TransportException; -import org.wso2.carbon.device.mgt.analytics.data.publisher.config.AnalyticsConfiguration; -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; -import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherServiceImpl; - -import java.util.HashMap; -import java.util.Map; - -/** - * This is used to manage data publisher per tenant. - */ -public class DeviceDataPublisher { - - private static Log log = LogFactory.getLog(EventsPublisherServiceImpl.class); - - private Map dataPublishers; - private static DeviceDataPublisher deviceDataPublisher; - - private DeviceDataPublisher() { - dataPublishers = new HashMap<>(); - } - - public static DeviceDataPublisher getInstance() { - if (deviceDataPublisher == null) { - synchronized (DeviceDataPublisher.class) { - if (deviceDataPublisher == null) { - deviceDataPublisher = new DeviceDataPublisher(); - } - } - } - return deviceDataPublisher; - } - - /** - * This returns the data publisher for the tenant based on the analytics node id. - * - * @param analyticsConfig Analytics configurations - * @param receiverURLSet Data receiver URL set as string - * @return instance of data publisher - * @throws DataPublisherConfigurationException on exception - */ - public DataPublisher getDataPublisher(AnalyticsConfiguration analyticsConfig, String receiverURLSet) - throws DataPublisherConfigurationException { - synchronized (this) { - if (this.dataPublishers.containsKey(receiverURLSet)) { - return this.dataPublishers.get(receiverURLSet); - } else { - String analyticsServerUrlGroups = analyticsConfig.getReceiverServerUrl(); - String analyticsServerUsername = analyticsConfig.getAdminUsername(); - String analyticsServerPassword = analyticsConfig.getAdminPassword(); - - try { - DataPublisher dataPublisher = new DataPublisher(receiverURLSet, analyticsServerUsername, - analyticsServerPassword); - this.dataPublishers.put(receiverURLSet, dataPublisher); - return dataPublisher; - } catch (DataEndpointAgentConfigurationException e) { - String msg = "Configuration Exception on data publisher for " + - "ReceiverGroup = " + analyticsServerUrlGroups + " for username " + analyticsServerUsername; - log.error(msg, e); - throw new DataPublisherConfigurationException(msg, e); - } catch (DataEndpointException e) { - String msg = "Invalid ReceiverGroup = " + analyticsServerUrlGroups; - log.error(msg, e); - throw new DataPublisherConfigurationException(msg, e); - } catch (DataEndpointConfigurationException e) { - String msg = "Invalid Data endpoint configuration."; - log.error(msg, e); - throw new DataPublisherConfigurationException(msg, e); - } catch (DataEndpointAuthenticationException e) { - String msg = "Authentication Failed for user " + analyticsServerUsername; - log.error(msg, e); - throw new DataPublisherConfigurationException(msg, e); - } catch (TransportException e) { - String msg = "Error occurred while retrieving data publisher"; - log.error(msg, e); - throw new DataPublisherConfigurationException(msg, e); - } - } - } - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/config/AnalyticsConfiguration.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/config/AnalyticsConfiguration.java deleted file mode 100644 index 67a8c36333..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/config/AnalyticsConfiguration.java +++ /dev/null @@ -1,135 +0,0 @@ -/* - * Copyright (c) 2016, 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.analytics.data.publisher.config; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.w3c.dom.Document; -import org.wso2.carbon.device.mgt.analytics.data.publisher.DataPublisherUtil; -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; -import org.wso2.carbon.utils.CarbonUtils; - -import javax.xml.bind.JAXBContext; -import javax.xml.bind.JAXBException; -import javax.xml.bind.Unmarshaller; -import javax.xml.bind.annotation.XmlElement; -import javax.xml.bind.annotation.XmlRootElement; -import java.io.File; - -/** - * Configurations related to DAS data publisher and DAL. - */ -@XmlRootElement(name = "AnalyticsConfiguration") -public class AnalyticsConfiguration { - - private String receiverServerUrl; - private String analyticsPublisherUrl; - private String adminUsername; - private String adminPassword; - private boolean enable; - - private static AnalyticsConfiguration config; - - private static final Log log = LogFactory.getLog(AnalyticsConfiguration.class); - private static final String DEVICE_ANALYTICS_CONFIG_PATH = - CarbonUtils.getEtcCarbonConfigDirPath() + File.separator + "device-analytics-config.xml"; - - private AnalyticsConfiguration() { - } - - public static AnalyticsConfiguration getInstance() { - if (config == null) { - throw new InvalidConfigurationStateException("Device analytics configuration is not " + - "initialized properly"); - } - return config; - } - - - @XmlElement(name = "AdminUsername", required = true) - public String getAdminUsername() { - return adminUsername; - } - - public void setAdminUsername(String adminUsername) { - this.adminUsername = adminUsername; - } - - @XmlElement(name = "AdminPassword", required = true) - public String getAdminPassword() { - return adminPassword; - } - - public void setAdminPassword(String adminPassword) { - this.adminPassword = adminPassword; - } - - @XmlElement(name = "ReceiverServerUrl", required = true) - public String getReceiverServerUrl() { - return DataPublisherUtil.replaceProperty(receiverServerUrl); - } - - public void setReceiverServerUrl(String receiverServerUrl) { - this.receiverServerUrl = receiverServerUrl; - } - - @XmlElement(name = "AnalyticsPublisherUrl", required = true) - public String getAnalyticsPublisherUrl() { - return DataPublisherUtil.replaceProperty(analyticsPublisherUrl); - } - - public void setAnalyticsPublisherUrl(String analyticsPublisherUrl) { - this.analyticsPublisherUrl = analyticsPublisherUrl; - } - - @XmlElement(name = "Enabled", required = true) - public boolean isEnable() { - return enable; - } - - public void setEnable(boolean status) { - this.enable = status; - } - - public static void init() throws DataPublisherConfigurationException { - init(AnalyticsConfiguration.DEVICE_ANALYTICS_CONFIG_PATH); - } - - public static void init(String analyticsConfigPath) throws DataPublisherConfigurationException { - File authConfig = new File(analyticsConfigPath); - if (!authConfig.exists()) { - log.warn(DEVICE_ANALYTICS_CONFIG_PATH + " does not exist. Disabling AnalyticsConfiguration."); - config = new AnalyticsConfiguration(); - config.setEnable(false); - return; - } - try { - Document doc = DataPublisherUtil.convertToDocument(authConfig); - - /* Un-marshaling device analytics configuration */ - JAXBContext ctx = JAXBContext.newInstance(AnalyticsConfiguration.class); - Unmarshaller unmarshaller = ctx.createUnmarshaller(); - config = (AnalyticsConfiguration) unmarshaller.unmarshal(doc); - } catch (JAXBException e) { - throw new DataPublisherConfigurationException("Error occurred while un-marshalling device analytics " + - "Config", e); - } - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/config/InvalidConfigurationStateException.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/config/InvalidConfigurationStateException.java deleted file mode 100644 index b9686bac42..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/config/InvalidConfigurationStateException.java +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2016, 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.analytics.data.publisher.config; - -public class InvalidConfigurationStateException extends RuntimeException { - - private static final long serialVersionUID = -3151274311329070297L; - - public InvalidConfigurationStateException(String message) { - super(message); - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/exception/DataPublisherConfigurationException.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/exception/DataPublisherConfigurationException.java deleted file mode 100644 index ea93c62a31..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/exception/DataPublisherConfigurationException.java +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2016, 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.analytics.data.publisher.exception; - -public class DataPublisherConfigurationException extends Exception { - - public DataPublisherConfigurationException(String message) { - super(message); - } - - public DataPublisherConfigurationException(String message, Throwable cause) { - super(message, cause); - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/internal/DataPublisherServiceComponent.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/internal/DataPublisherServiceComponent.java deleted file mode 100644 index 7472d3800b..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/internal/DataPublisherServiceComponent.java +++ /dev/null @@ -1,67 +0,0 @@ -/* - * Copyright (c) 2016, 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.analytics.data.publisher.internal; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceRegistration; -import org.osgi.service.component.ComponentContext; -import org.osgi.service.component.annotations.*; -import org.wso2.carbon.device.mgt.analytics.data.publisher.config.AnalyticsConfiguration; -import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherService; -import org.wso2.carbon.device.mgt.analytics.data.publisher.service.EventsPublisherServiceImpl; - -@Component( - name = "org.wso2.carbon.device.mgt.analytics.data.publisher.internal.DataPublisherServiceComponent", - immediate = true) -public class DataPublisherServiceComponent { - - private ServiceRegistration analyticsServiceRef; - private static Log log = LogFactory.getLog(DataPublisherServiceComponent.class); - - protected void activate(ComponentContext componentCtx) { - try { - if (log.isDebugEnabled()) { - log.debug("Initializing device analytics bundle"); - } - AnalyticsConfiguration.init(); - BundleContext bundleCtx = componentCtx.getBundleContext(); - this.analyticsServiceRef = - bundleCtx.registerService(EventsPublisherService.class, new EventsPublisherServiceImpl(), null); - if (log.isDebugEnabled()) { - log.debug("Device management analytics bundle has been successfully initialized"); - } - } catch (Throwable e) { - log.error("Error occurred while initializing device analytics bundle", e); - } - } - - protected void deactivate(ComponentContext componentCtx) { - if (log.isDebugEnabled()) { - log.debug("Deactivating device analytics bundle"); - } - if (analyticsServiceRef != null) { - analyticsServiceRef.unregister(); - } - if (log.isDebugEnabled()) { - log.debug("Device analytics bundle has been successfully deactivated"); - } - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/service/EventsPublisherService.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/service/EventsPublisherService.java deleted file mode 100644 index f75496d0e2..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/service/EventsPublisherService.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2016, 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.analytics.data.publisher.service; - -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; - -/** - * This service can be used to publish and retrieve data from the Analytics Server. - */ -public interface EventsPublisherService { - - /** - * This is used to publish an event to DAS. - * @param streamName is the name of the stream that the data needs to pushed - * @param version is the version of the stream - * @param metaDataArray - meta data that needs to pushed - * @param correlationDataArray - correlation data that needs to be pushed - * @param payloadDataArray - payload data that needs to be pushed - * @return if success returns true - * @throws DataPublisherConfigurationException on exception - */ - boolean publishEvent(String streamName, String version, Object[] metaDataArray, Object[] correlationDataArray, - Object[] payloadDataArray) throws DataPublisherConfigurationException; - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/service/EventsPublisherServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/service/EventsPublisherServiceImpl.java deleted file mode 100644 index 6b7b81aa36..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/main/java/org/wso2/carbon/device/mgt/analytics/data/publisher/service/EventsPublisherServiceImpl.java +++ /dev/null @@ -1,100 +0,0 @@ -/* - * Copyright (c) 2016, 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.analytics.data.publisher.service; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.databridge.agent.DataPublisher; -import org.wso2.carbon.databridge.commons.utils.DataBridgeCommonsUtils; -import org.wso2.carbon.device.mgt.analytics.data.publisher.DataPublisherUtil; -import org.wso2.carbon.device.mgt.analytics.data.publisher.DeviceDataPublisher; -import org.wso2.carbon.device.mgt.analytics.data.publisher.config.AnalyticsConfiguration; -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; -import org.wso2.carbon.utils.multitenancy.MultitenantConstants; - -import java.util.ArrayList; - -/** - * This is the implementation of Osgi Service which can be used to publish and retireved - * event/records. - */ -public class EventsPublisherServiceImpl implements EventsPublisherService { - - private static Log log = LogFactory.getLog(EventsPublisherServiceImpl.class); - - /** - * @param streamName is the name of the stream that the data needs to pushed - * @param version is the version of the stream - * @param metaDataArray meta data that needs to pushed - * @param correlationDataArray correlation data that needs to be pushed - * @param payloadDataArray payload data that needs to be pushed - * @return if success returns true - * @throws DataPublisherConfigurationException on exception - */ - @Override - public boolean publishEvent(String streamName, String version, Object[] metaDataArray, - Object[] correlationDataArray, - Object[] payloadDataArray) throws DataPublisherConfigurationException { - AnalyticsConfiguration analyticsConfig = AnalyticsConfiguration.getInstance(); - if (!analyticsConfig.isEnable()) { - log.warn("Analytics data publishing not enabled."); - return false; - } - - if (metaDataArray == null || metaDataArray.length == 0) { - String msg = "meta data[0] must have the device Id field"; - log.error(msg); - throw new DataPublisherConfigurationException(msg); - } - - ArrayList receiverURLGroups = DataPublisherUtil.getEndpointGroups(analyticsConfig.getReceiverServerUrl()); - int hashId = DataPublisherUtil.obtainHashId(metaDataArray[0].toString(), receiverURLGroups.size()); - if (receiverURLGroups.size() <= hashId) { - String msg = "Invalid receiver url group size. Expected to be higher than: " + hashId + " Actual: " + - receiverURLGroups.size(); - log.error(msg); - throw new DataPublisherConfigurationException(msg); - } - - String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain(); - if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) { - metaDataArray[0] = tenantDomain + "@" + metaDataArray[0]; - } - - PrivilegedCarbonContext.startTenantFlow(); - PrivilegedCarbonContext.getThreadLocalCarbonContext() - .setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true); - try { - DataPublisher dataPublisher = DeviceDataPublisher.getInstance() - .getDataPublisher(analyticsConfig, receiverURLGroups.get(hashId)); - if (dataPublisher != null) { - String streamId = DataBridgeCommonsUtils.generateStreamId(streamName, version); - return dataPublisher.tryPublish(streamId, System.currentTimeMillis(), metaDataArray, - correlationDataArray, - payloadDataArray); - } else { - return false; - } - } finally { - PrivilegedCarbonContext.endTenantFlow(); - } - } -} \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/BaseAnalyticsDataPublisherTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/BaseAnalyticsDataPublisherTest.java deleted file mode 100644 index 3d42a3020b..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/BaseAnalyticsDataPublisherTest.java +++ /dev/null @@ -1,57 +0,0 @@ -/* -* Copyright (c) 2017, 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.analytics.data.publisher; - -import org.testng.annotations.BeforeSuite; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.context.PrivilegedCarbonContext; - -import java.io.File; - -public class BaseAnalyticsDataPublisherTest { - - @BeforeSuite - public void init() { - setUpCarbonHome(); - } - - private void setUpCarbonHome() { - if (System.getProperty("carbon.home") == null) { - File file = new File("src/test/resources/carbon-home"); - if (file.exists()) { - System.setProperty("carbon.home", file.getAbsolutePath()); - } - file = new File("carbon-home"); - if (file.exists()) { - System.setProperty("carbon.home", file.getAbsolutePath()); - } - file = new File("../../resources/carbon-home"); - if (file.exists()) { - System.setProperty("carbon.home", file.getAbsolutePath()); - } - file = new File("../../../resources/carbon-home"); - if (file.exists()) { - System.setProperty("carbon.home", file.getAbsolutePath()); - } - } - PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants - .SUPER_TENANT_DOMAIN_NAME); - PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(MultitenantConstants.SUPER_TENANT_ID); - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherConfigTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherConfigTest.java deleted file mode 100644 index 0e04de8a56..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherConfigTest.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2017, 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.analytics.data.publisher; - -import junit.framework.Assert; -import org.testng.annotations.Test; -import org.wso2.carbon.device.mgt.analytics.data.publisher.config.AnalyticsConfiguration; -import org.wso2.carbon.device.mgt.analytics.data.publisher.config.InvalidConfigurationStateException; -import org.wso2.carbon.device.mgt.analytics.data.publisher.exception.DataPublisherConfigurationException; - -import java.io.File; -import java.lang.reflect.Field; -import java.net.URL; - -/** - * This test class will validate the Data publisher configuration creation. - */ -public class DataPublisherConfigTest extends BaseAnalyticsDataPublisherTest { - - @Test(description = "Validating the behaviour of getInstance config before calling the init", - expectedExceptions = InvalidConfigurationStateException.class) - public void testGetInstanceWithoutInit() throws NoSuchFieldException, IllegalAccessException { - Field configField = AnalyticsConfiguration.class.getDeclaredField("config"); - configField.setAccessible(true); - configField.set(configField, null); - AnalyticsConfiguration.getInstance(); - } - - @Test(description = "Analytics configuration initialization with invalid config", - expectedExceptions = DataPublisherConfigurationException.class, - dependsOnMethods = "testGetInstanceWithoutInit") - public void testInitWithInvalidConfig() throws DataPublisherConfigurationException { - ClassLoader classLoader = this.getClass().getClassLoader(); - URL invalidConfig = classLoader.getResource("carbon-home/repository/conf/etc/" + - "device-analytics-config-invalid.xml"); - Assert.assertTrue("No configuration - device-analytics-config-invalid.xml found in resource dir", - invalidConfig != null); - File file = new File(invalidConfig.getFile()); - AnalyticsConfiguration.init(file.getAbsolutePath()); - } - - - @Test(description = "Analytics config initialization with invalid xml", - expectedExceptions = DataPublisherConfigurationException.class, - dependsOnMethods = "testInitWithInvalidConfig") - public void testInitWithInvalidXML() throws DataPublisherConfigurationException { - ClassLoader classLoader = this.getClass().getClassLoader(); - URL invalidConfig = classLoader.getResource("carbon-home/repository/conf/etc/" + - "device-analytics-config-invalid-xml.xml"); - Assert.assertTrue("No configuration - device-analytics-config-invalid-xml.xml found in resource dir", - invalidConfig != null); - File file = new File(invalidConfig.getFile()); - AnalyticsConfiguration.init(file.getAbsolutePath()); - } - - - @Test(description = "Validating the init method with all required params", - dependsOnMethods = "testInitWithInvalidXML") - public void testInitWithValidConfig() throws DataPublisherConfigurationException { - AnalyticsConfiguration.init(); - AnalyticsConfiguration analyticsConfiguration = AnalyticsConfiguration.getInstance(); - Assert.assertEquals(analyticsConfiguration.getAdminPassword(), "testuserpwd"); - Assert.assertEquals(analyticsConfiguration.getAdminUsername(), "testuser"); - Assert.assertEquals(analyticsConfiguration.getReceiverServerUrl(), "tcp://localhost:7615"); - Assert.assertTrue(analyticsConfiguration.isEnable()); - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherServiceComponentTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherServiceComponentTest.java deleted file mode 100644 index d5ffb75d48..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/DataPublisherServiceComponentTest.java +++ /dev/null @@ -1,67 +0,0 @@ -/* -* Copyright (c) 2017, 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.analytics.data.publisher; - - -import org.apache.sling.testing.mock.osgi.MockOsgi; -import org.osgi.service.component.ComponentContext; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.device.mgt.analytics.data.publisher.internal.DataPublisherServiceComponent; -import org.wso2.carbon.device.mgt.analytics.data.publisher.util.TestComponentContext; - -import java.lang.reflect.InvocationTargetException; -import java.lang.reflect.Method; - -/** - * This tesclass will be validating the behaviour of {@link DataPublisherServiceComponent} - */ -public class DataPublisherServiceComponentTest extends BaseAnalyticsDataPublisherTest { - private DataPublisherServiceComponent serviceComponent; - - @BeforeClass - public void initTest() { - this.serviceComponent = new DataPublisherServiceComponent(); - } - - @Test (description = "Test bundle activation with exception thrown when service resgistration") - public void activateWithException() throws NoSuchMethodException, IllegalAccessException, - InvocationTargetException { - this.activate(new TestComponentContext()); - } - - @Test(dependsOnMethods = "activateWithException", description = "Test the bundle activation with succesful path") - public void activateWithoutException() throws NoSuchMethodException, InvocationTargetException, - IllegalAccessException { - this.activate(MockOsgi.newComponentContext()); - } - - @Test(dependsOnMethods = "activateWithoutException", description = "Test bundle deactivation") - public void deActivate() throws NoSuchMethodException, InvocationTargetException, IllegalAccessException { - Method method = this.serviceComponent.getClass().getDeclaredMethod("deactivate", ComponentContext.class); - method.setAccessible(true); - method.invoke(this.serviceComponent, MockOsgi.newComponentContext()); - } - - private void activate(ComponentContext componentContext) throws NoSuchMethodException, InvocationTargetException, - IllegalAccessException { - Method method = this.serviceComponent.getClass().getDeclaredMethod("activate", ComponentContext.class); - method.setAccessible(true); - method.invoke(this.serviceComponent, componentContext); - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/EventPublisherServiceTest.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/EventPublisherServiceTest.java deleted file mode 100644 index a7e5e8083d..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/EventPublisherServiceTest.java +++ /dev/null @@ -1,144 +0,0 @@ -/* -* Copyright (c) 2017, 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.analytics.data.publisher; - -import org.testng.Assert; -import org.testng.annotations.BeforeClass; -import org.testng.annotations.Test; -import org.wso2.carbon.context.PrivilegedCarbonContext; -import org.wso2.carbon.databridge.agent.AgentHolder; -import org.wso2.carbon.databridge.agent.exception.DataEndpointAgentConfigurationException; -import org.wso2.carbon.device.mgt.analytics.data.publisher.config.AnalyticsConfiguration; -import org.wso2.carbon.device.mgt.analytics.data.publisher.config.InvalidConfigurationStateException; -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 java.lang.reflect.Field; - -/** - * This test class will test the methods that are exposed from {@link EventsPublisherService} - */ -public class EventPublisherServiceTest extends BaseAnalyticsDataPublisherTest { - - private static final String STREAM_NAME = "org.wso2.test.stream"; - private static final String TENANT_DOMAIN = "test.com"; - - private EventsPublisherService eventsPublisherService; - - @BeforeClass - public void initTest() { - this.eventsPublisherService = new EventsPublisherServiceImpl(); - } - - @Test(description = "Publish the event before initializing", - expectedExceptions = InvalidConfigurationStateException.class) - public void publishBeforeInit() throws DataPublisherConfigurationException, NoSuchFieldException, - IllegalAccessException, InstantiationException { - Field configField = AnalyticsConfiguration.class.getDeclaredField("config"); - configField.setAccessible(true); - configField.set(configField, null); - this.eventsPublisherService.publishEvent(STREAM_NAME, "1.0.0", getEventProps(), getEventProps(), - getEventProps()); - } - - @Test(description = "Publish with analytics config disabled", dependsOnMethods = "publishBeforeInit") - public void publishWhenAnalyticsConfigDisabled() throws DataPublisherConfigurationException { - AnalyticsConfiguration.init(); - AnalyticsConfiguration.getInstance().setEnable(false); - boolean published = this.eventsPublisherService.publishEvent(STREAM_NAME, "1.0.0", getEventProps(), - getEventProps(), getEventProps()); - Assert.assertFalse(published); - } - - @Test(description = "Publish the event after initializing", dependsOnMethods = "publishWhenAnalyticsConfigDisabled") - public void publishAfterInit() throws DataPublisherConfigurationException { - AnalyticsConfiguration.getInstance().setEnable(true); - boolean published = this.eventsPublisherService.publishEvent(STREAM_NAME, "1.0.0", getEventProps(), - getEventProps(), getEventProps()); - Assert.assertTrue(published); - } - - @Test(description = "Publish as tenant", dependsOnMethods = "publishAfterInit") - public void publishAsTenant() throws DataPublisherConfigurationException { - publishAsTenant(getEventProps()); - } - - @Test(description = "Publish the with no meta data as tenant", dependsOnMethods = "publishAsTenant", - expectedExceptions = DataPublisherConfigurationException.class) - public void publishAsTenantWithNoMetaData() throws DataPublisherConfigurationException { - publishAsTenant(null); - } - - @Test(description = "Publish the with empty meta data as tenant", dependsOnMethods = "publishAsTenant", - expectedExceptions = DataPublisherConfigurationException.class) - public void publishAsTenantWithEmptyMetaData() throws DataPublisherConfigurationException { - publishAsTenant(new Object[0]); - } - - @Test(description = "Publishing with invalid data publisher config", - dependsOnMethods = {"publishAsTenantWithEmptyMetaData", "publishAsTenantWithNoMetaData"}, - expectedExceptions = DataPublisherConfigurationException.class) - public void publishWithDataEndpointConfigException() throws DataPublisherConfigurationException, - NoSuchFieldException, IllegalAccessException { - AnalyticsConfiguration analyticsConfiguration = AnalyticsConfiguration.getInstance(); - analyticsConfiguration.setReceiverServerUrl(""); - Field dataPublisherField = DeviceDataPublisher.class.getDeclaredField("deviceDataPublisher"); - dataPublisherField.setAccessible(true); - dataPublisherField.set(dataPublisherField, null); - publishAsTenant(getEventProps()); - } - - @Test(description = "Publishing with invalid data publisher config", - dependsOnMethods = "publishWithDataEndpointConfigException", - expectedExceptions = DataPublisherConfigurationException.class) - public void publishWithDataAgentConfigException() throws DataPublisherConfigurationException, - NoSuchFieldException, IllegalAccessException, DataEndpointAgentConfigurationException { - AnalyticsConfiguration.init(); - Field defaultAgentName = AgentHolder.getInstance().getClass().getDeclaredField("defaultDataEndpointAgentName"); - defaultAgentName.setAccessible(true); - defaultAgentName.set(AgentHolder.getInstance(), "dummyAgent"); - publishAsTenant(getEventProps()); - } - - @Test(description = "Publishing with invalid data publisher config", - dependsOnMethods = "publishWithDataAgentConfigException") - public void publishWithDataEndpointException() throws DataPublisherConfigurationException, - NoSuchFieldException, IllegalAccessException, DataEndpointAgentConfigurationException { - AnalyticsConfiguration.init(); - - } - - private void publishAsTenant(Object[] metaData) throws DataPublisherConfigurationException { - PrivilegedCarbonContext.startTenantFlow(); - PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(TENANT_DOMAIN, true); - try { - boolean published = this.eventsPublisherService.publishEvent(STREAM_NAME, "1.0.0", metaData, - getEventProps(), getEventProps()); - Assert.assertTrue(published); - } finally { - PrivilegedCarbonContext.endTenantFlow(); - } - } - - private Object[] getEventProps() { - return new Object[]{"123"}; - } - - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/util/TestComponentContext.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/util/TestComponentContext.java deleted file mode 100644 index adcb3cba2f..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/java/org/wso2/carbon/device/mgt/analytics/data/publisher/util/TestComponentContext.java +++ /dev/null @@ -1,81 +0,0 @@ -/* -* Copyright (c) 2017, 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.analytics.data.publisher.util; - -import org.osgi.framework.Bundle; -import org.osgi.framework.BundleContext; -import org.osgi.framework.ServiceReference; -import org.osgi.service.component.ComponentContext; -import org.osgi.service.component.ComponentInstance; - -import java.util.Dictionary; - -/** - * Mock implementation for component context. - */ -public class TestComponentContext implements ComponentContext { - @Override - public Dictionary getProperties() { - return null; - } - - @Override - public Object locateService(String s) { - return null; - } - - @Override - public Object locateService(String s, ServiceReference serviceReference) { - return null; - } - - @Override - public Object[] locateServices(String s) { - return new Object[0]; - } - - @Override - public BundleContext getBundleContext() { - return null; - } - - @Override - public Bundle getUsingBundle() { - return null; - } - - @Override - public ComponentInstance getComponentInstance() { - return null; - } - - @Override - public void enableComponent(String s) { - - } - - @Override - public void disableComponent(String s) { - - } - - @Override - public ServiceReference getServiceReference() { - return null; - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/carbon.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/carbon.xml deleted file mode 100644 index a5518cb720..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/carbon.xml +++ /dev/null @@ -1,658 +0,0 @@ - - - - - - - - - ${product.name} - - - ${product.key} - - - ${product.version} - - - - - - - - - local:/${carbon.context}/services/ - - - - - - - ${default.server.role} - - - - - - - org.wso2.carbon - - - / - - - - - - - - - 15 - - - - - - - - - 0 - - - - - 9999 - - 11111 - - - - - - 10389 - - 8000 - - - - - - 10500 - - - - - - - org.wso2.carbon.tomcat.jndi.CarbonJavaURLContextFactory - - - - - - - - - java - - - - - - - - - - false - - - false - - - 600 - - - - false - - - - - - - - 30 - - - - - - - - - 15 - - - - - - ${carbon.home}/repository/deployment/server/ - - - 15 - - - ${carbon.home}/repository/conf/axis2/axis2.xml - - - 30000 - - - ${carbon.home}/repository/deployment/client/ - - ${carbon.home}/repository/conf/axis2/axis2_client.xml - - true - - - - - - - - - - admin - Default Administrator Role - - - user - Default User Role - - - - - - - - - - - - ${carbon.home}/repository/resources/security/wso2carbon.jks - - JKS - - wso2carbon - - wso2carbon - - wso2carbon - - - - - - ${carbon.home}/repository/resources/security/client-truststore.jks - - JKS - - wso2carbon - - - - - - - - - - - - - - - - - - - UserManager - - - false - - - - - - - ${carbon.home}/tmp/work - - - - - - true - - - 10 - - - 30 - - - - - - 100 - - - - keystore - certificate - * - - org.wso2.carbon.ui.transports.fileupload.AnyFileUploadExecutor - - - - - jarZip - - org.wso2.carbon.ui.transports.fileupload.JarZipUploadExecutor - - - - dbs - - org.wso2.carbon.ui.transports.fileupload.DBSFileUploadExecutor - - - - tools - - org.wso2.carbon.ui.transports.fileupload.ToolsFileUploadExecutor - - - - toolsAny - - org.wso2.carbon.ui.transports.fileupload.ToolsAnyFileUploadExecutor - - - - - - - info - org.wso2.carbon.core.transports.util.InfoProcessor - - - wsdl - org.wso2.carbon.core.transports.util.Wsdl11Processor - - - wsdl2 - org.wso2.carbon.core.transports.util.Wsdl20Processor - - - xsd - org.wso2.carbon.core.transports.util.XsdProcessor - - - - - - false - false - true - svn - http://svnrepo.example.com/repos/ - username - password - true - - - - - - - - - - - - - - - ${require.carbon.servlet} - - - - - true - - - - - - - default repository - ${p2.repo.url} - - - - - - - - true - - - - - - true - - diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/data-bridge/data-agent-config-invalid.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/data-bridge/data-agent-config-invalid.xml deleted file mode 100644 index a399556257..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/data-bridge/data-agent-config-invalid.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - Thrift - org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftDataEndpointNoClass - src/test/resources/client-truststore.jks - wso2carbon - 32768 - 200 - 1 - 30000 - 1 - 20 - 30 - 250 - 250 - 5500 - 5000 - 250 - 250 - 5500 - 5000 - - - - - - Binary - org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint - src/test/resources/client-truststore.jks - wso2carbon - 32768 - 200 - 1 - 1 - 30000 - 20 - 30 - 250 - 250 - 5500 - 5000 - 250 - 250 - 5500 - 5000 - - - - - diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/data-bridge/data-agent-config.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/data-bridge/data-agent-config.xml deleted file mode 100644 index 995b44705b..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/data-bridge/data-agent-config.xml +++ /dev/null @@ -1,69 +0,0 @@ - - - - - - Thrift - org.wso2.carbon.databridge.agent.endpoint.thrift.ThriftDataEndpoint - src/test/resources/client-truststore.jks - wso2carbon - 32768 - 200 - 1 - 30000 - 1 - 20 - 30 - 250 - 250 - 5500 - 5000 - 250 - 250 - 5500 - 5000 - - - - - - Binary - org.wso2.carbon.databridge.agent.endpoint.binary.BinaryDataEndpoint - src/test/resources/client-truststore.jks - wso2carbon - 32768 - 200 - 1 - 1 - 30000 - 20 - 30 - 250 - 250 - 5500 - 5000 - 250 - 250 - 5500 - 5000 - - - - - diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config-invalid-xml.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config-invalid-xml.xml deleted file mode 100644 index c9298fdb34..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config-invalid-xml.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - tcp://localhost:7615 - testuser - testuserpwd diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config-invalid.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config-invalid.xml deleted file mode 100644 index 4a63c9cf5c..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config-invalid.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - tcp://localhost:7615 - testuser - testuserpwd - diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config.xml deleted file mode 100644 index a4caa4fa31..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/etc/device-analytics-config.xml +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - true - tcp://localhost:7615 - testuser - testuserpwd - diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/registry.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/registry.xml deleted file mode 100644 index 331c448c87..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/carbon-home/repository/conf/registry.xml +++ /dev/null @@ -1,52 +0,0 @@ - - - - - - - - wso2registry - false - true - / - - - jdbc:h2:./target/databasetest/CARBON_TEST - - org.h2.Driver - 80 - 60000 - 5 - - - false - - - - true - true - true - true - - diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/client-truststore.jks b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/client-truststore.jks deleted file mode 100644 index 3b9fdfb9e84c41196f803dca9d96daa06fe60d1a..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 102330 zcmdqJ1z1&EyEaTWNF!Z>NUlYPC>_#`bS=6&RJsJDyE~;sKvGf^1*D`Tr9?nNY53;? zbfbH}?>^^z`@Glp{azQc#+s8k#+>uH?95%-C>>|;a z#A)QB!7=Gq5FZE=36(KODrgTA78Vf^1_S}4gHVy+)ew;I;M7#W1Ry-<01XdA446?A zn2}1_))-6-B7%O6j)(2$=EnMCF|5XRHsBi|8t5T-Jkp=Bu+DJRXImXA>uAeeodsgT_+F>j9(vT~G@brFKn5)f)tsEIlrZaTMi422*CsAD8 z?rOnQ+5L+)Xg$&oz)2j|G^@b_>{>Yucz!tRd_?KV{Epd6hk4^8L|~Wlz=t&DcVQ)h zzB73AR84%+AnJTXhE-V;Q=tB=xjJ#Zr0{E9SJB;g!hy5wgf$fX>uw5g@USqjxyB$v z5Ek%K$*;k}o*^Irf)oV01|8!;$A}a3f0wkWMIxRD9Hc^(vN+jwr_N*MTm zxQWmr)0f!NVa8~VGvl+2!C~5phly{y<4tLdO>r1ON@rsonO|oJTQ!(VpN;L1{&c?M zpd(qSjtLp1k9A40y6_N9oGs_;_Bqti0Z`eQ*f}~Gp2J&C>IkCz6W)kZAV0)00OBt% z;VoNo@MhB3ZkBRSeoPxaDE+E*V*v2>4ZMPHNf9t9h!}V=2q<{Cl8z8VXNV(}oT06; zIm8M02*y5t>j=nr$SQ``rgn}dU=q-E=;>&9IHC%23StTXl&NGbY%H81CSWGeE$A_L zJetd6$|}NCP{yz@wJ-2;BGeN*X2?7ov2sl`n=oQtNK{WNMGRzwvyZXhEo;afXxlYB%T(+Tk6YgV-fb&vAUK<+NvkS$>|b6%J7! zzMNnlrdc1(RQm1WKRRgXEMQacPWFC&Y$od1i~%zmx@N^Zv>us6hF|(n|z zs;nwX$g~tnL!Nx`w!Z{V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&N>jn; z>mQuX#P&fr2_867WEW@cXO^0yrl|MEpmM|JwTga)!rCk85+yrMbryn`M~p1EXyDdG-5Y`J(PL zX%(m*Kc7h$(YHPJTh^IiN;?|sv)cHv=$ Rh!iM9rnBJ3075NF{~tu`p4$Kb diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/testng.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/testng.xml deleted file mode 100644 index fffc1f8f85..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/src/test/resources/testng.xml +++ /dev/null @@ -1,31 +0,0 @@ - - - - - - - - - - - - - - - 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 deleted file mode 100644 index c6411d46ce..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/pom.xml +++ /dev/null @@ -1,80 +0,0 @@ - - - - - device-mgt - io.entgra.device.mgt.core - 5.0.0-SNAPSHOT - - 4.0.0 - - org.wso2.carbon.device.mgt.analytics.wsproxy - war - WSO2 - Webapp for Web Socket Proxy - https://entgra.io - - - - io.entgra.device.mgt.core - org.wso2.carbon.device.mgt.analytics.data.publisher - provided - - - javax.ws.rs - javax.ws.rs-api - - - org.apache.cxf - cxf-rt-frontend-jaxrs - - - - - secured-websocket-proxy - - - 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 - - - - - - - - \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/exception/WSProxyException.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/exception/WSProxyException.java deleted file mode 100644 index 7937ada371..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/exception/WSProxyException.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2018, 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.analytics.wsproxy.exception; - -/** - * Indicates an error with deployment tinkerer - * - * @since 1.0.0 - */ -public class WSProxyException extends Exception { - - /** - * Constructs a new exception with the message provided and the cause. - * - * @param message the detailed message of the exception - * @param cause the cause of the exception - */ - public WSProxyException(String message, Throwable cause) { - super(message, cause); - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SubscriptionEndpoint.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SubscriptionEndpoint.java deleted file mode 100644 index b556949ae1..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SubscriptionEndpoint.java +++ /dev/null @@ -1,145 +0,0 @@ -/* - * Copyright (c) 2018, 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.analytics.wsproxy.inbound; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.databridge.agent.exception.DataEndpointConfigurationException; -import org.wso2.carbon.device.mgt.analytics.data.publisher.DataPublisherUtil; -import org.wso2.carbon.device.mgt.analytics.data.publisher.config.AnalyticsConfiguration; -import org.wso2.carbon.device.mgt.analytics.wsproxy.exception.WSProxyException; -import org.wso2.carbon.device.mgt.analytics.wsproxy.outbound.AnalyticsClient; - -import javax.websocket.CloseReason; -import javax.websocket.Session; -import java.net.URI; -import java.net.URISyntaxException; -import java.util.ArrayList; -import java.util.HashMap; -import java.util.List; -import java.util.Map; - -/** - * Interface for subscription and un-subscription for web socket - */ - -public class SubscriptionEndpoint { - - private static final Log log = LogFactory.getLog(SubscriptionEndpoint.class); - private Map> analyticsClientsMap = new HashMap<>(); - - /** - * Web socket onOpen - When client sends a message - * - * @param session - Users registered session. - */ - void onOpen(Session session) { - if (log.isDebugEnabled()) { - log.debug("WebSocket opened, for Session id: " + session.getId()); - } - - AnalyticsConfiguration analyticsConfig = AnalyticsConfiguration.getInstance(); - ArrayList publisherGroups = - DataPublisherUtil.getEndpointGroups(analyticsConfig.getAnalyticsPublisherUrl()); - List analyticsClients = new ArrayList<>(); - for (String publisherURLGroup : publisherGroups) { - try { - String[] endpoints = DataPublisherUtil.getEndpoints(publisherURLGroup); - for (String endpoint : endpoints) { - try { - endpoint = endpoint.trim(); - if (!endpoint.endsWith("/")) { - endpoint += "/"; - } - endpoint += session.getRequestURI().getSchemeSpecificPart().replace("secured-websocket-proxy",""); - AnalyticsClient analyticsClient = new AnalyticsClient(session, new URI(endpoint)); - analyticsClients.add(analyticsClient); - } catch (URISyntaxException e) { - log.error("Unable to create URL from: " + endpoint, e); - } catch (WSProxyException e) { - log.error("Unable to create WS client for: " + endpoint, e); - } - } - } catch (DataEndpointConfigurationException e) { - log.error("Unable to obtain endpoints from receiverURLGroup: " + publisherURLGroup, e); - } - } - if (log.isDebugEnabled()) { - log.debug("Configured " + analyticsClients.size() + " analytics clients for Session id: " + - session.getId()); - } - analyticsClientsMap.put(session.getId(), analyticsClients); - } - - /** - * Web socket onClose - Remove the registered sessions - * - * @param session - Users registered session. - * @param reason - Status code for web-socket close. - * @param streamName - StreamName extracted from the ws url. - * @param version - Version extracted from the ws url. - * @param tenantDomain - Domain of the tenant. - */ - public void onClose(Session session, CloseReason reason, String streamName, String version, String tenantDomain) { - if (log.isDebugEnabled()) { - log.debug("Closing a WebSocket due to " + reason.getReasonPhrase() + ", for session ID:" + - session.getId() + ", for request URI - " + session.getRequestURI()); - } - for (AnalyticsClient analyticsClient : analyticsClientsMap.get(session.getId())) { - if (analyticsClient != null) { - try { - analyticsClient.closeConnection(reason); - } catch (WSProxyException e) { - log.error("Error occurred while closing ws connection due to " + reason.getReasonPhrase() + - ", for session ID:" + session.getId() + ", for request URI - " + session.getRequestURI(), e); - } - } - } - analyticsClientsMap.remove(session.getId()); - } - - /** - * Web socket onMessage - When client sens a message - * - * @param session - Users registered session. - * @param message - Status code for web-socket close. - */ - void onMessage(Session session, String message) { - for (AnalyticsClient analyticsClient : analyticsClientsMap.get(session.getId())) { - if (analyticsClient != null) { - analyticsClient.sendMessage(message); - } - } - } - - /** - * Web socket onError - * - * @param session - Users registered session. - * @param throwable - Status code for web-socket close. - * @param streamName - StreamName extracted from the ws url. - * @param version - Version extracted from the ws url. - * @param tenantDomain - Domain of the tenant. - */ - public void onError(Session session, Throwable throwable, String streamName, String version, String tenantDomain) { - log.error("Error occurred in session ID: " + session.getId() + ", for request URI - " + - session.getRequestURI() + ", " + throwable.getMessage(), throwable); - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SuperTenantSubscriptionEndpoint.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SuperTenantSubscriptionEndpoint.java deleted file mode 100644 index 0e4bc3684d..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/SuperTenantSubscriptionEndpoint.java +++ /dev/null @@ -1,104 +0,0 @@ -/* - * Copyright (c) 2018, 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.analytics.wsproxy.inbound; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.MultitenantConstants; - -import javax.websocket.CloseReason; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; - -/** - * Connect to web socket with Super tenant - */ - -@ServerEndpoint(value = "/{destination}/{streamname}/{version}") -public class SuperTenantSubscriptionEndpoint extends SubscriptionEndpoint { - - private static final Log log = LogFactory.getLog(SuperTenantSubscriptionEndpoint.class); - - /** - * Web socket onOpen - When client sends a message - * - * @param session - Users registered session. - * @param streamName - StreamName extracted from the ws url. - * @param version - Version extracted from the ws url. - */ - @OnOpen - public void onOpen(Session session, EndpointConfig config, @PathParam("streamname") String streamName, - @PathParam("version") String version) { - if (log.isDebugEnabled()) { - log.debug("WebSocket opened, for Session id: " + session.getId() + ", for the Stream:" + streamName); - } - super.onOpen(session); - } - - /** - * Web socket onMessage - When client sens a message - * - * @param session - Users registered session. - * @param message - Status code for web-socket close. - * @param streamName - StreamName extracted from the ws url. - */ - @OnMessage - public void onMessage(Session session, String message, @PathParam("streamname") String streamName) { - if (log.isDebugEnabled()) { - log.debug("Received message from client. Message: " + message + ", " + - "for Session id: " + session.getId() + ", for the Stream:" + streamName); - } - super.onMessage(session, message); - } - - /** - * Web socket onClose - Remove the registered sessions - * - * @param session - Users registered session. - * @param reason - Status code for web-socket close. - * @param streamName - StreamName extracted from the ws url. - * @param version - Version extracted from the ws url. - */ - @OnClose - public void onClose(Session session, CloseReason reason, @PathParam("streamname") String streamName, - @PathParam("version") String version) { - super.onClose(session, reason, streamName, version, MultitenantConstants.SUPER_TENANT_NAME); - } - - /** - * Web socket onError - Remove the registered sessions - * - * @param session - Users registered session. - * @param throwable - Status code for web-socket close. - * @param streamName - StreamName extracted from the ws url. - * @param version - Version extracted from the ws url. - */ - @OnError - public void onError(Session session, Throwable throwable, @PathParam("streamname") String streamName, - @PathParam("version") String version) { - super.onError(session, throwable, streamName, version, MultitenantConstants.SUPER_TENANT_NAME); - } - -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/TenantSubscriptionEndpoint.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/TenantSubscriptionEndpoint.java deleted file mode 100644 index 02e55cfed6..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/inbound/TenantSubscriptionEndpoint.java +++ /dev/null @@ -1,103 +0,0 @@ -/* - * Copyright (c) 2018, 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.analytics.wsproxy.inbound; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; - -import javax.websocket.CloseReason; -import javax.websocket.EndpointConfig; -import javax.websocket.OnClose; -import javax.websocket.OnError; -import javax.websocket.OnMessage; -import javax.websocket.OnOpen; -import javax.websocket.Session; -import javax.websocket.server.PathParam; -import javax.websocket.server.ServerEndpoint; - -/** - * Connect to web socket with a tenant - */ - -@ServerEndpoint(value = "/{destination}/t/{tdomain}/{streamname}/{version}") -public class TenantSubscriptionEndpoint extends SubscriptionEndpoint { - - private static final Log log = LogFactory.getLog(TenantSubscriptionEndpoint.class); - - /** - * Web socket onOpen - When client sends a message - * - * @param session - Users registered session. - * @param streamName - StreamName extracted from the ws url. - * @param version - Version extracted from the ws url. - * @param tdomain - Tenant domain extracted from ws url. - */ - @OnOpen - public void onOpen(Session session, EndpointConfig config, @PathParam("streamname") String streamName, - @PathParam("version") String version, @PathParam("tdomain") String tdomain) { - if (log.isDebugEnabled()) { - log.debug("WebSocket opened, for Session id: " + session.getId() + ", for the Stream:" + streamName); - } - super.onOpen(session); - } - - /** - * Web socket onMessage - When client sens a message - * - * @param session - Users registered session. - * @param message - Status code for web-socket close. - * @param streamName - StreamName extracted from the ws url. - */ - @OnMessage - public void onMessage(Session session, String message, @PathParam("streamname") String streamName, @PathParam("tdomain") String tdomain) { - if (log.isDebugEnabled()) { - log.debug("Received message from client. Message: " + message + ", for Session id: " + - session.getId() + ", for tenant domain" + tdomain + ", for the Adaptor:" + streamName); - } - super.onMessage(session, message); - } - - /** - * Web socket onClose - Remove the registered sessions - * - * @param session - Users registered session. - * @param reason - Status code for web-socket close. - * @param streamName - StreamName extracted from the ws url. - * @param version - Version extracted from the ws url. - */ - @OnClose - public void onClose(Session session, CloseReason reason, @PathParam("streamname") String streamName, - @PathParam("version") String version, @PathParam("tdomain") String tdomain) { - super.onClose(session, reason, streamName, version, tdomain); - } - - /** - * Web socket onError - Remove the registered sessions - * - * @param session - Users registered session. - * @param throwable - Status code for web-socket close. - * @param streamName - StreamName extracted from the ws url. - * @param version - Version extracted from the ws url. - */ - @OnError - public void onError(Session session, Throwable throwable, @PathParam("streamname") String streamName, - @PathParam("version") String version, @PathParam("tdomain") String tdomain) { - super.onError(session, throwable, streamName, version, tdomain); - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/outbound/AnalyticsClient.java b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/outbound/AnalyticsClient.java deleted file mode 100644 index 96e6d6974a..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/java/org/wso2/carbon/device/mgt/analytics/wsproxy/outbound/AnalyticsClient.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2018, 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.analytics.wsproxy.outbound; - -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.device.mgt.analytics.wsproxy.exception.WSProxyException; - -import javax.websocket.CloseReason; -import javax.websocket.ContainerProvider; -import javax.websocket.DeploymentException; -import javax.websocket.OnClose; -import javax.websocket.OnMessage; -import javax.websocket.Session; -import javax.websocket.WebSocketContainer; -import java.io.IOException; -import java.net.URI; - -/** - * This class holds web socket client implementation - * - * @since 1.0.0 - */ -@javax.websocket.ClientEndpoint -public class AnalyticsClient { - - private static final Log log = LogFactory.getLog(AnalyticsClient.class); - - private final Session analyticsSession; - private final Session clientSession; - - /** - * Create {@link AnalyticsClient} instance. - */ - public AnalyticsClient(Session clientSession, URI endpointURI) throws WSProxyException { - WebSocketContainer container = ContainerProvider.getWebSocketContainer(); - this.clientSession = clientSession; - - try { - this.analyticsSession = container.connectToServer(this, endpointURI); - } catch (DeploymentException | IOException e) { - String msg = "Error occurred while connecting to remote endpoint " + endpointURI.toString(); - log.error(msg, e); - throw new WSProxyException(msg, e); - } - } - - /** - * Callback hook for Connection close events. - * - * @param userSession the analyticsSession which is getting closed. - * @param reason the reason for connection close - */ - @OnClose - public void onClose(Session userSession, CloseReason reason) { - if (log.isDebugEnabled()) { - log.debug("Closing web socket session: '" + userSession.getId() + "'. Code: " + - reason.getCloseCode().toString() + " Reason: " + reason.getReasonPhrase()); - } - } - - /** - * Callback hook for Message Events. - * - *

This method will be invoked when a client send a message. - * - * @param message The text message. - */ - @OnMessage - public void onMessage(String message) { - synchronized (this.clientSession) { - try { - this.clientSession.getBasicRemote().sendText(message); - } catch (IOException e) { - log.warn("Sending message to client failed due to " + e.getMessage()); - if (log.isDebugEnabled()) { - log.debug("Full stack trace:", e); - } - } - } - } - - /** - * Send a message. - * - * @param message the message which is going to send. - */ - public void sendMessage(String message) { - synchronized (this.analyticsSession) { - try { - this.analyticsSession.getBasicRemote().sendText(message); - } catch (IOException e) { - log.warn("Sending message to analytics failed due to " + e.getMessage()); - if (log.isDebugEnabled()) { - log.debug("Full stack trace:", e); - } - } - } - } - - /** - * Close current connection. - */ - public void closeConnection(CloseReason closeReason) throws WSProxyException { - if (this.analyticsSession.isOpen()) { - try { - this.analyticsSession.close(closeReason); - } catch (IOException e) { - String msg = "Error on closing WS connection."; - log.error(msg, e); - throw new WSProxyException(msg, e); - } - } else { - log.warn("Analytics session '" + this.analyticsSession.getId() + "' is already closed"); - } - } -} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/webapp/WEB-INF/web.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/webapp/WEB-INF/web.xml deleted file mode 100644 index 933cf86531..0000000000 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.wsproxy/src/main/webapp/WEB-INF/web.xml +++ /dev/null @@ -1,46 +0,0 @@ - - - - - Output WebSocket Proxy - - - ContentTypeBasedCachePreventionFilter - org.wso2.carbon.ui.filters.cache.ContentTypeBasedCachePreventionFilter - - patterns - text/html" ,application/json" ,text/plain - - - filterAction - enforce - - - httpHeaders - Cache-Control: no-store, no-cache, must-revalidate, private - - - - - ContentTypeBasedCachePreventionFilter - /* - - 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 deleted file mode 100644 index 9c784d0af3..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml +++ /dev/null @@ -1,154 +0,0 @@ - - - - - - identity-extensions - io.entgra.device.mgt.core - 5.0.0-SNAPSHOT - - - 4.0.0 - bundle - WSO2 Carbon - OAuth Back End Authenticator - org.wso2.carbon.identity.authenticator.backend.oauth - - - - org.apache.felix - org.apache.felix.scr.ds-annotations - provided - - - org.wso2.carbon - org.wso2.carbon.utils - - - org.wso2.carbon.identity.framework - org.wso2.carbon.identity.base - - - org.wso2.carbon.identity.framework - org.wso2.carbon.identity.core - - - org.wso2.carbon - org.wso2.carbon.core - - - org.ops4j.pax.logging - pax-logging-api - provided - - - - org.wso2.carbon.identity.framework - org.wso2.carbon.identity.application.authentication.framework - - - org.wso2.carbon - org.wso2.carbon.core.services - - - org.wso2.carbon.identity.inbound.auth.oauth2 - org.wso2.carbon.identity.oauth - - - org.wso2.carbon.identity.framework - org.wso2.carbon.identity.application.common - - - org.wso2.carbon.identity.inbound.auth.oauth2 - org.wso2.carbon.identity.oauth.stub - - - commons-codec.wso2 - commons-codec - - - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.artifactId} - ${project.artifactId} - ${io.entgra.device.mgt.core.version} - OAuth Authenticator Bundle - - org.wso2.carbon.identity.authenticator.backend.oauth.internal - - - !org.wso2.carbon.identity.authenticator.backend.oauth.internal, - org.wso2.carbon.identity.authenticator.backend.oauth.* - - - org.wso2.carbon.identity.oauth2.*, - javax.servlet.http, - org.apache.axis2.client, - org.apache.axis2.context, - org.apache.axis2.transport.http, - 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.wso2.carbon.core.security, - org.wso2.carbon.core.services.authentication, - org.wso2.carbon.utils.multitenancy, - org.wso2.carbon.base, - org.wso2.carbon.utils - - - - - - 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/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/AuthenticatorException.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/AuthenticatorException.java deleted file mode 100755 index 38cf6b178a..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/AuthenticatorException.java +++ /dev/null @@ -1,39 +0,0 @@ -/* -* Copyright (c) 2015 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.identity.authenticator.backend.oauth; - -/** - * Custom exception for backend OAuth authentication - */ -@SuppressWarnings("unused") -public class AuthenticatorException extends Exception { - - private static final long serialVersionUID = 1L; - - public AuthenticatorException(String message) { - super(message); - } - - public AuthenticatorException(Throwable e) { - super(e); - } - - public AuthenticatorException(String message, Throwable e) { - super(message, e); - } -} diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/OauthAuthenticator.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/OauthAuthenticator.java deleted file mode 100755 index b1d41dd9e6..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/OauthAuthenticator.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2015 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.identity.authenticator.backend.oauth; - -import org.apache.axis2.context.MessageContext; -import org.apache.axis2.transport.http.HTTPConstants; -import org.apache.commons.logging.Log; -import org.apache.commons.logging.LogFactory; -import org.wso2.carbon.base.MultitenantConstants; -import org.wso2.carbon.core.security.AuthenticatorsConfiguration; -import org.wso2.carbon.core.services.authentication.CarbonServerAuthenticator; -import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuthValidationResponse; -import org.wso2.carbon.utils.ServerConstants; -import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuth2TokenValidator; -import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuthValidatorFactory; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpSession; -import java.rmi.RemoteException; - -/** - * This is a custom back end authenticator for enable OAuth token authentication for admin services - */ -public class OauthAuthenticator implements CarbonServerAuthenticator { - - private static final Log log = LogFactory.getLog(OauthAuthenticator.class); - private static final int PRIORITY = 5; - private static final int ACCESS_TOKEN_INDEX = 1; - private OAuth2TokenValidator tokenValidator; - - public OauthAuthenticator() { - try { - tokenValidator = OAuthValidatorFactory.getValidator(); - } catch (IllegalArgumentException e) { - log.error("Failed to initialise Authenticator", e); - } - } - - /** - * Checks whether the authentication of the context can be handled using this authenticator. - * - * @param messageContext containing the request need to be authenticated. - * @return boolean indicating whether the request can be authenticated by this Authenticator. - */ - public boolean isHandle(MessageContext messageContext) { - HttpServletRequest httpServletRequest = getHttpRequest(messageContext); - if (httpServletRequest != null) { - String headerValue = httpServletRequest.getHeader(HTTPConstants.HEADER_AUTHORIZATION); - if (headerValue != null && !headerValue.trim().isEmpty()) { - String[] headerPart = headerValue.trim().split(OauthAuthenticatorConstants.SPLITING_CHARACTOR); - if (OauthAuthenticatorConstants.AUTHORIZATION_HEADER_PREFIX_BEARER.equals(headerPart[0])) { - return true; - } - } else if (httpServletRequest.getParameter(OauthAuthenticatorConstants.BEARER_TOKEN_IDENTIFIER) != null) { - return true; - } - } - return false; - } - - /** - * Authenticates the user using the provided OAuth token and returns the status as a boolean. - * Sets the tenant domain and tenant friendly username to the session as attributes. - * - * @param messageContext containing the request need to be authenticated. - * @return boolean indicating the authentication status. - */ - public boolean isAuthenticated(MessageContext messageContext) { - HttpServletRequest httpServletRequest = getHttpRequest(messageContext); - String headerValue = httpServletRequest.getHeader(HTTPConstants.HEADER_AUTHORIZATION); - String[] headerPart = headerValue.trim().split(OauthAuthenticatorConstants.SPLITING_CHARACTOR); - String accessToken = headerPart[ACCESS_TOKEN_INDEX]; - OAuthValidationResponse response = null; - try { - response = tokenValidator.validateToken(accessToken); - } catch (RemoteException e) { - log.error("Failed to validate the OAuth token provided.", e); - } - if (response != null && response.isValid()) { - HttpSession session; - if ((session = httpServletRequest.getSession(false)) != null) { - session.setAttribute(MultitenantConstants.TENANT_DOMAIN, response.getTenantDomain()); - session.setAttribute(ServerConstants.USER_LOGGED_IN, response.getUserName()); - if (log.isDebugEnabled()) { - log.debug("Authentication successful for " + session.getAttribute(ServerConstants.USER_LOGGED_IN)); - } - } - return true; - } - if (log.isDebugEnabled()) { - log.debug("Authentication failed.Illegal attempt from session " + httpServletRequest.getSession().getId()); - } - return false; - } - - /** - * this method is currently not implemented. - * - * @param messageContext containing the request need to be authenticated. - * @return boolean - */ - public boolean authenticateWithRememberMe(MessageContext messageContext) { - throw new UnsupportedOperationException(); - } - - /** - * @return string Authenticator name. - */ - public String getAuthenticatorName() { - return OauthAuthenticatorConstants.AUTHENTICATOR_NAME; - } - - /** - * @return int priority of the authenticator. - */ - public int getPriority() { - return PRIORITY; - } - - /** - * @return boolean true for enable or otherwise for disable status. - */ - public boolean isDisabled() { - AuthenticatorsConfiguration authenticatorsConfiguration = AuthenticatorsConfiguration.getInstance(); - AuthenticatorsConfiguration.AuthenticatorConfig authenticatorConfig = authenticatorsConfiguration. - getAuthenticatorConfig(OauthAuthenticatorConstants.AUTHENTICATOR_NAME); - return authenticatorConfig.isDisabled(); - } - - /** - * Retrieve HTTP Servlet Request form thr Message Context. - * - * @param messageContext Containing the Servlet Request for backend authentication. - * @return HTTPServletRequest. - */ - private HttpServletRequest getHttpRequest(MessageContext messageContext) { - return (HttpServletRequest) messageContext.getProperty(HTTPConstants.MC_HTTP_SERVLETREQUEST); - } - -} diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/OauthAuthenticatorConstants.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/OauthAuthenticatorConstants.java deleted file mode 100755 index 66e96101a8..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/OauthAuthenticatorConstants.java +++ /dev/null @@ -1,29 +0,0 @@ -/* -* Copyright (c) 2015 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.identity.authenticator.backend.oauth; - -public class OauthAuthenticatorConstants { - public static final String AUTHORIZATION_HEADER_PREFIX_BEARER = "Bearer"; - public static final String AUTHORIZATION_HEADER_PREFIX_BASIC = "Basic"; - public static final String BEARER_TOKEN_TYPE = "bearer"; - public static final String BEARER_TOKEN_IDENTIFIER = "token"; - public static final String AUTHENTICATOR_NAME = "OAuthAuthenticator"; - public static final String SPLITING_CHARACTOR = " "; - public static final String OAUTH_ENDPOINT_POSTFIX = - "/services/OAuth2TokenValidationService.OAuth2TokenValidationServiceHttpsSoap12Endpoint/"; -} diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/internal/OAuthAuthenticatorDataHolder.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/internal/OAuthAuthenticatorDataHolder.java deleted file mode 100644 index 202568c4a5..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/internal/OAuthAuthenticatorDataHolder.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2015, 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.identity.authenticator.backend.oauth.internal; - -import org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService; - -/** - * DataHolder of Backend OAuth Authenticator component. - */ -public class OAuthAuthenticatorDataHolder { - - private OAuth2TokenValidationService oAuth2TokenValidationService; - - private static OAuthAuthenticatorDataHolder thisInstance = new OAuthAuthenticatorDataHolder(); - - private OAuthAuthenticatorDataHolder() {} - - public static OAuthAuthenticatorDataHolder getInstance() { - return thisInstance; - } - - public OAuth2TokenValidationService getOAuth2TokenValidationService() { - if (oAuth2TokenValidationService == null) { - throw new IllegalStateException("OAuth2TokenValidation service is not initialized properly"); - } - return oAuth2TokenValidationService; - } - - public void setOAuth2TokenValidationService( - OAuth2TokenValidationService oAuth2TokenValidationService) { - this.oAuth2TokenValidationService = oAuth2TokenValidationService; - } -} \ No newline at end of file diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/internal/OAuthAuthenticatorServiceComponent.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/internal/OAuthAuthenticatorServiceComponent.java deleted file mode 100755 index 30de0c2522..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/internal/OAuthAuthenticatorServiceComponent.java +++ /dev/null @@ -1,83 +0,0 @@ -/* -* Copyright (c) 2015 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.identity.authenticator.backend.oauth.internal; - -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.services.authentication.CarbonServerAuthenticator; -import org.wso2.carbon.identity.authenticator.backend.oauth.OauthAuthenticator; -import org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService; -import org.osgi.service.component.annotations.*; - -@Component( - name = "org.wso2.carbon.identity.backend.oauth.authenticator", - immediate = true) -public class OAuthAuthenticatorServiceComponent { - - private static final Log log = LogFactory.getLog(OAuthAuthenticatorServiceComponent.class); - - @SuppressWarnings("unused") - @Activate - protected void activate(ComponentContext componentContext) { - if (log.isDebugEnabled()) { - log.debug("Starting Backend OAuthAuthenticator Framework Bundle"); - } - } - - @SuppressWarnings("unused") - @Deactivate - protected void deactivate(ComponentContext componentContext) { - //do nothing - } - - /** - * Sets OAuth2TokenValidation Service. - * - * @param tokenValidationService An instance of OAuth2TokenValidationService. - */ - @SuppressWarnings("unused") - @Reference( - name = "identity.oauth2.validation.service", - service = org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService.class, - cardinality = ReferenceCardinality.MANDATORY, - policy = ReferencePolicy.DYNAMIC, - bind = "setOAuth2ValidationService", - unbind = "unsetOAuth2ValidationService") - protected void setOAuth2ValidationService(OAuth2TokenValidationService tokenValidationService) { - if (log.isDebugEnabled()) { - log.debug("Setting OAuth2TokenValidationService Service"); - } - OAuthAuthenticatorDataHolder.getInstance().setOAuth2TokenValidationService(tokenValidationService); - } - - /** - * Unsets OAuth2TokenValidation Service. - * - * @param tokenValidationService An instance of OAuth2TokenValidationService - */ - @SuppressWarnings("unused") - protected void unsetOAuth2ValidationService(OAuth2TokenValidationService tokenValidationService) { - if (log.isDebugEnabled()) { - log.debug("Unsetting OAuth2TokenValidationService Service"); - } - OAuthAuthenticatorDataHolder.getInstance().setOAuth2TokenValidationService(null); - } -} \ No newline at end of file diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuth2TokenValidator.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuth2TokenValidator.java deleted file mode 100755 index 1dbbd0fb68..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuth2TokenValidator.java +++ /dev/null @@ -1,35 +0,0 @@ -/* -* Copyright (c) 2015 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.identity.authenticator.backend.oauth.validator; - -import java.rmi.RemoteException; - -/** - * Declares the contract for OAuth2TokenValidator implementations. - */ -public interface OAuth2TokenValidator { - - /** - * This method gets a string accessToken and validates it and generate the OAuth2ClientApplicationDTO - * containing the validity and user details if valid. - * - * @param accessToken which need to be validated. - * @return OAuthValidationResponse with the validated results. - */ - OAuthValidationResponse validateToken(String accessToken) throws RemoteException; -} diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuthValidationResponse.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuthValidationResponse.java deleted file mode 100755 index 8804924a4c..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuthValidationResponse.java +++ /dev/null @@ -1,59 +0,0 @@ -/* -* Copyright (c) 2015 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.identity.authenticator.backend.oauth.validator; - -/** - * This class holds the authenticated user information after the OAuth2 token is validated. - */ -@SuppressWarnings("unused") -public class OAuthValidationResponse { - - private String userName; - private String tenantDomain; - private boolean isValid; - - public OAuthValidationResponse(String userName, String tenantDomain, boolean isValid) { - this.userName = userName; - this.tenantDomain = tenantDomain; - this.isValid = isValid; - } - - public String getUserName() { - return userName; - } - - public void setUserName(String userName) { - this.userName = userName; - } - - public String getTenantDomain() { - return tenantDomain; - } - - public void setTenantDomain(String tenantDomain) { - this.tenantDomain = tenantDomain; - } - - public boolean isValid() { - return isValid; - } - - public void setIsValid(boolean isValid) { - this.isValid = isValid; - } -} \ No newline at end of file diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuthValidatorFactory.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuthValidatorFactory.java deleted file mode 100755 index 8e0697e9db..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/OAuthValidatorFactory.java +++ /dev/null @@ -1,68 +0,0 @@ -/* -* Copyright (c) 2015 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.identity.authenticator.backend.oauth.validator; - -import org.wso2.carbon.core.security.AuthenticatorsConfiguration; -import org.wso2.carbon.identity.authenticator.backend.oauth.OauthAuthenticatorConstants; -import org.wso2.carbon.identity.authenticator.backend.oauth.validator.impl.ExternalOAuthValidator; -import org.wso2.carbon.identity.authenticator.backend.oauth.validator.impl.LocalOAuthValidator; - -/** - * The class validate the configurations and provide the most suitable implementation according to the configuration. - * Factory class for OAuthValidator. - */ -public class OAuthValidatorFactory { - - private static final String AUTHENTICATOR_CONFIG_IS_REMOTE = "isRemote"; - private static final String AUTHENTICATOR_CONFIG_HOST_URL = "hostURL"; - private static final String AUTHENTICATOR_CONFIG_ADMIN_USERNAME = "adminUsername"; - private static final String AUTHENTICATOR_CONFIG_ADMIN_PASSWORD = "adminPassword"; - - /** - * The method check the configuration and provide the appropriate implementation for OAuth2TokenValidator - * - * @return OAuth2TokenValidator - */ - public static OAuth2TokenValidator getValidator() throws IllegalArgumentException { - AuthenticatorsConfiguration authenticatorsConfiguration = AuthenticatorsConfiguration.getInstance(); - AuthenticatorsConfiguration.AuthenticatorConfig authenticatorConfig = authenticatorsConfiguration. - getAuthenticatorConfig(OauthAuthenticatorConstants.AUTHENTICATOR_NAME); - boolean isRemote; - String hostUrl; - String adminUserName; - String adminPassword; - if (authenticatorConfig != null && authenticatorConfig.getParameters() != null) { - isRemote = Boolean.parseBoolean(authenticatorConfig.getParameters().get( - AUTHENTICATOR_CONFIG_IS_REMOTE)); - hostUrl = authenticatorConfig.getParameters().get(AUTHENTICATOR_CONFIG_HOST_URL); - adminUserName = authenticatorConfig.getParameters().get(AUTHENTICATOR_CONFIG_ADMIN_USERNAME); - adminPassword = authenticatorConfig.getParameters().get(AUTHENTICATOR_CONFIG_ADMIN_PASSWORD); - } else { - throw new IllegalArgumentException("Configuration parameters need to be defined in Authenticators.xml"); - } - if (isRemote) { - if (!(hostUrl == null || hostUrl.trim().isEmpty())) { - hostUrl = hostUrl + OauthAuthenticatorConstants.OAUTH_ENDPOINT_POSTFIX; - return new ExternalOAuthValidator(hostUrl, adminUserName, adminPassword); - } else { - throw new IllegalArgumentException("Remote server name and ip both can't be empty"); - } - } - return new LocalOAuthValidator(); - } -} diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/ExternalOAuthValidator.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/ExternalOAuthValidator.java deleted file mode 100755 index c3d246bb16..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/ExternalOAuthValidator.java +++ /dev/null @@ -1,95 +0,0 @@ -/* -* Copyright (c) 2015 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.identity.authenticator.backend.oauth.validator.impl; - -import org.apache.axis2.client.Options; -import org.apache.axis2.client.ServiceClient; -import org.apache.axis2.transport.http.HTTPConstants; -import org.apache.commons.codec.binary.Base64; -import org.apache.commons.httpclient.Header; -import org.wso2.carbon.identity.authenticator.backend.oauth.OauthAuthenticatorConstants; -import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuth2TokenValidator; -import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuthValidationResponse; -import org.wso2.carbon.identity.oauth2.stub.OAuth2TokenValidationServiceStub; -import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationRequestDTO; -import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationRequestDTO_OAuth2AccessToken; -import org.wso2.carbon.identity.oauth2.stub.dto.OAuth2TokenValidationResponseDTO; -import org.wso2.carbon.utils.multitenancy.MultitenantUtils; - -import java.rmi.RemoteException; -import java.util.ArrayList; -import java.util.List; - -/** - * Handles the Authentication form external IDP servers. Currently supports WSO2 IS only. - */ -public class ExternalOAuthValidator implements OAuth2TokenValidator{ - - private String hostURL; - private String adminUserName; - private String adminPassword; - - public ExternalOAuthValidator(String hostURL, String adminUserName, String adminPassword) { - this.hostURL = hostURL; - this.adminUserName = adminUserName; - this.adminPassword = adminPassword; - } - /** - * This method gets a string accessToken and validates it and generate the OAuth2ClientApplicationDTO - * containing the validity and user details if valid. - * - * @param token which need to be validated. - * @return OAuthValidationResponse with the validated results. - */ - public OAuthValidationResponse validateToken(String token) throws RemoteException { - OAuth2TokenValidationRequestDTO validationRequest = new OAuth2TokenValidationRequestDTO(); - OAuth2TokenValidationRequestDTO_OAuth2AccessToken accessToken = - new OAuth2TokenValidationRequestDTO_OAuth2AccessToken(); - accessToken.setTokenType(OauthAuthenticatorConstants.BEARER_TOKEN_TYPE); - accessToken.setIdentifier(token); - validationRequest.setAccessToken(accessToken); - OAuth2TokenValidationServiceStub tokenValidationService = - new OAuth2TokenValidationServiceStub(hostURL); - ServiceClient client = tokenValidationService._getServiceClient(); - Options options = client.getOptions(); - List

headerList = new ArrayList<>(); - Header header = new Header(); - header.setName(HTTPConstants.HEADER_AUTHORIZATION); - header.setValue(OauthAuthenticatorConstants.AUTHORIZATION_HEADER_PREFIX_BASIC + " " + getBasicAuthCredentials()); - headerList.add(header); - options.setProperty(org.apache.axis2.transport.http.HTTPConstants.HTTP_HEADERS, headerList); - client.setOptions(options); - OAuth2TokenValidationResponseDTO tokenValidationResponse = tokenValidationService. - findOAuthConsumerIfTokenIsValid(validationRequest).getAccessTokenValidationResponse(); - boolean isValid = tokenValidationResponse.getValid(); - String userName = null; - String tenantDomain = null; - if (isValid) { - userName = MultitenantUtils.getTenantAwareUsername( - tokenValidationResponse.getAuthorizedUser()); - tenantDomain = MultitenantUtils. - getTenantDomain(tokenValidationResponse.getAuthorizedUser()); - } - return new OAuthValidationResponse(userName,tenantDomain,isValid); - } - - private String getBasicAuthCredentials() { - byte[] bytesEncoded = Base64.encodeBase64((adminUserName + ":" + adminPassword).getBytes()); - return new String(bytesEncoded); - } -} diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/LocalOAuthValidator.java b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/LocalOAuthValidator.java deleted file mode 100755 index 4182917f30..0000000000 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/src/main/java/org/wso2/carbon/identity/authenticator/backend/oauth/validator/impl/LocalOAuthValidator.java +++ /dev/null @@ -1,60 +0,0 @@ -/* -* Copyright (c) 2015 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.identity.authenticator.backend.oauth.validator.impl; - -import org.wso2.carbon.identity.authenticator.backend.oauth.OauthAuthenticatorConstants; -import org.wso2.carbon.identity.authenticator.backend.oauth.internal.OAuthAuthenticatorDataHolder; -import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuth2TokenValidator; -import org.wso2.carbon.identity.authenticator.backend.oauth.validator.OAuthValidationResponse; -import org.wso2.carbon.identity.oauth2.OAuth2TokenValidationService; -import org.wso2.carbon.identity.oauth2.dto.OAuth2TokenValidationRequestDTO; -import org.wso2.carbon.identity.oauth2.dto.OAuth2TokenValidationResponseDTO; -import org.wso2.carbon.utils.multitenancy.MultitenantUtils; - -/** - * Handles the authentication using the inbuilt IS features. - */ -public class LocalOAuthValidator implements OAuth2TokenValidator { - /** - * This method gets a string accessToken and validates it and generate the OAuth2ClientApplicationDTO - * containing the validity and user details if valid. - * - * @param token which need to be validated. - * @return OAuthValidationResponse with the validated results. - */ - public OAuthValidationResponse validateToken(String token) { - OAuth2TokenValidationRequestDTO validationRequest = new OAuth2TokenValidationRequestDTO(); - OAuth2TokenValidationRequestDTO.OAuth2AccessToken accessToken = - validationRequest.new OAuth2AccessToken(); - accessToken.setTokenType(OauthAuthenticatorConstants.BEARER_TOKEN_TYPE); - accessToken.setIdentifier(token); - validationRequest.setAccessToken(accessToken); - OAuth2TokenValidationResponseDTO tokenValidationResponse = OAuthAuthenticatorDataHolder.getInstance(). - getOAuth2TokenValidationService().findOAuthConsumerIfTokenIsValid(validationRequest).getAccessTokenValidationResponse(); - boolean isValid = tokenValidationResponse.isValid(); - String userName = null; - String tenantDomain = null; - if (isValid) { - userName = MultitenantUtils.getTenantAwareUsername( - tokenValidationResponse.getAuthorizedUser()); - tenantDomain = - MultitenantUtils.getTenantDomain(tokenValidationResponse.getAuthorizedUser()); - } - return new OAuthValidationResponse(userName, tenantDomain, isValid); - } -} diff --git a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/pom.xml b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/pom.xml index 9c115b8376..4df6c47019 100644 --- a/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/pom.xml +++ b/components/operation-template-mgt/io.entgra.device.mgt.core.operation.template/pom.xml @@ -54,7 +54,7 @@ IOT Operation Template Bundle io.entgra.device.mgt.core.operation.template.internal - com.google.common.cache;version="[31.0,32)", + com.google.common.cache;version="[32.1,33)";resolution:=optional, com.google.gson;version="[2.9,3)", io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", io.entgra.device.mgt.core.device.mgt.core.service;version="[5.0,6)", @@ -298,7 +298,7 @@ com.google.guava guava - ${guava.version} + ${google.guava.version} provided 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 deleted file mode 100644 index 2a0aec705c..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml +++ /dev/null @@ -1,107 +0,0 @@ - - - - - - - io.entgra.device.mgt.core - policy-mgt - 5.0.0-SNAPSHOT - ../pom.xml - - - 4.0.0 - io.entgra.device.mgt.core - org.wso2.carbon.complex.policy.decision.point - bundle - WSO2 Carbon - Policy Decision Point - WSO2 Carbon - Policy Decision Point - https://entgra.io - - - - - org.apache.felix - maven-bundle-plugin - true - - - ${project.artifactId} - ${project.artifactId} - ${io.entgra.device.mgt.core.version} - Complex Policy Decision Point Bundle - org.wso2.carbon.complex.policy.decision.point.internal - - org.wso2.carbon.complex.policy.decision.point.* - - - - - - 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 - - - - - - - - - - org.eclipse.osgi - org.eclipse.osgi - - - org.eclipse.equinox - org.eclipse.equinox.common - - - org.ops4j.pax.logging - pax-logging-api - provided - - - - io.entgra.device.mgt.core - io.entgra.device.mgt.core.policy.mgt.common - - - - - diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureFilter.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureFilter.java deleted file mode 100644 index 50fb7a54a4..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureFilter.java +++ /dev/null @@ -1,48 +0,0 @@ -/* -* Copyright (c) 2015 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.policy.evaluator; - -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; - -import java.util.List; - -public interface FeatureFilter { - - List evaluate(List policyList, List featureRulesList); - - List extractFeatures(List policyList); - - List evaluateFeatures(List featureList, List featureRulesList); - - void getDenyOverridesFeatures(String featureName, List featureList, List effectiveFeatureList); - - void getPermitOverridesFeatures(String featureName, List featureList, List effectiveFeatureList); - - void getFirstApplicableFeatures(String featureName, List featureList, List effectiveFeatureList); - - void getLastApplicableFeatures(String featureName, List featureList, List effectiveFeatureList); - - void getAllApplicableFeatures(String featureName, List featureList, List effectiveFeatureList); - - void getHighestApplicableFeatures(String featureName, List featureList, List effectiveFeatureList); - - void getLowestApplicableFeatures(String featureName, List featureList, List effectiveFeatureList); -} diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureFilterImpl.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureFilterImpl.java deleted file mode 100644 index e6eb914312..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureFilterImpl.java +++ /dev/null @@ -1,250 +0,0 @@ -/* -* Copyright (c) 2015 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.policy.evaluator; - -import org.wso2.carbon.policy.evaluator.utils.Constants; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.ProfileFeature; - -import java.util.ArrayList; -import java.util.List; - -/** - * This class is responsible for evaluating the policy (Configurations sets) and returning - * the effective features set. - */ - -public class FeatureFilterImpl implements FeatureFilter { - - /** - * This method returns the effective feature list when policy list and feature aggregation rules are supplied. - * @param policyList - * @param featureRulesList - * @return - */ - @Override - public List evaluate(List policyList, List featureRulesList) { - return evaluateFeatures(extractFeatures(policyList), featureRulesList); - } - - /** - * This method extract the features from the given policy list in the order they are provided in the list. - * @param policyList - * @return - */ - public List extractFeatures(List policyList) { - List featureList = new ArrayList(); - for (Policy policy : policyList) { - featureList.addAll(policy.getProfile().getProfileFeaturesList()); - } - return featureList; - } - - /** - * This method is responsible for supplying tasks to other methods to evaluate given features. - * @param featureList - * @param featureRulesList - * @return - */ - public List evaluateFeatures(List featureList, List featureRulesList) { - List effectiveFeatureList = new ArrayList(); - for (FeatureRules rule : featureRulesList) { - String ruleName = rule.getEvaluationCriteria(); - String featureName = rule.getName(); - if (Constants.DENY_OVERRIDES.equalsIgnoreCase(ruleName)) { - getDenyOverridesFeatures(featureName, featureList, effectiveFeatureList); - } - if (Constants.PERMIT_OVERRIDES.equalsIgnoreCase(ruleName)) { - getPermitOverridesFeatures(featureName, featureList, effectiveFeatureList); - } - if (Constants.FIRST_APPLICABLE.equalsIgnoreCase(ruleName)) { - getFirstApplicableFeatures(featureName, featureList, effectiveFeatureList); - } - if (Constants.LAST_APPLICABLE.equalsIgnoreCase(ruleName)) { - getLastApplicableFeatures(featureName, featureList, effectiveFeatureList); - } - if (Constants.ALL_APPLICABLE.equalsIgnoreCase(ruleName)) { - getAllApplicableFeatures(featureName, featureList, effectiveFeatureList); - } - if (Constants.HIGHEST_APPLICABLE.equalsIgnoreCase(ruleName)) { - getHighestApplicableFeatures(featureName, featureList, effectiveFeatureList); - } - if (Constants.LOWEST_APPLICABLE.equalsIgnoreCase(ruleName)) { - getLowestApplicableFeatures(featureName, featureList, effectiveFeatureList); - } - } - return effectiveFeatureList; - } - - /** - * This method picks up denied features, if there is no denied features it will add to the list, the final permitted feature. - * But if given policies do not have features of given type, it will not add anything. - * - * @param featureName - * @param featureList - * @param effectiveFeatureList - */ - public void getDenyOverridesFeatures(String featureName, List featureList, List effectiveFeatureList) { - ProfileFeature evaluatedFeature = null; -// for (ProfileFeature feature : featureList) { -// if (feature.getFeature().getName().equalsIgnoreCase(featureName)) { -// if (feature.getFeature().getRuleValue().equalsIgnoreCase("Deny")) { -// evaluatedFeature = feature; -// effectiveFeatureList.add(evaluatedFeature); -// return; -// } else { -// evaluatedFeature = feature; -// } -// } -// } - if (evaluatedFeature != null) { - effectiveFeatureList.add(evaluatedFeature); - } - - } - - /** - * This method picks up permitted features, if there is no permitted features it will add to the list, the final denied feature. - * But if given policies do not have features of given type, it will not add anything. - * - * @param featureName - * @param featureList - * @param effectiveFeatureList - */ - public void getPermitOverridesFeatures(String featureName, List featureList, List effectiveFeatureList) { - ProfileFeature evaluatedFeature = null; -// for (ProfileFeature feature : featureList) { -// if (feature.getFeature().getName().equalsIgnoreCase(featureName)) { -// if (feature.getFeature().getRuleValue().equalsIgnoreCase("Permit")) { -// evaluatedFeature = feature; -// effectiveFeatureList.add(evaluatedFeature); -// return; -// } else { -// evaluatedFeature = feature; -// } -// } -// } - if (evaluatedFeature != null) { - effectiveFeatureList.add(evaluatedFeature); - } - - } - - /** - * This method picks the first features of the give type. - * But if given policies do not have features of given type, it will not add anything. - * - * @param featureName - * @param featureList - * @param effectiveFeatureList - */ - public void getFirstApplicableFeatures(String featureName, List featureList, List effectiveFeatureList) { - for (ProfileFeature feature : featureList) { -// if (feature.getFeature().getName().equalsIgnoreCase(featureName)) { -// effectiveFeatureList.add(feature); -// return; -// -// } - } - } - - /** - * This method picks the last features of the give type. - * But if given policies do not have features of given type, it will not add anything. - * - * @param featureName - * @param featureList - * @param effectiveFeatureList - */ - public void getLastApplicableFeatures(String featureName, List featureList, List effectiveFeatureList) { - ProfileFeature evaluatedFeature = null; -// for (ProfileFeature feature : featureList) { -// if (feature.getFeature().getName().equalsIgnoreCase(featureName)) { -// evaluatedFeature = feature; -// } -// } - if (evaluatedFeature != null) { - effectiveFeatureList.add(evaluatedFeature); - } - } - - /** - * This method picks the all features of the give type. - * But if given policies do not have features of given type, it will not add anything. - * - * @param featureName - * @param featureList - * @param effectiveFeatureList - */ - public void getAllApplicableFeatures(String featureName, List featureList, List effectiveFeatureList) { - for (ProfileFeature feature : featureList) { -// if (feature.getFeature().getName().equalsIgnoreCase(featureName)) { -// effectiveFeatureList.add(feature); -// } - } - } - - /** - * This method picks the feature with the highest value of given type. - * But if given policies do not have features of given type, it will not add anything. - * - * @param featureName - * @param featureList - * @param effectiveFeatureList - */ - public void getHighestApplicableFeatures(String featureName, List featureList, List effectiveFeatureList) { - ProfileFeature evaluatedFeature = null; - int intValve = 0; -// for (ProfileFeature feature : featureList) { -// if (feature.getFeature().getName().equalsIgnoreCase(featureName)) { -// if (Integer.parseInt(feature.getFeature().getRuleValue()) > intValve) { -// intValve = Integer.parseInt(feature.getFeature().getRuleValue()); -// evaluatedFeature = feature; -// } -// } -// } - if (evaluatedFeature != null) { - effectiveFeatureList.add(evaluatedFeature); - } - } - - /** - * This method picks the feature with the lowest value of given type. - * But if given policies do not have features of given type, it will not add anything. - * - * @param featureName - * @param featureList - * @param effectiveFeatureList - */ - public void getLowestApplicableFeatures(String featureName, List featureList, List effectiveFeatureList) { - ProfileFeature evaluatedFeature = null; -// int intValve = 0; -// for (ProfileFeature feature : featureList) { -// if (feature.getFeature().getName().equalsIgnoreCase(featureName)) { -// if (Integer.parseInt(feature.getFeature().getRuleValue()) < intValve) { -// intValve = Integer.parseInt(feature.getFeature().getRuleValue()); -// evaluatedFeature = feature; -// } -// } -// } - if (evaluatedFeature != null) { - effectiveFeatureList.add(evaluatedFeature); - } - } -} diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureRules.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureRules.java deleted file mode 100644 index f706cf947f..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/FeatureRules.java +++ /dev/null @@ -1,41 +0,0 @@ -/* -* Copyright (c) 2015 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.policy.evaluator; - -public class FeatureRules { - - private String name; - private String evaluationCriteria; - - public String getName() { - return name; - } - - public void setName(String name) { - this.name = name; - } - - public String getEvaluationCriteria() { - return evaluationCriteria; - } - - public void setEvaluationCriteria(String evaluationCriteria) { - this.evaluationCriteria = evaluationCriteria; - } -} diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PDPException.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PDPException.java deleted file mode 100644 index 571f9c6848..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PDPException.java +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2014, 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.policy.evaluator; - -public class PDPException extends Exception { - - private String pdpErrorMessage; - - public String getPdpErrorMessage() { - return pdpErrorMessage; - } - - public void setPdpErrorMessage(String pdpErrorMessage) { - this.pdpErrorMessage = pdpErrorMessage; - } - - public PDPException(String message) { - setPdpErrorMessage(message); - } - - public PDPException(String message, Exception ex) { - super(message, ex); - setPdpErrorMessage(message); - } - - public PDPException(String message, Throwable cause) { - super(message, cause); - setPdpErrorMessage(message); - } - - public PDPException(Throwable cause) { - super(cause); - } - - public PDPException(){ - super(); - } -} diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PDPServiceImpl.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PDPServiceImpl.java deleted file mode 100644 index 82421c9f03..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PDPServiceImpl.java +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2015, 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.policy.evaluator; - -import org.wso2.carbon.policy.evaluator.spi.PDPService; -import io.entgra.device.mgt.core.policy.mgt.common.Feature; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; - -import java.util.List; - -public class PDPServiceImpl implements PDPService { - @Override - public List getEffectivePolicyList(List policies, List roles, String deviceType) { - return null; - } - - @Override - public List getEffectiveFeatureList(List policies, List featureRulesList) { - return null; - } -} diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilter.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilter.java deleted file mode 100644 index 84b6cac51e..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilter.java +++ /dev/null @@ -1,43 +0,0 @@ -/* -* Copyright (c) 2015 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.policy.evaluator; - -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; - -import java.util.List; - -public interface PolicyFilter { - - /** - * This method will extract the policies related a given roles list from the policy list available. - * @param policyList - * @param roles - * @return - */ - public List extractPoliciesRelatedToRoles(List policyList, List roles); - - /** - * This mehtod extract the policies related to a given device type from policy list. - * @param policyList - * @param deviceType - * @return - */ - public List extractPoliciesRelatedToDeviceType(List policyList, String deviceType); -} diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilterImpl.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilterImpl.java deleted file mode 100644 index 37818b7461..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/PolicyFilterImpl.java +++ /dev/null @@ -1,72 +0,0 @@ -/* - * Copyright (c) 2014, 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.policy.evaluator; - -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; - -import java.util.ArrayList; -import java.util.List; - -public class PolicyFilterImpl implements PolicyFilter { - - - /** - * This method will extract the policies related a given roles list from the policy list available. - * - * @param policyList - * @param roles - * @return - */ - @Override - public List extractPoliciesRelatedToRoles(List policyList, List roles) { - - List policies = new ArrayList<>(); - - for (Policy policy : policyList) { - List roleList = policy.getRoles(); - - for (String role : roleList) { - if (roles.contains(role)) { - policies.add(policy); - break; - } - } - } - return policies; - } - - /** - * This mehtod extract the policies related to a given device type from policy list. - * - * @param policyList - * @param deviceType - * @return - */ - @Override - public List extractPoliciesRelatedToDeviceType(List policyList, String deviceType) { - List policies = new ArrayList<>(); - - for (Policy policy : policyList) { - if (policy.getProfile().getDeviceType().equalsIgnoreCase(deviceType)) { - policies.add(policy); - } - } - return policies; - } -} diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/spi/PDPService.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/spi/PDPService.java deleted file mode 100644 index ea43abb397..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/spi/PDPService.java +++ /dev/null @@ -1,34 +0,0 @@ -/* -* Copyright (c) 2014, 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.policy.evaluator.spi; - - -import org.wso2.carbon.policy.evaluator.FeatureRules; -import io.entgra.device.mgt.core.policy.mgt.common.Feature; -import io.entgra.device.mgt.core.device.mgt.common.policy.mgt.Policy; - -import java.util.List; - -public interface PDPService { - - List getEffectivePolicyList(List policies, List roles, String deviceType); - - List getEffectiveFeatureList(List policies, List featureRulesList); - -} diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/utils/Constants.java b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/utils/Constants.java deleted file mode 100644 index 790fa7f246..0000000000 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/src/main/java/org/wso2/carbon/policy/evaluator/utils/Constants.java +++ /dev/null @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2015 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.policy.evaluator.utils; - -public class Constants { - - public static final String DENY_OVERRIDES = "deny_overrides"; - public static final String PERMIT_OVERRIDES = "permit_overrides"; - public static final String FIRST_APPLICABLE = "first_applicable"; - public static final String LAST_APPLICABLE = "last_applicable"; - public static final String ALL_APPLICABLE = "all_applicable"; - public static final String HIGHEST_APPLICABLE = "highest_applicable"; - public static final String LOWEST_APPLICABLE = "lowest_applicable"; -} diff --git a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/pom.xml b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/pom.xml index 1c2e2c8aec..fcf802e885 100644 --- a/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/pom.xml +++ b/components/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt/pom.xml @@ -54,7 +54,7 @@ io.entgra.device.mgt.core.subtype.mgt.internal com.fasterxml.jackson.core;version="[2.14,3)", - com.google.common.cache;version="[31.0,32)", + com.google.common.cache;version="[32.1,33)";resolution:=optional, io.entgra.device.mgt.core.device.mgt.common.exceptions;version="[5.0,6)", io.entgra.device.mgt.core.device.mgt.core.config;version="[5.0,6)", io.entgra.device.mgt.core.device.mgt.core.config.datasource;version="[5.0,6)", 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 deleted file mode 100644 index d8f8e0e32f..0000000000 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml +++ /dev/null @@ -1,104 +0,0 @@ - - - - - - - io.entgra.device.mgt.core - apimgt-extensions-feature - 5.0.0-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.apimgt.handler.server.feature - pom - WSO2 Carbon - Device Management - APIM handler Server Feature - https://entgra.io - This feature contains the handler for the api authentications - - - - - io.entgra.device.mgt.core - org.wso2.carbon.apimgt.handlers - - - - - - - maven-resources-plugin - - - copy-resources - generate-resources - - copy-resources - - - src/main/resources - - - resources - - build.properties - p2.inf - - - - - - - - - org.wso2.maven - carbon-p2-plugin - ${carbon.p2.plugin.version} - - - p2-feature-generation - package - - p2-feature-gen - - - org.wso2.carbon.apimgt.handler.server - ../../../features/etc/feature.properties - - - org.wso2.carbon.p2.category.type:server - org.eclipse.equinox.p2.type.group:false - - - - - io.entgra.device.mgt.core:org.wso2.carbon.apimgt.handlers:${io.entgra.device.mgt.core.version} - - - - - - - - - - - - diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/build.properties b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/build.properties deleted file mode 100644 index 89aee3ff76..0000000000 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. -# -# Entgra (Pvt) Ltd. 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. -# - -custom = true diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/conf/iot-api-config.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/conf/iot-api-config.xml deleted file mode 100644 index 7b1462746b..0000000000 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/conf/iot-api-config.xml +++ /dev/null @@ -1,40 +0,0 @@ - - - - - - https://${iot.core.host}:${iot.core.https.port}/ - - - https://${iot.core.host}:${iot.core.https.port}/api/certificate-mgt/v1.0/admin/certificates/verify/ - - - admin - admin - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token - - - /services - - \ No newline at end of file diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/p2.inf b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/p2.inf deleted file mode 100644 index e7c6acf89f..0000000000 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/src/main/resources/p2.inf +++ /dev/null @@ -1,2 +0,0 @@ -instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.apimgt.handler.server_${feature.version}/conf/iot-api-config.xml,target:${installFolder}/../../conf/iot-api-config.xml,overwrite:true);\ 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 deleted file mode 100644 index 37c5189f98..0000000000 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/pom.xml +++ /dev/null @@ -1,118 +0,0 @@ - - - - - - io.entgra.device.mgt.core - apimgt-extensions-feature - 5.0.0-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.apimgt.integration.client.feature - pom - WSO2 Carbon - APIM Integration Client Feature - https://entgra.io - This feature contains a http client implementation to communicate with WSO2-APIM server - - - - io.entgra.device.mgt.core - org.wso2.carbon.apimgt.integration.client - - - io.entgra.device.mgt.core - org.wso2.carbon.apimgt.integration.generated.client - - - - - - - maven-resources-plugin - - - copy-resources - generate-resources - - copy-resources - - - src/main/resources - - - resources - - build.properties - p2.inf - - - - - - - - - org.wso2.maven - carbon-p2-plugin - ${carbon.p2.plugin.version} - - - p2-feature-generation - package - - p2-feature-gen - - - org.wso2.carbon.apimgt.integration.client - ../../../features/etc/feature.properties - - - org.wso2.carbon.p2.category.type:server - org.eclipse.equinox.p2.type.group:false - - - - - io.github.openfeign:feign-jackson:${io.github.openfeign.version} - - - io.github.openfeign:feign-core:${io.github.openfeign.version} - - - io.github.openfeign:feign-gson:${io.github.openfeign.version} - - - io.github.openfeign:feign-slf4j:${io.github.openfeign.version} - - - io.entgra.device.mgt.core:org.wso2.carbon.apimgt.integration.client:${project.version} - - - io.entgra.device.mgt.core:org.wso2.carbon.apimgt.integration.generated.client:${project.version} - - - - - - - - - diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/build.properties b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/build.properties deleted file mode 100644 index 89aee3ff76..0000000000 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. -# -# Entgra (Pvt) Ltd. 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. -# - -custom = true diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/conf/apim-integration.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/conf/apim-integration.xml deleted file mode 100644 index ec89b619c1..0000000000 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/conf/apim-integration.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - https://${iot.keymanager.host}:${iot.keymanager.https.port}/client-registration/v0.12/register - https://${iot.gateway.host}:${iot.gateway.https.port}/token - https://${iot.apimpublisher.host}:${iot.apimpublisher.https.port}/api/am/publisher/v0.12 - https://${iot.apimstore.host}:${iot.apimstore.https.port}/api/am/store/v0.12 - admin - admin - \ No newline at end of file diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/p2.inf b/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/p2.inf deleted file mode 100644 index 3dca52fc59..0000000000 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.integration.client.feature/src/main/resources/p2.inf +++ /dev/null @@ -1,2 +0,0 @@ -instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.apimgt.integration.client_${feature.version}/conf/apim-integration.xml,target:${installFolder}/../../conf/apim-integration.xml,overwrite:true);\ 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 deleted file mode 100644 index cbb89240a5..0000000000 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/pom.xml +++ /dev/null @@ -1,144 +0,0 @@ - - - - - - - io.entgra.device.mgt.core - device-mgt-feature - 5.0.0-SNAPSHOT - ../pom.xml - - - 4.0.0 - org.wso2.carbon.device.mgt.analytics.feature - pom - WSO2 Carbon - Device Management Server Feature - https://entgra.io - This feature contains bundles related to device analytics data publisher and ws proxy - - - - io.entgra.device.mgt.core - org.wso2.carbon.device.mgt.analytics.data.publisher - - - org.wso2.carbon.registry - org.wso2.carbon.registry.indexing - - - org.wso2.carbon.registry - org.wso2.carbon.registry.common - - - - - - - org.apache.maven.plugins - maven-dependency-plugin - - - copy - package - - copy - - - - - io.entgra.device.mgt.core - org.wso2.carbon.device.mgt.analytics.wsproxy - ${project.version} - war - true - - ${project.build.directory}/maven-shared-archive-resources/webapps - - secured-websocket-proxy.war - - - - - - - - maven-resources-plugin - - - copy-resources - generate-resources - - copy-resources - - - src/main/resources - - - resources - - build.properties - p2.inf - - - - - - - - - org.wso2.maven - carbon-p2-plugin - ${carbon.p2.plugin.version} - - - p2-feature-generation - package - - p2-feature-gen - - - org.wso2.carbon.device.mgt.analytics - ../../../features/etc/feature.properties - - - org.wso2.carbon.p2.category.type:server - org.eclipse.equinox.p2.type.group:false - - - - - io.entgra.device.mgt.core:org.wso2.carbon.device.mgt.analytics.data.publisher:${io.entgra.device.mgt.core.version} - - - - org.wso2.carbon.core.server:${carbon.kernel.version} - - - org.wso2.carbon.registry:org.wso2.carbon.registry.indexing:${carbon.registry.version} - org.wso2.carbon.registry:org.wso2.carbon.registry.common:${carbon.registry.version} - - - - - - - - - diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/build.properties b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/build.properties deleted file mode 100644 index 89aee3ff76..0000000000 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/build.properties +++ /dev/null @@ -1,19 +0,0 @@ -# -# Copyright (c) 2018 - 2023, Entgra (Pvt) Ltd. (http://www.entgra.io) All Rights Reserved. -# -# Entgra (Pvt) Ltd. 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. -# - -custom = true diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/conf/device-analytics-config.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/conf/device-analytics-config.xml deleted file mode 100644 index 8a39b21a21..0000000000 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/conf/device-analytics-config.xml +++ /dev/null @@ -1,49 +0,0 @@ - - - - - true - - tcp://${iot.analytics.host}:${iot.analytics.thrift.port} - - wss://${iot.analytics.host}:${iot.analytics.https.port} - admin - admin - diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/p2.inf b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/p2.inf deleted file mode 100644 index a0a1b3d005..0000000000 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.feature/src/main/resources/p2.inf +++ /dev/null @@ -1,4 +0,0 @@ -instructions.configure = \ -org.eclipse.equinox.p2.touchpoint.natives.copy(source:${installFolder}/../features/org.wso2.carbon.device.mgt.analytics_${feature.version}/conf/device-analytics-config.xml,target:${installFolder}/../../conf/etc/device-analytics-config.xml,overwrite:true);\ -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.mgt.analytics_${feature.version}/webapps/secured-websocket-proxy.war,target:${installFolder}/../../deployment/server/webapps/secured-websocket-proxy.war,overwrite:true);\ \ No newline at end of file diff --git a/pom.xml b/pom.xml index dcbac2b442..c81630de6c 100644 --- a/pom.xml +++ b/pom.xml @@ -2117,7 +2117,6 @@ 20220924 2.4.5 - 27.0.1-jre 1.70.0.wso2v1 @@ -2130,7 +2129,7 @@ 3.0.0.wso2v1 1.3 2.9.1 - 31.0.1-jre + 32.1.3-jre 4.12.0 3.6.0 11.0 @@ -2178,7 +2177,6 @@ 2.1.1 1.6.9 - 1.6.9 4.0.1 @@ -2205,7 +2203,7 @@ 1.7 - 2.1.7-wso2v227 + 4.0.0.wso2v20_25 1.5.11-wso2v18