refactored ui request handler component

task-fixes
Amalka Subasinghe 2 years ago
parent f0380076c1
commit 1d0f27b98e

@ -20,12 +20,12 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ui-request-interceptor</artifactId>
<groupId>io.entgra.devicemgt</groupId>
<groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.26-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>io.entgra.ui.request.interceptor</artifactId>
<artifactId>io.entgra.device.mgt.core.ui.request.interceptor</artifactId>
<packaging>war</packaging>
<name>Entgra - Request Handling Proxy Servlet</name>
<description>Proxy Service for Request Handling in Entgra EMM/IOT Server.</description>
@ -118,6 +118,16 @@
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.extensions.logger</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.notification.logger</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-web</artifactId>

@ -15,15 +15,15 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import com.google.gson.Gson;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import io.entgra.ui.request.interceptor.beans.AuthData;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -32,7 +32,7 @@ import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.utils.URIBuilder;
import org.apache.http.entity.ContentType;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;

@ -16,16 +16,16 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.exception.GrafanaManagementException;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.exception.GrafanaEnvVariablesNotDefined;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaUtil;
import io.entgra.ui.request.interceptor.beans.AuthData;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.ui.request.interceptor.util.GrafanaHandlerUtil;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.util.GrafanaHandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@ -16,12 +16,12 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import com.google.gson.JsonObject;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpHeaders;

@ -16,11 +16,11 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import io.entgra.ui.request.interceptor.beans.AuthData;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
@ -32,7 +32,7 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;

@ -16,20 +16,20 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import io.entgra.ui.request.interceptor.beans.AuthData;
import io.entgra.ui.request.interceptor.cache.LoginCache;
import io.entgra.ui.request.interceptor.cache.OAuthApp;
import io.entgra.ui.request.interceptor.cache.OAuthAppCacheKey;
import io.entgra.ui.request.interceptor.exceptions.LoginException;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData;
import io.entgra.device.mgt.core.ui.request.interceptor.cache.LoginCache;
import io.entgra.device.mgt.core.ui.request.interceptor.cache.OAuthApp;
import io.entgra.device.mgt.core.ui.request.interceptor.cache.OAuthAppCacheKey;
import io.entgra.device.mgt.core.ui.request.interceptor.exceptions.LoginException;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpHeaders;
@ -38,7 +38,7 @@ import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import org.apache.http.protocol.HTTP;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;

@ -16,13 +16,13 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpStatus;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;

@ -16,10 +16,10 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
@ -30,7 +30,7 @@ import org.apache.http.client.methods.HttpGet;
import org.apache.http.client.methods.HttpHead;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.client.methods.HttpPut;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;

@ -16,12 +16,12 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import io.entgra.ui.request.interceptor.beans.AuthData;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.lang3.StringUtils;
import org.apache.http.HttpStatus;
import org.json.JSONObject;

@ -16,21 +16,21 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import io.entgra.ui.request.interceptor.beans.AuthData;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpHeaders;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;

@ -16,18 +16,18 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import io.entgra.ui.request.interceptor.cache.LoginCache;
import io.entgra.ui.request.interceptor.cache.OAuthApp;
import io.entgra.ui.request.interceptor.cache.OAuthAppCacheKey;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.cache.LoginCache;
import io.entgra.device.mgt.core.ui.request.interceptor.cache.OAuthApp;
import io.entgra.device.mgt.core.ui.request.interceptor.cache.OAuthAppCacheKey;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.lang.text.StrSubstitutor;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@ -43,7 +43,7 @@ import org.json.JSONArray;
import org.json.JSONObject;
import org.w3c.dom.Document;
import org.w3c.dom.NodeList;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import org.xml.sax.InputSource;
import org.xml.sax.SAXException;

@ -16,14 +16,14 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.http.HttpStatus;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import javax.servlet.annotation.MultipartConfig;
import javax.servlet.annotation.WebServlet;

@ -16,24 +16,24 @@
* under the License.
*/
package io.entgra.ui.request.interceptor;
package io.entgra.device.mgt.core.ui.request.interceptor;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import com.google.gson.JsonSyntaxException;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerUtil;
import io.entgra.device.mgt.extensions.logger.spi.EntgraLogger;
import io.entgra.notification.logger.UserLogContext;
import io.entgra.notification.logger.impl.EntgraUserLoggerImpl;
import io.entgra.ui.request.interceptor.beans.AuthData;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.ui.request.interceptor.util.HandlerUtil;
import org.apache.http.HttpHeaders;
import org.apache.http.HttpStatus;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.entity.ContentType;
import org.apache.http.entity.StringEntity;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import org.wso2.carbon.device.mgt.core.config.DeviceConfigurationManager;
import org.wso2.carbon.device.mgt.core.config.DeviceManagementConfig;

@ -15,7 +15,7 @@
* specific language governing permissions and limitations
* under the License.
*/
package io.entgra.ui.request.interceptor.beans;
package io.entgra.device.mgt.core.ui.request.interceptor.beans;
import org.apache.http.Header;

@ -16,7 +16,7 @@
* under the License.
*/
package io.entgra.ui.request.interceptor.exceptions;
package io.entgra.device.mgt.core.ui.request.interceptor.exceptions;
public class LoginException extends Exception {
public LoginException(String message) {

@ -16,7 +16,7 @@
* under the License.
*/
package io.entgra.ui.request.interceptor.util;
package io.entgra.device.mgt.core.ui.request.interceptor.util;
public class HandlerConstants {
public static final String PUBLISHER_APPLICATION_NAME = "application-mgt-publisher";

@ -16,15 +16,15 @@
* under the License.
*/
package io.entgra.ui.request.interceptor.util;
package io.entgra.device.mgt.core.ui.request.interceptor.util;
import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonElement;
import com.google.gson.JsonObject;
import com.google.gson.JsonParser;
import io.entgra.ui.request.interceptor.beans.AuthData;
import io.entgra.ui.request.interceptor.cache.LoginCache;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData;
import io.entgra.device.mgt.core.ui.request.interceptor.cache.LoginCache;
import org.apache.commons.fileupload.FileItem;
import org.apache.commons.fileupload.FileUploadException;
import org.apache.commons.fileupload.disk.DiskFileItemFactory;
@ -54,7 +54,7 @@ import org.json.JSONArray;
import org.json.JSONException;
import org.json.JSONObject;
import org.w3c.dom.Document;
import io.entgra.ui.request.interceptor.beans.ProxyResponse;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.ProxyResponse;
import org.xml.sax.SAXException;
import javax.servlet.http.HttpServletRequest;

@ -16,10 +16,10 @@
* under the License.
*/
package io.entgra.ui.request.interceptor.websocket;
package io.entgra.device.mgt.core.ui.request.interceptor.websocket;
import io.entgra.ui.request.interceptor.beans.AuthData;
import io.entgra.ui.request.interceptor.util.HandlerConstants;
import io.entgra.device.mgt.core.ui.request.interceptor.beans.AuthData;
import io.entgra.device.mgt.core.ui.request.interceptor.util.HandlerConstants;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

@ -16,7 +16,7 @@
* under the License.
*/
package io.entgra.ui.request.interceptor.websocket;
package io.entgra.device.mgt.core.ui.request.interceptor.websocket;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common.exception.GrafanaManagementException;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaUtil;

@ -16,7 +16,7 @@
* under the License.
*/
package io.entgra.ui.request.interceptor.websocket;
package io.entgra.device.mgt.core.ui.request.interceptor.websocket;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.exception.GrafanaEnvVariablesNotDefined;
import io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.core.util.GrafanaConstants;

@ -90,7 +90,7 @@
</filter>
<filter>
<filter-name>GrafanaLiveSecurityFilter</filter-name>
<filter-class>io.entgra.ui.request.interceptor.websocket.GrafanaLiveSecurityFilter</filter-class>
<filter-class>io.entgra.device.mgt.core.ui.request.interceptor.websocket.GrafanaLiveSecurityFilter</filter-class>
</filter>
<filter-mapping>

@ -26,7 +26,6 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>io.entgra.devicemgt</groupId>
<artifactId>ui-request-interceptor</artifactId>
<name>Entgra - UI Request Interceptor Servlet</name>
<description>
@ -35,7 +34,7 @@
</description>
<packaging>pom</packaging>
<modules>
<module>io.entgra.ui.request.interceptor</module>
<module>io.entgra.device.mgt.core.ui.request.interceptor</module>
</modules>

@ -20,7 +20,7 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>ui-request-interceptor-feature</artifactId>
<groupId>io.entgra.devicemgt</groupId>
<groupId>io.entgra.device.mgt.core</groupId>
<version>5.0.26-SNAPSHOT</version>
</parent>
@ -47,8 +47,8 @@
<configuration>
<artifactItems>
<artifactItem>
<groupId>io.entgra.devicemgt</groupId>
<artifactId>io.entgra.ui.request.interceptor</artifactId>
<groupId>io.entgra.device.mgt.core</groupId>
<artifactId>io.entgra.device.mgt.core.ui.request.interceptor</artifactId>
<version>${project.version}</version>
<type>war</type>
<overWrite>true</overWrite>

@ -26,7 +26,6 @@
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>io.entgra.devicemgt</groupId>
<artifactId>ui-request-interceptor-feature</artifactId>
<name>Entgra - UI Request Interceptor Feature</name>
<description>

@ -42,7 +42,7 @@
<!-- <module>components/application-mgt</module>-->
<!-- <module>components/policy-mgt</module>-->
<!-- <module>components/certificate-mgt</module>-->
<!-- <module>components/ui-request-interceptor</module>-->
<module>components/ui-request-interceptor</module>
<module>components/transport-mgt</module>
<module>components/analytics-mgt</module>
<module>components/webapp-authenticator-framework</module>
@ -57,7 +57,7 @@
<!-- <module>features/policy-mgt</module>-->
<!-- <module>features/certificate-mgt</module>-->
<!-- <module>features/heartbeat-management</module>-->
<!-- <module>features/ui-request-interceptor</module>-->
<module>features/ui-request-interceptor</module>
<!-- <module>features/jwt-client</module>-->
<!-- <module>features/device-mgt-extensions</module>-->
<module>features/transport-mgt</module>

Loading…
Cancel
Save