diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/pom.xml
index e737390fdf..08c184a676 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
grafana-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common/pom.xml b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common/pom.xml
index b9ecb32cbf..f6acc863f0 100644
--- a/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.common/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
grafana-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
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 9042ba9849..605085f836 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
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
grafana-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/grafana-mgt/pom.xml b/components/analytics-mgt/grafana-mgt/pom.xml
index 3dcc7aa251..b727405a97 100644
--- a/components/analytics-mgt/grafana-mgt/pom.xml
+++ b/components/analytics-mgt/grafana-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
analytics-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/analytics-mgt/pom.xml b/components/analytics-mgt/pom.xml
index d585055efe..a059180ec0 100644
--- a/components/analytics-mgt/pom.xml
+++ b/components/analytics-mgt/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/pom.xml
index 9a895ca452..7d4c9f4674 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/pom.xml
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension/pom.xml
@@ -20,7 +20,7 @@
apimgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
4.0.0
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.annotations/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.annotations/pom.xml
index a7ac0fff92..11c12b310d 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.annotations/pom.xml
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.annotations/pom.xml
@@ -22,7 +22,7 @@
apimgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/pom.xml
index b1409beb81..95272e5c94 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/pom.xml
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.api/pom.xml
@@ -21,7 +21,7 @@
apimgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/pom.xml
index f5ac906ace..6bcad291c4 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/pom.xml
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension/pom.xml
@@ -22,7 +22,7 @@
apimgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/pom.xml
index b996dd4edb..076b2ee983 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/pom.xml
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/pom.xml
@@ -22,7 +22,7 @@
apimgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
@@ -78,6 +78,10 @@
okhttp
compile
+
+ org.wso2.carbon
+ org.wso2.carbon.user.api
+
@@ -108,23 +112,20 @@
io.entgra.device.mgt.core.apimgt.extension.rest.api.*
- com.google.gson;version="[2.9,3)",
- io.entgra.device.mgt.core.apimgt.extension.rest.api,
- io.entgra.device.mgt.core.apimgt.extension.rest.api.dto,
- io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo,
- io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions,
- io.entgra.device.mgt.core.apimgt.extension.rest.api.util,
- javax.net.ssl,okhttp3;version="[4.9,5)",
- org.apache.commons.lang;version="[2.6,3)",
- org.apache.commons.logging;version="[1.2,2)",
- org.apache.commons.ssl;version="[3.1,4)",
- org.json;version="[3.0,4)",
org.osgi.framework.*;version="${imp.package.version.osgi.framework}",
org.osgi.service.*;version="${imp.package.version.osgi.service}",
- org.wso2.carbon.apimgt.api.model;version="[9.28,10)",
- org.wso2.carbon.apimgt.impl;version="[9.28,10)",
- org.wso2.carbon.apimgt.impl.internal;version="[9.28,10)",
- org.wso2.carbon.base;version="[1.0,2)"
+ org.wso2.carbon.core;version="4.6",
+ org.wso2.carbon.core.util;version="4.6",
+ org.apache.commons.ssl,
+ org.wso2.carbon.apimgt.api.model,
+ okhttp3.*,
+ org.wso2.carbon.apimgt.impl;version="${carbon.api.mgt.version.range}",
+ org.wso2.carbon.apimgt.impl.utils;version="${carbon.api.mgt.version.range}",
+ org.wso2.carbon.apimgt.impl.internal;version="${carbon.api.mgt.version.range}",
+ org.json,
+ org.wso2.carbon.user.api,
+ org.wso2.carbon.context;version="4.6",
+ org.wso2.carbon.utils.*
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/APIApplicationServicesImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/APIApplicationServicesImpl.java
index 68ea575e02..9f91fdda84 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/APIApplicationServicesImpl.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/APIApplicationServicesImpl.java
@@ -28,8 +28,10 @@ import okhttp3.*;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.json.JSONObject;
+import org.wso2.carbon.apimgt.impl.APIConstants;
import org.wso2.carbon.apimgt.impl.APIManagerConfiguration;
import org.wso2.carbon.apimgt.impl.internal.ServiceReferenceHolder;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
import java.io.IOException;
@@ -44,12 +46,12 @@ public class APIApplicationServicesImpl implements APIApplicationServices {
getAPIManagerConfigurationService().getAPIManagerConfiguration();
@Override
- public APIApplicationKey createAndRetrieveApplicationCredentials(String clientName, String grantType)
- throws APIServicesException {
+ public APIApplicationKey createAndRetrieveApplicationCredentials(String clientName, String grantType) throws APIServicesException {
+ String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+ String serverUser = getScopePublishUserName(tenantDomain);
+ String serverPassword = getScopePublishUserPassword(tenantDomain);
String applicationEndpoint = config.getFirstProperty(Constants.DCR_END_POINT);
- String serverUser = config.getFirstProperty(Constants.SERVER_USER);
- String serverPassword = config.getFirstProperty(Constants.SERVER_PASSWORD);
JSONObject jsonObject = new JSONObject();
jsonObject.put("callbackUrl", Constants.EMPTY_STRING);
@@ -64,9 +66,11 @@ public class APIApplicationServicesImpl implements APIApplicationServices {
.addHeader(Constants.AUTHORIZATION_HEADER_NAME, Credentials.basic(serverUser, serverPassword))
.post(requestBody)
.build();
+
try {
- Response response = client.newCall(request).execute();
- return gson.fromJson(response.body().string(), APIApplicationKey.class);
+ try (Response response = client.newCall(request).execute()) {
+ return gson.fromJson(response.body().string(), APIApplicationKey.class);
+ }
} catch (IOException e) {
msg = "Error occurred while processing the response";
log.error(msg, e);
@@ -107,8 +111,9 @@ public class APIApplicationServicesImpl implements APIApplicationServices {
public AccessTokenInfo generateAccessTokenFromRegisteredApplication(String consumerKey, String consumerSecret)
throws APIServicesException {
- String userName = config.getFirstProperty(Constants.SERVER_USER);
- String userPassword = config.getFirstProperty(Constants.SERVER_PASSWORD);
+ String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+ String userName = getScopePublishUserName(tenantDomain);
+ String userPassword = getScopePublishUserPassword(tenantDomain);
JSONObject params = new JSONObject();
params.put(Constants.GRANT_TYPE_PARAM_NAME, Constants.PASSWORD_GRANT_TYPE);
@@ -119,9 +124,8 @@ public class APIApplicationServicesImpl implements APIApplicationServices {
}
@Override
- public AccessTokenInfo generateAccessTokenFromRefreshToken(String refreshToken, String consumerKey, String consumerSecret)
- throws APIServicesException {
-
+ public AccessTokenInfo generateAccessTokenFromRefreshToken(String refreshToken, String consumerKey,
+ String consumerSecret) throws APIServicesException {
JSONObject params = new JSONObject();
params.put(Constants.GRANT_TYPE_PARAM_NAME, Constants.REFRESH_TOKEN_GRANT_TYPE);
params.put(Constants.REFRESH_TOKEN_GRANT_TYPE_PARAM_NAME, refreshToken);
@@ -150,4 +154,20 @@ public class APIApplicationServicesImpl implements APIApplicationServices {
throw new APIServicesException(e);
}
}
+
+ private String getScopePublishUserName(String tenantDomain) {
+ if(APIConstants.SUPER_TENANT_DOMAIN.equals(tenantDomain)) {
+ return config.getFirstProperty(Constants.SERVER_USER);
+ } else {
+ return Constants.SCOPE_PUBLISH_RESERVED_USER_NAME + "@" + tenantDomain;
+ }
+ }
+
+ private String getScopePublishUserPassword(String tenantDomain) {
+ if(APIConstants.SUPER_TENANT_DOMAIN.equals(tenantDomain)) {
+ return config.getFirstProperty(Constants.SERVER_PASSWORD);
+ } else {
+ return Constants.SCOPE_PUBLISH_RESERVED_USER_PASSWORD;
+ }
+ }
}
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java
index 4a27cc2f69..da24e906a1 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServices.java
@@ -41,6 +41,9 @@ public interface PublisherRESTAPIServices {
boolean updateSharedScope(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, Scope scope)
throws APIServicesException, BadRequestException, UnexpectedResponseException;
+ boolean deleteSharedScope(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, Scope scope)
+ throws APIServicesException, BadRequestException, UnexpectedResponseException;
+
APIInfo getApi(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, String apiUuid)
throws APIServicesException, BadRequestException, UnexpectedResponseException;
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java
index 8ba8bb12f7..8db730cc7b 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/PublisherRESTAPIServicesImpl.java
@@ -79,6 +79,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -123,6 +124,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
return false;
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -177,6 +179,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.message();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -231,6 +234,61 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
+ throw new UnexpectedResponseException(msg);
+ }
+ } catch (IOException e) {
+ String msg = "Error occurred while processing the response";
+ log.error(msg, e);
+ throw new APIServicesException(msg, e);
+ }
+ }
+
+ @Override
+ public boolean deleteSharedScope(APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo, Scope scope)
+ throws APIServicesException, BadRequestException, UnexpectedResponseException {
+ String updateScopeUrl = endPointPrefix + Constants.SCOPE_API_ENDPOINT + scope.getId();
+
+ JSONArray bindings = new JSONArray();
+ if (scope.getBindings() != null) {
+ for (String str : scope.getBindings()) {
+ bindings.put(str);
+ }
+ }
+
+ JSONObject payload = new JSONObject();
+ payload.put("name", (scope.getName() != null ? scope.getName() : ""));
+ payload.put("displayName", (scope.getDisplayName() != null ? scope.getDisplayName() : ""));
+ payload.put("description", (scope.getDescription() != null ? scope.getDescription() : ""));
+ payload.put("bindings", (bindings != null ? bindings : ""));
+ payload.put("usageCount", (scope.getUsageCount() != 0 ? scope.getUsageCount() : 0));
+
+ RequestBody requestBody = RequestBody.create(JSON, payload.toString());
+ Request request = new Request.Builder()
+ .url(updateScopeUrl)
+ .addHeader(Constants.AUTHORIZATION_HEADER_NAME, Constants.AUTHORIZATION_HEADER_PREFIX_BEARER
+ + accessTokenInfo.getAccess_token())
+ .delete(requestBody)
+ .build();
+
+ try {
+ Response response = client.newCall(request).execute();
+ if (HttpStatus.SC_OK == response.code()) {
+ return true;
+ } else if (HttpStatus.SC_UNAUTHORIZED == response.code()) {
+ APIApplicationServices apiApplicationServices = new APIApplicationServicesImpl();
+ AccessTokenInfo refreshedAccessToken = apiApplicationServices.
+ generateAccessTokenFromRefreshToken(accessTokenInfo.getRefresh_token(),
+ apiApplicationKey.getClientId(), apiApplicationKey.getClientSecret());
+ //TODO: max attempt count
+ return deleteSharedScope(apiApplicationKey, refreshedAccessToken, scope);
+ } else if (HttpStatus.SC_BAD_REQUEST == response.code()) {
+ String msg = "Bad Request, Invalid scope object";
+ log.error(msg);
+ throw new BadRequestException(msg);
+ } else {
+ String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -269,6 +327,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -308,6 +367,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -447,6 +507,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response status : " + response.code() + " Response message : " + response.message();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -586,6 +647,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -632,6 +694,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -673,6 +736,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -720,6 +784,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -761,6 +826,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -804,6 +870,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -846,6 +913,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -889,6 +957,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -939,6 +1008,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -990,6 +1060,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -1031,6 +1102,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -1071,6 +1143,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -1111,6 +1184,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -1162,6 +1236,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
@@ -1208,6 +1283,7 @@ public class PublisherRESTAPIServicesImpl implements PublisherRESTAPIServices {
throw new BadRequestException(msg);
} else {
String msg = "Response : " + response.code() + response.body();
+ log.error(msg);
throw new UnexpectedResponseException(msg);
}
} catch (IOException e) {
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/constants/Constants.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/constants/Constants.java
index 6ca26f74f0..34b4f04681 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/constants/Constants.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/constants/Constants.java
@@ -72,6 +72,8 @@ public final class Constants {
public static final String SUBSCRIPTION_API = "/api/am/devportal/v3/subscriptions";
public static final String DEV_PORTAL_API = "/api/am/devportal/v3/apis?limit=1000";
public static final String KEY_MANAGERS_API = "/api/am/devportal/v3/key-managers";
+ public static final String SCOPE_PUBLISH_RESERVED_USER_NAME = "scope_publish_reserved_user";
+ public static final String SCOPE_PUBLISH_RESERVED_USER_PASSWORD = "&gKfyE8E4rUY4Q";
+ public static final String ADMIN_ROLE_KEY = "admin";
+ public static final String PERM_SCOPE_MAPPING_META_KEY = "perm-scope-mapping";
}
-
-
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIServiceComponent.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/APIManagerServiceComponent.java
similarity index 77%
rename from components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIServiceComponent.java
rename to components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/APIManagerServiceComponent.java
index f5d000fc7f..51fbdc912e 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIServiceComponent.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/APIManagerServiceComponent.java
@@ -22,6 +22,8 @@ import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationService
import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServicesImpl;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServices;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServicesImpl;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServices;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServicesImpl;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.osgi.framework.BundleContext;
@@ -32,9 +34,9 @@ import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService;
@Component(
name = "io.entgra.device.mgt.core.apimgt.extension.rest.api.internal.PublisherRESTAPIServiceComponent",
immediate = true)
-public class PublisherRESTAPIServiceComponent {
+public class APIManagerServiceComponent {
- private static final Log log = LogFactory.getLog(PublisherRESTAPIServiceComponent.class);
+ private static Log log = LogFactory.getLog(APIManagerServiceComponent.class);
@Activate
protected void activate(ComponentContext componentContext) {
@@ -46,11 +48,15 @@ public class PublisherRESTAPIServiceComponent {
APIApplicationServices apiApplicationServices = new APIApplicationServicesImpl();
bundleContext.registerService(APIApplicationServices.class.getName(), apiApplicationServices, null);
- PublisherRESTAPIDataHolder.getInstance().setApiApplicationServices(apiApplicationServices);
+ APIManagerServiceDataHolder.getInstance().setApiApplicationServices(apiApplicationServices);
+
+ PublisherRESTAPIServices publisherRESTAPIServices = new PublisherRESTAPIServicesImpl();
+ bundleContext.registerService(PublisherRESTAPIServices.class.getName(), publisherRESTAPIServices, null);
+ APIManagerServiceDataHolder.getInstance().setPublisherRESTAPIServices(publisherRESTAPIServices);
ConsumerRESTAPIServices consumerRESTAPIServices = new ConsumerRESTAPIServicesImpl();
bundleContext.registerService(ConsumerRESTAPIServices.class.getName(), consumerRESTAPIServices, null);
- PublisherRESTAPIDataHolder.getInstance().setConsumerRESTAPIServices(consumerRESTAPIServices);
+ APIManagerServiceDataHolder.getInstance().setConsumerRESTAPIServices(consumerRESTAPIServices);
if (log.isDebugEnabled()) {
log.debug("API Application bundle has been successfully initialized");
@@ -74,13 +80,13 @@ public class PublisherRESTAPIServiceComponent {
if (log.isDebugEnabled()) {
log.debug("Setting API Manager Configuration Service");
}
- PublisherRESTAPIDataHolder.getInstance().setAPIManagerConfiguration(apiManagerConfigurationService);
+ APIManagerServiceDataHolder.getInstance().setAPIManagerConfiguration(apiManagerConfigurationService);
}
protected void unsetAPIManagerConfigurationService(APIManagerConfigurationService apiManagerConfigurationService) {
if (log.isDebugEnabled()) {
log.debug("Unsetting API Manager Configuration Service");
}
- PublisherRESTAPIDataHolder.getInstance().setAPIManagerConfiguration(null);
+ APIManagerServiceDataHolder.getInstance().setAPIManagerConfiguration(null);
}
}
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIDataHolder.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/APIManagerServiceDataHolder.java
similarity index 59%
rename from components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIDataHolder.java
rename to components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/APIManagerServiceDataHolder.java
index 4995df95ef..3153d50a89 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/PublisherRESTAPIDataHolder.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/internal/APIManagerServiceDataHolder.java
@@ -19,22 +19,28 @@
package io.entgra.device.mgt.core.apimgt.extension.rest.api.internal;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServices;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.ConsumerRESTAPIServices;
import org.wso2.carbon.apimgt.impl.APIManagerConfigurationService;
+import org.wso2.carbon.user.core.service.RealmService;
+import org.wso2.carbon.user.core.tenant.TenantManager;
-public class PublisherRESTAPIDataHolder {
+public class APIManagerServiceDataHolder {
private APIApplicationServices apiApplicationServices;
private APIManagerConfigurationService apiManagerConfigurationService;
+ private PublisherRESTAPIServices publisherRESTAPIServices;
+ private RealmService realmService;
+ private TenantManager tenantManager;
- private ConsumerRESTAPIServices consumerRESTAPIServices;
+ private static APIManagerServiceDataHolder thisInstance = new APIManagerServiceDataHolder();
- private static PublisherRESTAPIDataHolder thisInstance = new PublisherRESTAPIDataHolder();
+ private ConsumerRESTAPIServices consumerRESTAPIServices;
- private PublisherRESTAPIDataHolder() {
+ private APIManagerServiceDataHolder() {
}
- static PublisherRESTAPIDataHolder getInstance() {
+ static APIManagerServiceDataHolder getInstance() {
return thisInstance;
}
@@ -57,6 +63,38 @@ public class PublisherRESTAPIDataHolder {
return apiManagerConfigurationService;
}
+
+ public PublisherRESTAPIServices getPublisherRESTAPIServices() {
+ return publisherRESTAPIServices;
+ }
+
+ public void setPublisherRESTAPIServices(PublisherRESTAPIServices publisherRESTAPIServices) {
+ this.publisherRESTAPIServices = publisherRESTAPIServices;
+ }
+
+ public RealmService getRealmService() {
+ if (realmService == null) {
+ throw new IllegalStateException("Realm service is not initialized properly");
+ }
+ return realmService;
+ }
+
+ public void setRealmService(RealmService realmService) {
+ this.realmService = realmService;
+ this.setTenantManager(realmService);
+ }
+
+ public TenantManager getTenantManager() {
+ return tenantManager;
+ }
+
+ private void setTenantManager(RealmService realmService) {
+ if (realmService == null) {
+ throw new IllegalStateException("Realm service is not initialized properly");
+ }
+ this.tenantManager = realmService.getTenantManager();
+ }
+
public ConsumerRESTAPIServices getConsumerRESTAPIServices() {
return consumerRESTAPIServices;
}
@@ -64,5 +102,4 @@ public class PublisherRESTAPIDataHolder {
public void setConsumerRESTAPIServices(ConsumerRESTAPIServices consumerRESTAPIServices) {
this.consumerRESTAPIServices = consumerRESTAPIServices;
}
-
}
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIPublisherUtils.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIPublisherUtils.java
new file mode 100644
index 0000000000..6de3f50a32
--- /dev/null
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api/src/main/java/io/entgra/device/mgt/core/apimgt/extension/rest/api/util/APIPublisherUtils.java
@@ -0,0 +1,91 @@
+/*
+ * Copyright (c) 2018 - 2024, 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.
+ */
+
+package io.entgra.device.mgt.core.apimgt.extension.rest.api.util;
+
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.constants.Constants;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
+import org.wso2.carbon.user.api.UserStoreException;
+import org.wso2.carbon.user.api.UserStoreManager;
+import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
+
+/**
+ * This class contains utility methods needed for API publishing
+ */
+public class APIPublisherUtils {
+ private static final Log log = LogFactory.getLog(APIPublisherUtils.class);
+
+ /**
+ * This method will create the temporary user created to publish scopes to the sub tenant space.
+ * @param tenantDomain sub tenant domain from which the user will be created
+ * @throws APIServicesException if the user was unable to be created
+ */
+ public static void createScopePublishUserIfNotExists(String tenantDomain) throws APIServicesException {
+ if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
+ try {
+ UserStoreManager userStoreManager =
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getUserStoreManager();
+ if (!userStoreManager.isExistingUser(MultitenantUtils.getTenantAwareUsername(Constants.SCOPE_PUBLISH_RESERVED_USER_NAME))) {
+ if (log.isDebugEnabled()) {
+ log.debug("Creating scope publish user '" + Constants.SCOPE_PUBLISH_RESERVED_USER_NAME + "' in '" +
+ tenantDomain + "' tenant domain.");
+ }
+ String[] roles = {Constants.ADMIN_ROLE_KEY};
+ userStoreManager.addUser(
+ MultitenantUtils.getTenantAwareUsername(Constants.SCOPE_PUBLISH_RESERVED_USER_NAME),
+ Constants.SCOPE_PUBLISH_RESERVED_USER_PASSWORD,
+ roles,
+ null,
+ ""
+ );
+ }
+ } catch (UserStoreException e) {
+ String msg = "Error occurred while creating scope publishing user in tenant: '" + tenantDomain + "'.";
+ log.error(msg);
+ throw new APIServicesException(msg, e);
+ }
+ }
+ }
+
+ /**
+ * This method will delete the temporary user created to publish scopes to the sub tenant space.
+ * @param tenantDomain sub tenant domain from which the scope publish user will be removed from
+ */
+ public static void removeScopePublishUserIfExists(String tenantDomain) {
+ if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
+ try {
+ UserStoreManager userStoreManager =
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().getUserRealm().getUserStoreManager();
+ if (userStoreManager.isExistingUser(MultitenantUtils.getTenantAwareUsername(Constants.SCOPE_PUBLISH_RESERVED_USER_NAME))) {
+ if (log.isDebugEnabled()) {
+ log.debug("Deleting scope publish user '" + Constants.SCOPE_PUBLISH_RESERVED_USER_NAME + "' from '" +
+ tenantDomain + "' tenant domain.");
+ }
+ userStoreManager.deleteUser(MultitenantUtils.getTenantAwareUsername(Constants.SCOPE_PUBLISH_RESERVED_USER_NAME));
+ }
+ } catch(UserStoreException e){
+ String msg = "Error occurred while deleting scope publishing user from tenant: '" + tenantDomain + "'.";
+ log.error(msg);
+ }
+ }
+ }
+}
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/pom.xml
index 28257cf115..3d241b172a 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/pom.xml
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.api/pom.xml
@@ -21,7 +21,7 @@
apimgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
4.0.0
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/pom.xml
index ee3377f643..e623d369b0 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/pom.xml
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension/pom.xml
@@ -21,7 +21,7 @@
apimgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml
index 5cc211dcab..07b5a31897 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/pom.xml
@@ -22,7 +22,7 @@
apimgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherService.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherService.java
index eec6cfcab7..b66d723a1a 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherService.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherService.java
@@ -39,7 +39,7 @@ public interface APIPublisherService {
/**
* Add default scopes defined in the cdm-config.xml
*/
- void addDefaultScopesIfNotExist();
+ void addDefaultScopesIfNotExist() throws APIManagerPublisherException;
/**
* If the permissions are in the permission list, identify the relevant scopes of the supplied permission list
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java
index 9bca7c5143..82bc8abed7 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/APIPublisherServiceImpl.java
@@ -18,18 +18,24 @@
package io.entgra.device.mgt.core.apimgt.webapp.publisher;
import com.google.gson.Gson;
-import io.entgra.device.mgt.core.apimgt.annotations.Scopes;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices;
-import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServicesImpl;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServices;
-import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServicesImpl;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.constants.Constants;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey;
-import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.*;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIInfo;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIRevision;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.APIRevisionDeployment;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.CORSConfiguration;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.Documentation;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.Mediation;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.MediationPolicy;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.Operations;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.Scope;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException;
import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIPublisherUtils;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.config.WebappPublisherConfig;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiScope;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.dto.ApiUriTemplate;
@@ -43,7 +49,6 @@ import io.entgra.device.mgt.core.device.mgt.core.config.permission.ScopeMapping;
import org.apache.commons.lang.StringUtils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-import org.json.JSONArray;
import org.json.JSONObject;
import org.wso2.carbon.CarbonConstants;
import org.wso2.carbon.apimgt.api.APIManagementException;
@@ -62,6 +67,7 @@ import org.wso2.carbon.user.core.tenant.Tenant;
import org.wso2.carbon.user.core.tenant.TenantSearchResult;
import org.wso2.carbon.utils.CarbonUtils;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
import java.io.BufferedReader;
import java.io.File;
@@ -100,21 +106,10 @@ public class APIPublisherServiceImpl implements APIPublisherService {
RealmService realmService = (RealmService) PrivilegedCarbonContext.getThreadLocalCarbonContext()
.getOSGiService(RealmService.class, null);
- APIApplicationServices apiApplicationServices = new APIApplicationServicesImpl();
+ APIApplicationServices apiApplicationServices = APIPublisherDataHolder.getInstance().getApiApplicationServices();
+ PublisherRESTAPIServices publisherRESTAPIServices = APIPublisherDataHolder.getInstance().getPublisherRESTAPIServices();
APIApplicationKey apiApplicationKey;
AccessTokenInfo accessTokenInfo;
- try {
- apiApplicationKey = apiApplicationServices.createAndRetrieveApplicationCredentials(
- "ClientForPublisherRestCalls",
- "client_credentials password refresh_token"
- );
- accessTokenInfo = apiApplicationServices.generateAccessTokenFromRegisteredApplication(
- apiApplicationKey.getClientId(), apiApplicationKey.getClientSecret());
- } catch (APIServicesException e) {
- String errorMsg = "Error occurred while generating the API application";
- log.error(errorMsg, e);
- throw new APIManagerPublisherException(e);
- }
try {
boolean tenantFound = false;
@@ -149,6 +144,19 @@ public class APIPublisherServiceImpl implements APIPublisherService {
PrivilegedCarbonContext.getThreadLocalCarbonContext().setUsername(apiConfig.getOwner());
int tenantId = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId();
+ try {
+ APIPublisherUtils.createScopePublishUserIfNotExists(tenantDomain);
+ apiApplicationKey = apiApplicationServices.createAndRetrieveApplicationCredentials(
+ "ClientForPublisherRestCalls",
+ "client_credentials password refresh_token");
+ accessTokenInfo = apiApplicationServices.generateAccessTokenFromRegisteredApplication(
+ apiApplicationKey.getClientId(), apiApplicationKey.getClientSecret());
+ } catch (APIServicesException e) {
+ String errorMsg = "Error occurred while generating the API application";
+ log.error(errorMsg, e);
+ throw new APIManagerPublisherException(e);
+ }
+
try {
apiConfig.setOwner(APIUtil.getTenantAdminUserName(tenantDomain));
apiConfig.setTenantDomain(tenantDomain);
@@ -156,7 +164,6 @@ public class APIPublisherServiceImpl implements APIPublisherService {
APIIdentifier apiIdentifier = new APIIdentifier(APIUtil.replaceEmailDomain(apiConfig.getOwner()),
apiConfig.getName(), apiConfig.getVersion());
- PublisherRESTAPIServices publisherRESTAPIServices = new PublisherRESTAPIServicesImpl();
APIInfo[] apiList = publisherRESTAPIServices.getApis(apiApplicationKey, accessTokenInfo);
boolean apiFound = false;
for (int i = 0; i < apiList.length; i++) {
@@ -378,6 +385,7 @@ public class APIPublisherServiceImpl implements APIPublisherService {
log.error(msg, e);
throw new APIManagerPublisherException(e);
} finally {
+ APIPublisherUtils.removeScopePublishUserIfExists(tenantDomain);
PrivilegedCarbonContext.endTenantFlow();
}
}
@@ -417,39 +425,55 @@ public class APIPublisherServiceImpl implements APIPublisherService {
}
}
- public void addDefaultScopesIfNotExist() {
+ @Override
+ public void addDefaultScopesIfNotExist() throws APIManagerPublisherException {
+ WebappPublisherConfig config = WebappPublisherConfig.getInstance();
+ List tenants = new ArrayList<>(Collections.singletonList(APIConstants.SUPER_TENANT_DOMAIN));
+ tenants.addAll(config.getTenants().getTenant());
+
DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
DefaultPermissions defaultPermissions = deviceManagementConfig.getDefaultPermissions();
- APIApplicationServices apiApplicationServices = new APIApplicationServicesImpl();
- try {
- APIApplicationKey apiApplicationKey = apiApplicationServices.createAndRetrieveApplicationCredentials(
- "ClientForPublisherRestCalls",
- "client_credentials password refresh_token"
- );
- AccessTokenInfo accessTokenInfo =
- apiApplicationServices.generateAccessTokenFromRegisteredApplication(
- apiApplicationKey.getClientId(), apiApplicationKey.getClientSecret());
+ APIApplicationServices apiApplicationServices = APIPublisherDataHolder.getInstance().getApiApplicationServices();
+ PublisherRESTAPIServices publisherRESTAPIServices = APIPublisherDataHolder.getInstance().getPublisherRESTAPIServices();
- PublisherRESTAPIServices publisherRESTAPIServices = new PublisherRESTAPIServicesImpl();
+ for (String tenantDomain : tenants) {
+ try {
+ PrivilegedCarbonContext.startTenantFlow();
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
- Scope scope = new Scope();
- for (DefaultPermission defaultPermission: defaultPermissions.getDefaultPermissions()) {
- if (!publisherRESTAPIServices.isSharedScopeNameExists(apiApplicationKey, accessTokenInfo,
- defaultPermission.getScopeMapping().getKey())) {
- ScopeMapping scopeMapping = defaultPermission.getScopeMapping();
+ APIPublisherUtils.createScopePublishUserIfNotExists(tenantDomain);
+ APIApplicationKey apiApplicationKey =
+ apiApplicationServices.createAndRetrieveApplicationCredentials(
+ "ClientForPublisherRestCalls", "client_credentials password refresh_token"
+ );
+ AccessTokenInfo accessTokenInfo =
+ apiApplicationServices.generateAccessTokenFromRegisteredApplication(
+ apiApplicationKey.getClientId(), apiApplicationKey.getClientSecret());
- List bindings = new ArrayList<>(
- Arrays.asList(scopeMapping.getDefaultRoles().split(",")));
- bindings.add(ADMIN_ROLE_KEY);
- scope.setName(scopeMapping.getKey());
- scope.setDescription(scopeMapping.getName());
- scope.setDisplayName(scopeMapping.getName());
- scope.setBindings(bindings);
- publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
+ Scope scope = new Scope();
+ for (DefaultPermission defaultPermission : defaultPermissions.getDefaultPermissions()) {
+ if (!publisherRESTAPIServices.isSharedScopeNameExists(apiApplicationKey, accessTokenInfo,
+ defaultPermission.getScopeMapping().getKey())) {
+ ScopeMapping scopeMapping = defaultPermission.getScopeMapping();
+
+ List bindings = new ArrayList<>(
+ Arrays.asList(scopeMapping.getDefaultRoles().split(",")));
+ bindings.add(ADMIN_ROLE_KEY);
+ scope.setName(scopeMapping.getKey());
+ scope.setDescription(scopeMapping.getName());
+ scope.setDisplayName(scopeMapping.getName());
+ scope.setBindings(bindings);
+ publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
+ }
}
+ } catch (BadRequestException | UnexpectedResponseException | APIServicesException e) {
+ String errorMsg = "Error occurred while adding default scopes";
+ log.error(errorMsg, e);
+ throw new APIManagerPublisherException(e);
+ } finally {
+ APIPublisherUtils.removeScopePublishUserIfExists(tenantDomain);
+ PrivilegedCarbonContext.endTenantFlow();
}
- } catch (BadRequestException | UnexpectedResponseException | APIServicesException e) {
- log.error("Error occurred while adding default scopes");
}
}
@@ -462,31 +486,32 @@ public class APIPublisherServiceImpl implements APIPublisherService {
List tenants = new ArrayList<>(Collections.singletonList(APIConstants.SUPER_TENANT_DOMAIN));
tenants.addAll(config.getTenants().getTenant());
- APIApplicationServices apiApplicationServices = new APIApplicationServicesImpl();
+ APIApplicationServices apiApplicationServices = APIPublisherDataHolder.getInstance().getApiApplicationServices();
+ PublisherRESTAPIServices publisherRESTAPIServices = APIPublisherDataHolder.getInstance().getPublisherRESTAPIServices();
+
APIApplicationKey apiApplicationKey;
AccessTokenInfo accessTokenInfo;
- try {
- apiApplicationKey = apiApplicationServices.createAndRetrieveApplicationCredentials(
- "ClientForPublisherRestCalls",
- "client_credentials password refresh_token"
- );
- accessTokenInfo = apiApplicationServices.generateAccessTokenFromRegisteredApplication(
- apiApplicationKey.getClientId(), apiApplicationKey.getClientSecret());
- } catch (APIServicesException e) {
- String errorMsg = "Error occurred while generating the API application";
- log.error(errorMsg, e);
- throw new APIManagerPublisherException(e);
- }
UserStoreManager userStoreManager;
+ String fileName = null;
- try {
- for (String tenantDomain : tenants) {
+ for (String tenantDomain : tenants) {
+ try {
PrivilegedCarbonContext.startTenantFlow();
PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
- PublisherRESTAPIServices publisherRESTAPIServices = new PublisherRESTAPIServicesImpl();
+ try {
+ APIPublisherUtils.createScopePublishUserIfNotExists(tenantDomain);
+ apiApplicationKey = apiApplicationServices.createAndRetrieveApplicationCredentials("ClientForPublisherRestCalls",
+ "client_credentials password refresh_token");
+ accessTokenInfo = apiApplicationServices.generateAccessTokenFromRegisteredApplication(
+ apiApplicationKey.getClientId(), apiApplicationKey.getClientSecret());
+ } catch (APIServicesException e) {
+ String errorMsg = "Error occurred while generating the API application";
+ log.error(errorMsg, e);
+ throw new APIManagerPublisherException(e);
+ }
try {
- String fileName =
+ fileName =
CarbonUtils.getCarbonConfigDirPath() + File.separator + "etc"
+ File.separator + tenantDomain + ".csv";
try {
@@ -576,33 +601,39 @@ public class APIPublisherServiceImpl implements APIPublisherService {
}
}
}
- } catch (IOException | DirectoryIteratorException ex) {
- log.error("failed to read scopes from file.", ex);
+ } catch (IOException | DirectoryIteratorException e) {
+ String errorMsg = "Failed to read scopes from file: '" + fileName + "'.";
+ log.error(errorMsg, e);
+ throw new APIManagerPublisherException(e);
}
+ } catch (APIServicesException e) {
+ String errorMsg = "Error while processing Publisher REST API response";
+ log.error(errorMsg, e);
+ throw new APIManagerPublisherException(e);
+ } catch (BadRequestException e) {
+ String errorMsg = "Error while calling Publisher REST APIs";
+ log.error(errorMsg, e);
+ throw new APIManagerPublisherException(e);
+ } catch (UnexpectedResponseException e) {
+ String errorMsg = "Unexpected response from the server";
+ log.error(errorMsg, e);
+ throw new APIManagerPublisherException(e);
+ } finally {
+ APIPublisherUtils.removeScopePublishUserIfExists(tenantDomain);
+ PrivilegedCarbonContext.endTenantFlow();
}
- } catch (APIServicesException e) {
- String errorMsg = "Error while processing Publisher REST API response";
- log.error(errorMsg, e);
- throw new APIManagerPublisherException(e);
- } catch (BadRequestException e) {
- String errorMsg = "Error while calling Publisher REST APIs";
- log.error(errorMsg, e);
- throw new APIManagerPublisherException(e);
- } catch (UnexpectedResponseException e) {
- String errorMsg = "Unexpected response from the server";
- log.error(errorMsg, e);
- throw new APIManagerPublisherException(e);
- } finally {
- PrivilegedCarbonContext.endTenantFlow();
}
}
@Override
public void updateScopeRoleMapping(String roleName, String[] permissions, String[] removedPermissions) throws APIManagerPublisherException {
- APIApplicationServices apiApplicationServices = new APIApplicationServicesImpl();
+ String tenantDomain = PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain();
+ APIApplicationServices apiApplicationServices = APIPublisherDataHolder.getInstance().getApiApplicationServices();
+ PublisherRESTAPIServices publisherRESTAPIServices = APIPublisherDataHolder.getInstance().getPublisherRESTAPIServices();
APIApplicationKey apiApplicationKey;
AccessTokenInfo accessTokenInfo;
try {
+ APIPublisherUtils.createScopePublishUserIfNotExists(tenantDomain);
apiApplicationKey = apiApplicationServices.createAndRetrieveApplicationCredentials(
"ClientForPublisherRestCalls",
"client_credentials password refresh_token"
@@ -616,7 +647,7 @@ public class APIPublisherServiceImpl implements APIPublisherService {
}
try {
- PublisherRESTAPIServices publisherRESTAPIServices = new PublisherRESTAPIServicesImpl();
+
Scope[] scopeList = publisherRESTAPIServices.getScopes(apiApplicationKey, accessTokenInfo);
Map permScopeMap = APIPublisherDataHolder.getInstance().getPermScopeMapping();
@@ -646,6 +677,8 @@ public class APIPublisherServiceImpl implements APIPublisherService {
String errorMsg = "Unexpected response from the server";
log.error(errorMsg, e);
throw new APIManagerPublisherException(errorMsg, e);
+ } finally {
+ APIPublisherUtils.removeScopePublishUserIfExists(tenantDomain);
}
}
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java
index 0d67edc7a9..4f8e5599bf 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherDataHolder.java
@@ -17,6 +17,8 @@
*/
package io.entgra.device.mgt.core.apimgt.webapp.publisher.internal;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServices;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIConfig;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.APIPublisherService;
import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.MetadataManagementService;
@@ -44,7 +46,8 @@ public class APIPublisherDataHolder {
private boolean isServerStarted;
private Stack unpublishedApis = new Stack<>();
private Map permScopeMapping;
-
+ private APIApplicationServices apiApplicationServices;
+ private PublisherRESTAPIServices publisherRESTAPIServices;
private MetadataManagementService metadataManagementService;
private static APIPublisherDataHolder thisInstance = new APIPublisherDataHolder();
@@ -145,9 +148,29 @@ public class APIPublisherDataHolder {
this.unpublishedApis = unpublishedApis;
}
- public Map getPermScopeMapping() {return permScopeMapping;}
+ public Map getPermScopeMapping() {
+ return permScopeMapping;
+ }
+
+ public void setPermScopeMapping(Map permScopeMapping) {
+ this.permScopeMapping = permScopeMapping;
+ }
+
+ public APIApplicationServices getApiApplicationServices() {
+ return apiApplicationServices;
+ }
- public void setPermScopeMapping(Map permScopeMapping) {this.permScopeMapping = permScopeMapping;}
+ public void setApiApplicationServices(APIApplicationServices apiApplicationServices) {
+ this.apiApplicationServices = apiApplicationServices;
+ }
+
+ public PublisherRESTAPIServices getPublisherRESTAPIServices() {
+ return publisherRESTAPIServices;
+ }
+
+ public void setPublisherRESTAPIServices(PublisherRESTAPIServices publisherRESTAPIServices) {
+ this.publisherRESTAPIServices = publisherRESTAPIServices;
+ }
public MetadataManagementService getMetadataManagementService() {
return metadataManagementService;
diff --git a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java
index d2aa464136..a3814ddbf1 100644
--- a/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java
+++ b/components/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher/src/main/java/io/entgra/device/mgt/core/apimgt/webapp/publisher/internal/APIPublisherServiceComponent.java
@@ -17,6 +17,8 @@
*/
package io.entgra.device.mgt.core.apimgt.webapp.publisher.internal;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServices;
import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.MetadataManagementService;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -120,6 +122,46 @@ public class APIPublisherServiceComponent {
APIPublisherDataHolder.getInstance().setRegistryService(null);
}
+ @Reference(
+ name = "APIM.application.service",
+ service = io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices.class,
+ cardinality = ReferenceCardinality.MANDATORY,
+ policy = ReferencePolicy.DYNAMIC,
+ unbind = "unsetAPIApplicationServices")
+ protected void setAPIApplicationServices(APIApplicationServices apiApplicationServices) {
+ if (log.isDebugEnabled()) {
+ log.debug("Setting DCR REST API Service");
+ }
+ APIPublisherDataHolder.getInstance().setApiApplicationServices(apiApplicationServices);
+ }
+
+ protected void unsetAPIApplicationServices(APIApplicationServices apiApplicationServices) {
+ if (log.isDebugEnabled()) {
+ log.debug("Unsetting DCR REST API Service");
+ }
+ APIPublisherDataHolder.getInstance().setApiApplicationServices(null);
+ }
+
+ @Reference(
+ name = "APIM.publisher.service",
+ service = io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServices.class,
+ cardinality = ReferenceCardinality.MANDATORY,
+ policy = ReferencePolicy.DYNAMIC,
+ unbind = "unsetPublisherRESTAPIServices")
+ protected void setPublisherRESTAPIServices(PublisherRESTAPIServices publisherRESTAPIServices) {
+ if (log.isDebugEnabled()) {
+ log.debug("Setting APIM Publisher REST API Service");
+ }
+ APIPublisherDataHolder.getInstance().setPublisherRESTAPIServices(publisherRESTAPIServices);
+ }
+
+ protected void unsetPublisherRESTAPIServices(PublisherRESTAPIServices publisherRESTAPIServices) {
+ if (log.isDebugEnabled()) {
+ log.debug("Unsetting APIM Publisher REST API Service");
+ }
+ APIPublisherDataHolder.getInstance().setPublisherRESTAPIServices(null);
+ }
+
@Reference(
name = "io.entgra.meta.mgt",
service = io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.MetadataManagementService.class,
diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml
index 573b77b2e6..57ca6e06bc 100644
--- a/components/apimgt-extensions/pom.xml
+++ b/components/apimgt-extensions/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/pom.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/pom.xml
index 5c718e6181..8f8b82d644 100644
--- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/pom.xml
+++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.common/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
application-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml
index 3fdf600029..79305be683 100644
--- a/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml
+++ b/components/application-mgt/io.entgra.device.mgt.core.application.mgt.core/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
application-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/application-mgt/pom.xml b/components/application-mgt/pom.xml
index 67c385a6b8..90f0f8b4d6 100644
--- a/components/application-mgt/pom.xml
+++ b/components/application-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/pom.xml b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/pom.xml
index 8f37e5aaf1..6d697f1055 100644
--- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/pom.xml
+++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api/pom.xml
@@ -22,7 +22,7 @@
certificate-mgt
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/pom.xml
index c8ebd59888..3028055556 100644
--- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/pom.xml
+++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api/pom.xml
@@ -22,7 +22,7 @@
certificate-mgt
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/pom.xml b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/pom.xml
index 93e1b7a4c9..d18a805230 100644
--- a/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/pom.xml
+++ b/components/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.core/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
certificate-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml
index 65b7dc46b3..b51f5791d0 100644
--- a/components/certificate-mgt/pom.xml
+++ b/components/certificate-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/pom.xml
index 581401d209..d6c7d5a593 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/pom.xml
index 4475d70cae..ba7d870b37 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger/pom.xml
index 2697feeeca..149420b0c2 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger/pom.xml
@@ -21,7 +21,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/pom.xml
index 4e719f97c7..0a3a92a5a5 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.pull.notification/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/pom.xml
index ba8d4dd3ee..d638dcd0c5 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/pom.xml
index 4dd8717b42..5339ffbd22 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
index 37222adccf..76b680cabc 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
index 942c8da6e2..3db7d6248d 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/pom.xml
index f6dd2150c1..68097222fc 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.userstore.role.mapper/pom.xml b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.userstore.role.mapper/pom.xml
index cd3dddadc0..570889c3b9 100644
--- a/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.userstore.role.mapper/pom.xml
+++ b/components/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.userstore.role.mapper/pom.xml
@@ -22,7 +22,7 @@
device-mgt-extensions
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml
index fc31f7123e..2d371c5054 100644
--- a/components/device-mgt-extensions/pom.xml
+++ b/components/device-mgt-extensions/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/pom.xml
index 49c7ddc959..8c1dba0452 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/pom.xml
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/pom.xml
@@ -22,7 +22,7 @@
device-mgt
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/UserManagementService.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/UserManagementService.java
index 81185f3236..6538913292 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/UserManagementService.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/api/UserManagementService.java
@@ -952,7 +952,7 @@ public interface UserManagementService {
tags = "User Management",
extensions = {
@Extension(properties = {
- @ExtensionProperty(name = Constants.SCOPE, value = "perm:users:send-invitation")
+ @ExtensionProperty(name = Constants.SCOPE, value = "um:users:invite")
})
}
)
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java
index 7912c72441..df6d2e2c3d 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImpl.java
@@ -18,6 +18,21 @@
package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl;
+import com.google.gson.Gson;
+import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroup;
+import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupConstants;
+import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceGroupRoleWrapper;
+import io.entgra.device.mgt.core.device.mgt.common.group.mgt.DeviceTypesOfGroups;
+import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupAlreadyExistException;
+import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException;
+import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupNotExistException;
+import io.entgra.device.mgt.core.device.mgt.common.group.mgt.RoleDoesNotExistException;
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger;
+import io.entgra.device.mgt.core.notification.logger.GroupMgtLogContext;
+import io.entgra.device.mgt.core.notification.logger.impl.EntgraGroupMgtLoggerImpl;
+import org.wso2.carbon.CarbonConstants;
+import org.wso2.carbon.context.CarbonContext;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceGroupList;
import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceList;
import io.entgra.device.mgt.core.device.mgt.api.jaxrs.beans.DeviceToGroupsAssignment;
@@ -57,7 +72,8 @@ import java.util.List;
public class GroupManagementServiceImpl implements GroupManagementService {
- private static final Log log = LogFactory.getLog(GroupManagementServiceImpl.class);
+ GroupMgtLogContext.Builder groupMgtContextBuilder = new GroupMgtLogContext.Builder();
+ private static final EntgraLogger log = new EntgraGroupMgtLoggerImpl(GroupManagementServiceImpl.class);
private static final String DEFAULT_ADMIN_ROLE = "admin";
private static final String[] DEFAULT_ADMIN_PERMISSIONS = {"/permission/device-mgt/admin/groups",
@@ -161,6 +177,8 @@ public class GroupManagementServiceImpl implements GroupManagementService {
@Override
public Response createGroup(DeviceGroup group) {
+ String tenantId = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
String owner = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (group == null) {
return Response.status(Response.Status.BAD_REQUEST).build();
@@ -169,6 +187,22 @@ public class GroupManagementServiceImpl implements GroupManagementService {
group.setStatus(DeviceGroupConstants.GroupStatus.ACTIVE);
try {
DeviceMgtAPIUtils.getGroupManagementProviderService().createGroup(group, DEFAULT_ADMIN_ROLE, DEFAULT_ADMIN_PERMISSIONS);
+ int deviceCount = DeviceMgtAPIUtils.getGroupManagementProviderService().getDeviceCount(group.getGroupId());
+ String stringDevices = new Gson().toJson(DeviceMgtAPIUtils.getGroupManagementProviderService().getAllDevicesOfGroup(group.getName(), false));
+ log.info(
+ "Group " + group.getName() + " created",
+ groupMgtContextBuilder
+ .setActionTag("ADD_GROUP")
+ .setGroupId(String.valueOf(group.getGroupId()))
+ .setName(group.getName())
+ .setOwner(group.getOwner())
+ .setDeviceCount(String.valueOf(deviceCount))
+ .setDevices(stringDevices)
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(owner)
+ .build()
+ );
return Response.status(Response.Status.CREATED).build();
} catch (GroupManagementException e) {
String msg = "Error occurred while adding new group.";
@@ -218,11 +252,30 @@ public class GroupManagementServiceImpl implements GroupManagementService {
@Override
public Response updateGroup(int groupId, DeviceGroup deviceGroup) {
+ String tenantId = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ String username = CarbonContext.getThreadLocalCarbonContext().getUsername();
if (deviceGroup == null) {
return Response.status(Response.Status.BAD_REQUEST).build();
}
try {
DeviceMgtAPIUtils.getGroupManagementProviderService().updateGroup(deviceGroup, groupId);
+ int deviceCount = DeviceMgtAPIUtils.getGroupManagementProviderService().getDeviceCount(groupId);
+ String stringDevices = new Gson().toJson(DeviceMgtAPIUtils.getGroupManagementProviderService().getAllDevicesOfGroup(deviceGroup.getName(), false));
+ log.info(
+ "Group " + deviceGroup.getName() + " updated",
+ groupMgtContextBuilder
+ .setActionTag("UPDATE_GROUP")
+ .setGroupId(String.valueOf(deviceGroup.getGroupId()))
+ .setName(deviceGroup.getName())
+ .setOwner(deviceGroup.getOwner())
+ .setDeviceCount(String.valueOf(deviceCount))
+ .setDevices(stringDevices)
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(username)
+ .build()
+ );
return Response.status(Response.Status.OK).build();
} catch (GroupManagementException e) {
String msg = "Error occurred while adding new group.";
@@ -242,7 +295,20 @@ public class GroupManagementServiceImpl implements GroupManagementService {
@Override
public Response deleteGroup(int groupId, boolean isDeleteChildren) {
try {
+ String tenantId = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ String username = CarbonContext.getThreadLocalCarbonContext().getUsername();
if (DeviceMgtAPIUtils.getGroupManagementProviderService().deleteGroup(groupId, isDeleteChildren)) {
+ log.info(
+ "Group with group id " + groupId + " deleted",
+ groupMgtContextBuilder
+ .setActionTag("DELETE_GROUP")
+ .setGroupId(String.valueOf(groupId))
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(username)
+ .build()
+ );
return Response.status(Response.Status.OK).build();
} else {
return Response.status(Response.Status.NOT_FOUND).entity("Group not found.").build();
@@ -328,17 +394,36 @@ public class GroupManagementServiceImpl implements GroupManagementService {
@Override
public Response addDevicesToGroup(int groupId, List deviceIdentifiers) {
try {
+ String tenantId = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ String username = CarbonContext.getThreadLocalCarbonContext().getUsername();
DeviceMgtAPIUtils.getGroupManagementProviderService().addDevices(groupId, deviceIdentifiers);
PolicyAdministratorPoint pap = DeviceMgtAPIUtils.getPolicyManagementService().getPAP();
DeviceManagementProviderService dms = DeviceMgtAPIUtils.getDeviceManagementService();
+ List devices = new ArrayList<>();
for(DeviceIdentifier deviceIdentifier : deviceIdentifiers) {
Device device = dms.getDevice(deviceIdentifier, false);
+ devices.add(device);
if(!device.getEnrolmentInfo().getStatus().equals(EnrolmentInfo.Status.REMOVED)) {
pap.removePolicyUsed(deviceIdentifier);
DeviceMgtAPIUtils.getPolicyManagementService().getEffectivePolicy(deviceIdentifier);
}
}
pap.publishChanges();
+ int deviceCount = DeviceMgtAPIUtils.getGroupManagementProviderService().getDeviceCount(groupId);
+ String stringDevices = new Gson().toJson(devices);
+ log.info(
+ "Devices added for group id " + groupId,
+ groupMgtContextBuilder
+ .setActionTag("ADD_DEVICES")
+ .setGroupId(String.valueOf(groupId))
+ .setDeviceCount(String.valueOf(deviceCount))
+ .setDevices(stringDevices)
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(username)
+ .build()
+ );
return Response.status(Response.Status.OK).build();
} catch (GroupManagementException e) {
String msg = "Error occurred while adding devices to group.";
@@ -460,6 +545,9 @@ public class GroupManagementServiceImpl implements GroupManagementService {
@Path("/roles/share")
@Override
public Response createGroupWithRoles(DeviceGroupRoleWrapper groups) {
+ String tenantId = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ String username = PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername();
if (groups == null) {
return Response.status(Response.Status.BAD_REQUEST).build();
}
@@ -471,6 +559,22 @@ public class GroupManagementServiceImpl implements GroupManagementService {
PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername().isEmpty());
if (group != null) {
DeviceMgtAPIUtils.getGroupManagementProviderService().manageGroupSharing(group.getGroupId(), groups.getUserRoles());
+ int deviceCount = DeviceMgtAPIUtils.getGroupManagementProviderService().getDeviceCount(group.getGroupId());
+ String stringDevices = new Gson().toJson(DeviceMgtAPIUtils.getGroupManagementProviderService().getAllDevicesOfGroup(group.getName(), false));
+ log.info(
+ "Group " + group.getName() + " created",
+ groupMgtContextBuilder
+ .setActionTag("ADD_GROUP")
+ .setGroupId(String.valueOf(group.getGroupId()))
+ .setName(group.getName())
+ .setOwner(group.getOwner())
+ .setDeviceCount(String.valueOf(deviceCount))
+ .setDevices(stringDevices)
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(username)
+ .build()
+ );
return Response.status(Response.Status.CREATED).entity(group.getGroupId()).build();
} else {
String msg = "Error occurred while retrieving newly created group.";
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RoleManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RoleManagementServiceImpl.java
index 7790b5f913..a568035d4b 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RoleManagementServiceImpl.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/RoleManagementServiceImpl.java
@@ -17,17 +17,19 @@
*/
package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl;
+import com.google.gson.Gson;
import io.entgra.device.mgt.core.apimgt.webapp.publisher.exception.APIManagerPublisherException;
import com.google.common.base.Strings;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException;
import io.entgra.device.mgt.core.device.mgt.common.group.mgt.GroupManagementException;
import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata;
-import org.apache.commons.logging.Log;
import org.json.simple.JSONObject;
import org.json.simple.parser.JSONParser;
import org.json.simple.parser.ParseException;
-import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.CarbonConstants;
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger;
+import io.entgra.device.mgt.core.notification.logger.RoleMgtLogContext;
+import io.entgra.device.mgt.core.notification.logger.impl.EntgraRoleMgtLoggerImpl;
import org.wso2.carbon.base.MultitenantConstants;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
@@ -88,7 +90,8 @@ import static io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.Constants.PRIM
public class RoleManagementServiceImpl implements RoleManagementService {
private static final String API_BASE_PATH = "/roles";
- private static final Log log = LogFactory.getLog(RoleManagementServiceImpl.class);
+ RoleMgtLogContext.Builder roleMgtContextBuilder = new RoleMgtLogContext.Builder();
+ private static final EntgraLogger log = new EntgraRoleMgtLoggerImpl(RoleManagementServiceImpl.class);
@GET
@Override
@@ -425,6 +428,9 @@ public class RoleManagementServiceImpl implements RoleManagementService {
RequestValidationUtil.validateRoleDetails(roleInfo);
RequestValidationUtil.validateRoleName(roleInfo.getRoleName());
try {
+ String tenantId = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ String userName = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername());
UserStoreManager userStoreManager = DeviceMgtAPIUtils.getUserStoreManager();
if (log.isDebugEnabled()) {
log.debug("Persisting the role in the underlying user store");
@@ -450,7 +456,19 @@ public class RoleManagementServiceImpl implements RoleManagementService {
log.error(msg, e);
return Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity(msg).build();
}
-
+ String stringUsers = new Gson().toJson(roleInfo.getUsers());
+ log.info(
+ "Role " + roleInfo.getRoleName().split("/")[1] + " created",
+ roleMgtContextBuilder
+ .setActionTag("ADD_ROLE")
+ .setUserStoreDomain(roleInfo.getRoleName().split("/")[0])
+ .setRoleName(roleInfo.getRoleName().split("/")[1])
+ .setUsers(stringUsers)
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(userName)
+ .build()
+ );
//TODO fix what's returned in the entity
return Response.created(new URI(API_BASE_PATH + "/" + URLEncoder.encode(roleInfo.getRoleName(), "UTF-8"))).
entity("Role '" + roleInfo.getRoleName() + "' has " + "successfully been"
@@ -556,6 +574,9 @@ public class RoleManagementServiceImpl implements RoleManagementService {
RequestValidationUtil.validateRoleName(roleName);
RequestValidationUtil.validateRoleDetails(roleInfo);
try {
+ String tenantId = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ String userName = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername());
final UserRealm userRealm = DeviceMgtAPIUtils.getUserRealm();
final UserStoreManager userStoreManager = userRealm.getUserStoreManager();
if (!userStoreManager.isExistingRole(roleName)) {
@@ -587,6 +608,19 @@ public class RoleManagementServiceImpl implements RoleManagementService {
String[] roleDetails = roleName.split("/");
updatePermissions(roleDetails[roleDetails.length - 1], roleInfo, userRealm);
}
+ String stringUsers = new Gson().toJson(roleInfo.getUsers());
+ log.info(
+ "Role " + roleInfo.getRoleName().split("/")[1] + " updated",
+ roleMgtContextBuilder
+ .setActionTag("UPDATE_ROLE")
+ .setUserStoreDomain(roleInfo.getRoleName().split("/")[0])
+ .setRoleName(roleInfo.getRoleName().split("/")[1])
+ .setUsers(stringUsers)
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(userName)
+ .build()
+ );
//TODO: Need to send the updated role information in the entity back to the client
return Response.status(Response.Status.OK).entity("Role '" + roleInfo.getRoleName() + "' has " +
"successfully been updated").build();
@@ -622,6 +656,8 @@ public class RoleManagementServiceImpl implements RoleManagementService {
}
RequestValidationUtil.validateRoleName(roleName);
try {
+ String tenantDomain = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ String userName = String.valueOf(PrivilegedCarbonContext.getThreadLocalCarbonContext().getUsername());
final UserRealm userRealm = DeviceMgtAPIUtils.getUserRealm();
final UserStoreManager userStoreManager = userRealm.getUserStoreManager();
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
@@ -635,6 +671,17 @@ public class RoleManagementServiceImpl implements RoleManagementService {
log.debug("Deleting the role in user store");
}
DeviceMgtAPIUtils.getGroupManagementProviderService().deleteRoleAndRoleGroupMapping(roleName, roleToDelete, tenantId, userStoreManager, authorizationManager);
+ log.info(
+ "Role " + roleName.split("/")[1] + " deleted",
+ roleMgtContextBuilder
+ .setActionTag("DELETE_ROLE")
+ .setUserStoreDomain(userStoreName)
+ .setRoleName(roleName.split("/")[1])
+ .setTenantID(String.valueOf(tenantId))
+ .setTenantDomain(tenantDomain)
+ .setUserName(userName)
+ .build()
+ );
return Response.status(Response.Status.OK).build();
} catch (UserStoreException e) {
String msg = "Error occurred while deleting the role '" + roleName + "'";
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java
index 7d86ef1d2e..efdefef7a4 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImpl.java
@@ -17,11 +17,13 @@
*/
package io.entgra.device.mgt.core.device.mgt.api.jaxrs.service.impl;
+import com.google.gson.Gson;
import com.google.gson.JsonArray;
import com.google.gson.JsonObject;
import org.apache.commons.lang.StringUtils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger;
+import io.entgra.device.mgt.core.notification.logger.UserMgtLogContext;
+import io.entgra.device.mgt.core.notification.logger.impl.EntgraUserMgtLoggerImpl;
import org.apache.http.HttpStatus;
import org.eclipse.wst.common.uriresolver.internal.util.URIEncoder;
import org.wso2.carbon.context.CarbonContext;
@@ -104,7 +106,8 @@ public class UserManagementServiceImpl implements UserManagementService {
private static final String ROLE_EVERYONE = "Internal/everyone";
private static final String API_BASE_PATH = "/users";
- private static final Log log = LogFactory.getLog(UserManagementServiceImpl.class);
+ UserMgtLogContext.Builder userMgtContextBuilder = new UserMgtLogContext.Builder();
+ private static final EntgraLogger log = new EntgraUserMgtLoggerImpl(UserManagementServiceImpl.class);
// Permissions that are given for a normal device user.
private static final Permission[] PERMISSIONS_FOR_DEVICE_USER = {
@@ -149,7 +152,10 @@ public class UserManagementServiceImpl implements UserManagementService {
if (log.isDebugEnabled()) {
log.debug("User '" + userInfo.getUsername() + "' has successfully been added.");
}
-
+ String tenantId = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ String loggeduserName = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getUsername());
+ String stringRoles = new Gson().toJson(userInfo.getRoles());
BasicUserInfo createdUserInfo = this.getBasicUserInfo(userInfo.getUsername());
// Outputting debug message upon successful retrieval of user
if (log.isDebugEnabled()) {
@@ -164,6 +170,20 @@ public class UserManagementServiceImpl implements UserManagementService {
props.setProperty("last-name", userInfo.getLastname());
props.setProperty("username", username);
props.setProperty("password", initialUserPassword);
+ log.info(
+ "User " + username + " created",
+ userMgtContextBuilder
+ .setActionTag("ADD_USER")
+ .setUserStoreDomain(userInfo.getUsername().split("/")[0])
+ .setFirstName(userInfo.getFirstname())
+ .setLastName(userInfo.getLastname())
+ .setEmail(userInfo.getEmailAddress())
+ .setUserRoles(stringRoles)
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(loggeduserName)
+ .build()
+ );
EmailMetaInfo metaInfo = new EmailMetaInfo(recipient, props);
BasicUserInfoWrapper userInfoWrapper = new BasicUserInfoWrapper();
@@ -238,6 +258,9 @@ public class UserManagementServiceImpl implements UserManagementService {
username = domain + '/' + username;
}
try {
+ String tenantId = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
+ String loggeduserName = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getUsername());
UserStoreManager userStoreManager = DeviceMgtAPIUtils.getUserStoreManager();
if (!userStoreManager.isExistingUser(username)) {
if (log.isDebugEnabled()) {
@@ -284,6 +307,21 @@ public class UserManagementServiceImpl implements UserManagementService {
if (log.isDebugEnabled()) {
log.debug("User by username: " + username + " was successfully updated.");
}
+ String stringRoles = new Gson().toJson(newRoles);
+ log.info(
+ "User " + username + " updated",
+ userMgtContextBuilder
+ .setActionTag("UPDATE_USER")
+ .setUserStoreDomain(username.split("/")[0])
+ .setFirstName(userInfo.getFirstname())
+ .setLastName(userInfo.getLastname())
+ .setEmail(userInfo.getEmailAddress())
+ .setUserRoles(stringRoles)
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(loggeduserName)
+ .build()
+ );
BasicUserInfo updatedUserInfo = this.getBasicUserInfo(username);
return Response.ok().entity(updatedUserInfo).build();
@@ -317,6 +355,8 @@ public class UserManagementServiceImpl implements UserManagementService {
username = domain + '/' + username;
nameWithDomain = true;
}
+ String tenantId = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantId());
+ String tenantDomain = String.valueOf(CarbonContext.getThreadLocalCarbonContext().getTenantDomain());
try {
int deviceCount;
UserStoreManager userStoreManager = DeviceMgtAPIUtils.getUserStoreManager();
@@ -338,6 +378,16 @@ public class UserManagementServiceImpl implements UserManagementService {
if (log.isDebugEnabled()) {
log.debug("User '" + username + "' was successfully removed.");
}
+ log.info(
+ "User " + username + " removed",
+ userMgtContextBuilder
+ .setActionTag("REMOVE_USER")
+ .setUserStoreDomain(domain)
+ .setTenantID(tenantId)
+ .setTenantDomain(tenantDomain)
+ .setUserName(username)
+ .build()
+ );
return Response.status(Response.Status.OK).build();
} else {
String msg = "Before deleting this user, ensure there are no devices assigned to the user. You can either remove the devices or change their owner through an update enrollment operation.";
@@ -410,7 +460,8 @@ public class UserManagementServiceImpl implements UserManagementService {
userList = new ArrayList<>(users.size());
BasicUserInfo user;
for (String username : users) {
- if (Constants.APIM_RESERVED_USER.equals(username) || Constants.RESERVED_USER.equals(username)) {
+ if (Constants.APIM_RESERVED_USER.equals(username) || Constants.RESERVED_USER.equals(username) ||
+ Constants.SCOPE_PUBLISH_RESERVED_USER.equals(username)) {
continue;
}
user = getBasicUserInfo(username);
@@ -476,6 +527,7 @@ public class UserManagementServiceImpl implements UserManagementService {
if (commonUsers != null) {
commonUsers.remove(Constants.APIM_RESERVED_USER);
commonUsers.remove(Constants.RESERVED_USER);
+ commonUsers.remove(Constants.SCOPE_PUBLISH_RESERVED_USER);
}
if (!skipSearch(commonUsers) && StringUtils.isNotEmpty(firstName)) {
@@ -651,7 +703,8 @@ public class UserManagementServiceImpl implements UserManagementService {
userList = new ArrayList<>();
UserInfo user;
for (String username : users) {
- if (Constants.APIM_RESERVED_USER.equals(username) || Constants.RESERVED_USER.equals(username)) {
+ if (Constants.APIM_RESERVED_USER.equals(username) || Constants.RESERVED_USER.equals(username) ||
+ Constants.SCOPE_PUBLISH_RESERVED_USER.equals(username)) {
continue;
}
user = new UserInfo();
@@ -1219,17 +1272,17 @@ public class UserManagementServiceImpl implements UserManagementService {
}
private String getTemplateName(String deviceType, String prefix, String separator) throws NoSuchFileException {
- String templateName = deviceType + separator + prefix + ".vm";
+ String templateName = deviceType + separator + prefix;
List templatePathSegments =
- Arrays.asList(CarbonUtils.getCarbonHome(), "repository", "resources", "email-templates", templateName);
+ Arrays.asList(CarbonUtils.getCarbonHome(), "repository", "resources", "email-templates", templateName + ".vm");
File template = new File(String.join(File.separator, templatePathSegments));
if (template.exists()) {
return templateName;
}
- String defaultTemplateName = "default" + separator + prefix + ".vm";
+ String defaultTemplateName = "default" + separator + prefix;
List defaultTemplatePathSegments =
- Arrays.asList(CarbonUtils.getCarbonHome(), "repository", "resources", "email-templates", defaultTemplateName);
+ Arrays.asList(CarbonUtils.getCarbonHome(), "repository", "resources", "email-templates", defaultTemplateName + ".vm");
File defaultTemplate = new File(String.join(File.separator, defaultTemplatePathSegments));
if (defaultTemplate.exists()) {
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/Constants.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/Constants.java
index 75ba2cc322..eb718ea320 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/Constants.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/main/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/util/Constants.java
@@ -31,6 +31,7 @@ public class Constants {
public static final String USER_CLAIM_DEVICES = "http://wso2.org/claims/devices";
public static final String PRIMARY_USER_STORE = "PRIMARY";
public static final String APIM_RESERVED_USER = "apim_reserved_user";
+ public static final String SCOPE_PUBLISH_RESERVED_USER = "scope_publish_reserved_user";
public static final String RESERVED_USER = "reserved_user";
public static final String DEFAULT_STREAM_VERSION = "1.0.0";
public static final String SCOPE = "scope";
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImplTest.java
index 082f2757e3..8eadf18e5a 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImplTest.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/GroupManagementServiceImplTest.java
@@ -53,7 +53,7 @@ import java.util.List;
*/
@PowerMockIgnore({"javax.ws.rs.*", "org.apache.log4j.*", "javax.xml.parsers", "org.mockito.*"})
@SuppressStaticInitializationFor({"io.entgra.device.mgt.core.device.mgt.api.jaxrs.util.DeviceMgtAPIUtils",
- "org.wso2.carbon.context.PrivilegedCarbonContext"})
+ "org.wso2.carbon.context.CarbonContext", "org.wso2.carbon.context.PrivilegedCarbonContext"})
@PrepareForTest({DeviceMgtAPIUtils.class, CarbonContext.class})
public class GroupManagementServiceImplTest {
private GroupManagementService groupManagementService;
@@ -187,6 +187,12 @@ public class GroupManagementServiceImplTest {
public void testUpdateGroup() throws GroupManagementException, GroupNotExistException, GroupAlreadyExistException {
PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getGroupManagementProviderService"))
.toReturn(groupManagementProviderService);
+ CarbonContext carbonContext = Mockito.mock(CarbonContext.class, Mockito.RETURNS_MOCKS);
+ PowerMockito.stub(PowerMockito.method(CarbonContext.class, "getThreadLocalCarbonContext"))
+ .toReturn(carbonContext);
+ Mockito.when(carbonContext.getTenantId()).thenReturn(-1234);
+ Mockito.when(carbonContext.getUsername()).thenReturn("admin");
+ Mockito.when(carbonContext.getTenantDomain()).thenReturn("carbon.super");
DeviceGroup deviceGroup = new DeviceGroup();
deviceGroup.setGroupId(1);
Mockito.doNothing().when(groupManagementProviderService).updateGroup(deviceGroup, 1);
@@ -211,6 +217,12 @@ public class GroupManagementServiceImplTest {
public void testDeleteGroup() throws GroupManagementException {
PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getGroupManagementProviderService"))
.toReturn(groupManagementProviderService);
+ CarbonContext carbonContext = Mockito.mock(CarbonContext.class, Mockito.RETURNS_MOCKS);
+ PowerMockito.stub(PowerMockito.method(CarbonContext.class, "getThreadLocalCarbonContext"))
+ .toReturn(carbonContext);
+ Mockito.when(carbonContext.getTenantId()).thenReturn(-1234);
+ Mockito.when(carbonContext.getUsername()).thenReturn("admin");
+ Mockito.when(carbonContext.getTenantDomain()).thenReturn("carbon.super");
Mockito.doReturn(true).when(groupManagementProviderService).deleteGroup(1, false);
Mockito.doReturn(false).when(groupManagementProviderService).deleteGroup(2, false);
Mockito.doThrow(new GroupManagementException()).when(groupManagementProviderService).deleteGroup(3, false);
@@ -304,6 +316,12 @@ public class GroupManagementServiceImplTest {
.toReturn(policyManagerService);
PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService"))
.toReturn(deviceManagementProviderService);
+ CarbonContext carbonContext = Mockito.mock(CarbonContext.class, Mockito.RETURNS_MOCKS);
+ PowerMockito.stub(PowerMockito.method(CarbonContext.class, "getThreadLocalCarbonContext"))
+ .toReturn(carbonContext);
+ Mockito.when(carbonContext.getTenantId()).thenReturn(-1234);
+ Mockito.when(carbonContext.getUsername()).thenReturn("admin");
+ Mockito.when(carbonContext.getTenantDomain()).thenReturn("carbon.super");
List deviceIdentifiers = new ArrayList<>();
Mockito.doNothing().when(groupManagementProviderService).addDevices(1, deviceIdentifiers);
Mockito.doThrow(new GroupManagementException()).when(groupManagementProviderService).addDevices(2,
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImplTest.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImplTest.java
index ea6594d15b..911c85449c 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImplTest.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.api/src/test/java/io/entgra/device/mgt/core/device/mgt/api/jaxrs/service/impl/UserManagementServiceImplTest.java
@@ -115,6 +115,12 @@ public class UserManagementServiceImplTest {
PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService"))
.toReturn(this.deviceManagementProviderService);
Mockito.doReturn(true).when(userStoreManager).isExistingUser("admin");
+ CarbonContext carbonContext = Mockito.mock(CarbonContext.class, Mockito.RETURNS_MOCKS);
+ PowerMockito.stub(PowerMockito.method(CarbonContext.class, "getThreadLocalCarbonContext"))
+ .toReturn(carbonContext);
+ Mockito.when(carbonContext.getTenantId()).thenReturn(-1234);
+ Mockito.when(carbonContext.getUsername()).thenReturn("admin");
+ Mockito.when(carbonContext.getTenantDomain()).thenReturn("carbon.super");
Mockito.doAnswer(new Answer() {
private int count = 0;
@@ -170,6 +176,12 @@ public class UserManagementServiceImplTest {
public void testUpdateUser() throws UserStoreException {
PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getUserStoreManager"))
.toReturn(this.userStoreManager);
+ CarbonContext carbonContext = Mockito.mock(CarbonContext.class, Mockito.RETURNS_MOCKS);
+ PowerMockito.stub(PowerMockito.method(CarbonContext.class, "getThreadLocalCarbonContext"))
+ .toReturn(carbonContext);
+ Mockito.when(carbonContext.getTenantId()).thenReturn(-1234);
+ Mockito.when(carbonContext.getUsername()).thenReturn("admin");
+ Mockito.when(carbonContext.getTenantDomain()).thenReturn("carbon.super");
Response response = userManagementService.updateUser(TEST2_USERNAME, null, null);
Assert.assertEquals(response.getStatus(), Response.Status.NOT_FOUND.getStatusCode(),
"Non-existing user was successfully updated");
@@ -273,6 +285,11 @@ public class UserManagementServiceImplTest {
.toReturn(this.userStoreManager);
PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getDeviceManagementService"))
.toReturn(this.deviceManagementProviderService);
+ CarbonContext carbonContext = Mockito.mock(CarbonContext.class, Mockito.RETURNS_MOCKS);
+ PowerMockito.stub(PowerMockito.method(CarbonContext.class, "getThreadLocalCarbonContext"))
+ .toReturn(carbonContext);
+ Mockito.when(carbonContext.getTenantId()).thenReturn(-1234);
+ Mockito.when(carbonContext.getTenantDomain()).thenReturn("carbon.super");
Mockito.doReturn(0).when(deviceManagementProviderService).getDeviceCount(TEST_USERNAME);
Mockito.doNothing().when(userStoreManager).deleteUser(Mockito.anyString());
Response response = userManagementService.removeUser(TEST_USERNAME, null);
@@ -325,6 +342,12 @@ public class UserManagementServiceImplTest {
public void testNegativeScenarios2() throws UserStoreException {
PowerMockito.stub(PowerMockito.method(DeviceMgtAPIUtils.class, "getUserStoreManager"))
.toReturn(this.userStoreManager);
+ CarbonContext carbonContext = Mockito.mock(CarbonContext.class, Mockito.RETURNS_MOCKS);
+ PowerMockito.stub(PowerMockito.method(CarbonContext.class, "getThreadLocalCarbonContext"))
+ .toReturn(carbonContext);
+ Mockito.when(carbonContext.getTenantId()).thenReturn(-1234);
+ Mockito.when(carbonContext.getUsername()).thenReturn("admin");
+ Mockito.when(carbonContext.getTenantDomain()).thenReturn("carbon.super");
Mockito.doThrow(new UserStoreException()).when(userStoreManager).isExistingUser(TEST3_USERNAME);
Response response = userManagementService.getUser(TEST3_USERNAME, null, null);
Assert.assertEquals(response.getStatus(), Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(),
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/pom.xml
index baa54a177b..72332d067e 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/pom.xml
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.common/pom.xml
@@ -21,7 +21,7 @@
device-mgt
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/pom.xml
index 87e8df689f..a3e6022dc2 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/pom.xml
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.config.api/pom.xml
@@ -22,7 +22,7 @@
device-mgt
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
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 73fd55a96f..6021c98fb1 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
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
@@ -524,6 +524,10 @@
jaxb-impl
compile
+
+ io.entgra.device.mgt.core
+ io.entgra.device.mgt.core.apimgt.extension.rest.api
+
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementConstants.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementConstants.java
index 872b25205a..6fae7901d5 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementConstants.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/DeviceManagementConstants.java
@@ -124,6 +124,7 @@ public final class DeviceManagementConstants {
public static final String DEVICE_ENROLLMENT_MAIL_KEY = "enrollment";
public static final String TEMPLATE_NAME_PART_JOINER = "-";
public static final String ENROLLMENT_TYPE_SPLITTER = "_";
+ public static final String DOC_URL = "doc-url";
}
public static final class OperationAttributes {
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/metadata/mgt/MetaDataConfiguration.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/metadata/mgt/MetaDataConfiguration.java
index 1812862dd5..52cf65dbf7 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/metadata/mgt/MetaDataConfiguration.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/metadata/mgt/MetaDataConfiguration.java
@@ -18,6 +18,7 @@
package io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt;
+import io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.documentation.DocConfiguration;
import io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.whitelabel.WhiteLabelConfiguration;
import javax.xml.bind.annotation.XmlElement;
@@ -26,6 +27,7 @@ import javax.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "MetaDataConfiguration")
public class MetaDataConfiguration {
private WhiteLabelConfiguration whiteLabelConfiguration;
+ private DocConfiguration docConfiguration;
@XmlElement(name = "WhiteLabelConfiguration", required = true)
public WhiteLabelConfiguration getWhiteLabelConfiguration() {
@@ -35,4 +37,13 @@ public class MetaDataConfiguration {
public void setWhiteLabelConfiguration(WhiteLabelConfiguration whiteLabelConfiguration) {
this.whiteLabelConfiguration = whiteLabelConfiguration;
}
+
+ @XmlElement(name = "DocConfiguration", required = true)
+ public DocConfiguration getDocConfiguration() {
+ return docConfiguration;
+ }
+
+ public void setDocConfiguration(DocConfiguration docConfiguration) {
+ this.docConfiguration = docConfiguration;
+ }
}
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/metadata/mgt/documentation/DocConfiguration.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/metadata/mgt/documentation/DocConfiguration.java
new file mode 100644
index 0000000000..63a6981146
--- /dev/null
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/config/metadata/mgt/documentation/DocConfiguration.java
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2018 - 2024, 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.
+ */
+
+package io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.documentation;
+
+import javax.xml.bind.annotation.XmlElement;
+import javax.xml.bind.annotation.XmlRootElement;
+
+@XmlRootElement(name = "DocConfiguration")
+public class DocConfiguration {
+ private String docUrl;
+
+ @XmlElement(name = "DocUrl", required = true)
+ public String getDocUrl() {
+ return docUrl;
+ }
+
+ public void setDocUrl(String docUrl) {
+ this.docUrl = docUrl;
+ }
+}
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java
index c048bd4422..d3681a43c4 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/device/details/mgt/impl/DeviceInformationManagerImpl.java
@@ -442,8 +442,8 @@ public class DeviceInformationManagerImpl implements DeviceInformationManager {
if (deviceLocation != null) {
deviceDetailsDAO.deleteDeviceLocation(device.getId(), device.getEnrolmentInfo().getId());
} else {
- log.error("Device location not found for device: " + device.getId());
- throw new DeviceDetailsMgtException("Device location not found for device: " + device.getId());
+ log.warn("Unable to find location for device with ID " + device.getId() + ". Location deletion request cannot be processed.");
+ return;
}
DeviceManagementDAOFactory.commitTransaction();
} catch (TransactionManagementException e) {
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java
index c64d7dd7d4..969e3ad2d8 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/DeviceManagementDataHolder.java
@@ -18,6 +18,8 @@
package io.entgra.device.mgt.core.device.mgt.core.internal;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServices;
import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.DeviceStatusManagementService;
import io.entgra.device.mgt.core.server.bootup.heartbeat.beacon.service.HeartBeatManagementService;
import org.wso2.carbon.context.PrivilegedCarbonContext;
@@ -93,8 +95,9 @@ public class DeviceManagementDataHolder {
private MetadataManagementService metadataManagementService;
private WhiteLabelManagementService whiteLabelManagementService;
private TraccarManagementService traccarManagementService;
-
private DeviceStatusManagementService deviceStatusManagementService;
+ private APIApplicationServices apiApplicationServices;
+ private PublisherRESTAPIServices publisherRESTAPIServices;
private final Map deviceStatusTaskPluginConfigs = Collections.synchronizedMap(
new HashMap<>());
@@ -410,4 +413,38 @@ public class DeviceManagementDataHolder {
public void setTraccarManagementService(TraccarManagementService traccarManagementService) {
this.traccarManagementService = traccarManagementService;
}
+
+ /**
+ * Retrieves the Dynamic Client Registration REST API Service instance from OSGI service context.
+ * @return {@link APIApplicationServices} Dynamic Client Registration REST API Service
+ */
+ public APIApplicationServices getApiApplicationServices() {
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ apiApplicationServices = (APIApplicationServices) ctx.getOSGiService(APIApplicationServices.class, null);
+ if (apiApplicationServices == null) {
+ throw new IllegalStateException("Dynamic Client Registration REST API Service was not initialized.");
+ }
+ return apiApplicationServices;
+ }
+
+ public void setApiApplicationServices(APIApplicationServices apiApplicationServices) {
+ this.apiApplicationServices = apiApplicationServices;
+ }
+
+ /**
+ * Retrieves the API Manager Publisher REST API Service instance from OSGI service context.
+ * @return {@link PublisherRESTAPIServices} API Manager Publisher REST API Service
+ */
+ public PublisherRESTAPIServices getPublisherRESTAPIServices() {
+ PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
+ publisherRESTAPIServices = (PublisherRESTAPIServices) ctx.getOSGiService(PublisherRESTAPIServices.class, null);
+ if (publisherRESTAPIServices == null) {
+ throw new IllegalStateException("API Manager Publisher REST API Service was not initialized.");
+ }
+ return publisherRESTAPIServices;
+ }
+
+ public void setPublisherRESTAPIServices(PublisherRESTAPIServices publisherRESTAPIServices) {
+ this.publisherRESTAPIServices = publisherRESTAPIServices;
+ }
}
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/TenantCreateObserver.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/TenantCreateObserver.java
index 399e1d00a3..2aff8dcede 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/TenantCreateObserver.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/internal/TenantCreateObserver.java
@@ -17,21 +17,49 @@
*/
package io.entgra.device.mgt.core.device.mgt.core.internal;
-import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants;
-import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants.User;
+import com.google.gson.Gson;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.APIApplicationServices;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.PublisherRESTAPIServices;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.constants.Constants;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIApplicationKey;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.APIInfo.Scope;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.dto.AccessTokenInfo;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.APIServicesException;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.BadRequestException;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.exceptions.UnexpectedResponseException;
+import io.entgra.device.mgt.core.apimgt.extension.rest.api.util.APIPublisherUtils;
+import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataKeyAlreadyExistsException;
+import io.entgra.device.mgt.core.device.mgt.common.exceptions.MetadataManagementException;
+import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.Metadata;
+import io.entgra.device.mgt.core.device.mgt.common.metadata.mgt.MetadataManagementService;
import org.apache.axis2.context.ConfigurationContext;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.context.PrivilegedCarbonContext;
-import org.wso2.carbon.user.api.*;
+import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants;
+import io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants.User;
+import org.wso2.carbon.tenant.mgt.exception.TenantManagementException;
+import org.wso2.carbon.user.api.AuthorizationManager;
+import org.wso2.carbon.user.api.Permission;
+import org.wso2.carbon.user.api.UserRealm;
+import org.wso2.carbon.user.api.UserStoreException;
+import org.wso2.carbon.user.api.UserStoreManager;
import org.wso2.carbon.utils.AbstractAxis2ConfigurationContextObserver;
import org.wso2.carbon.utils.multitenancy.MultitenantConstants;
+import org.wso2.carbon.utils.multitenancy.MultitenantUtils;
+
+import java.util.ArrayList;
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
/**
* Load configuration files to tenant's registry.
*/
public class TenantCreateObserver extends AbstractAxis2ConfigurationContextObserver {
private static final Log log = LogFactory.getLog(TenantCreateObserver.class);
+ private String msg = null;
/**
* Create configuration context.
@@ -78,6 +106,19 @@ public class TenantCreateObserver extends AbstractAxis2ConfigurationContextObser
userStoreManager.updateRoleListOfUser(tenantAdminName, null,
new String[] {DeviceManagementConstants.User.DEFAULT_DEVICE_ADMIN,
DeviceManagementConstants.User.DEFAULT_DEVICE_USER});
+
+ Thread thread = new Thread(new Runnable() {
+ @Override
+ public void run() {
+ try {
+ publishScopesToTenant(tenantDomain);
+ } catch (TenantManagementException e) {
+ log.error("Error occurred while generating API application for the tenant: " + tenantDomain + ".");
+ }
+ }
+ });
+ thread.start();
+
if (log.isDebugEnabled()) {
log.debug("Device management roles: " + User.DEFAULT_DEVICE_USER + ", " + User.DEFAULT_DEVICE_ADMIN +
" created for the tenant:" + tenantDomain + "."
@@ -90,4 +131,312 @@ public class TenantCreateObserver extends AbstractAxis2ConfigurationContextObser
log.error("Error occurred while creating roles for the tenant: " + tenantDomain + ".");
}
}
+
+ /**
+ * This method will create OAuth application under the given tenant domain and generate an access token against the
+ * client credentials. Once this access token is generated it will then be used to retrieve all the scopes that are already
+ * published to that tenant space. The scopes of the super tenant will also be retrieved in order to compare which scopes were added
+ * or removed. (A temporary admin user will be created in the sub tenant space to publish the scopes and will be deleted once
+ * the scope publishing task is done)
+ * @param tenantDomain tenant domain that the scopes will be published to.
+ * @throws TenantManagementException if there are any errors when publishing scopes to a tenant
+ */
+ private void publishScopesToTenant(String tenantDomain) throws TenantManagementException {
+ if (!MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) {
+
+ MetadataManagementService metadataManagementService = DeviceManagementDataHolder.getInstance().getMetadataManagementService();
+
+ Map superTenantPermScopeMapping = getPermScopeMapping(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME);
+ Map subTenantPermScopeMapping = getPermScopeMapping(tenantDomain);
+
+ if (superTenantPermScopeMapping == null) {
+ msg = "Error occurred while retrieving meta key '" + Constants.PERM_SCOPE_MAPPING_META_KEY + "' for tenant '" +
+ MultitenantConstants.SUPER_TENANT_DOMAIN_NAME + "'. Hence aborting publishing scopes to tenant: '" +
+ tenantDomain + "'.";
+ log.error(msg);
+ throw new TenantManagementException(msg);
+ }
+ if (superTenantPermScopeMapping.equals(subTenantPermScopeMapping)) {
+ if (log.isDebugEnabled()) {
+ log.debug( "Scopes in '" + tenantDomain + "' are up to date with super tenant scopes.");
+ }
+ return;
+ }
+
+ APIApplicationServices apiApplicationServices = DeviceManagementDataHolder.getInstance().getApiApplicationServices();
+ APIApplicationKey apiApplicationKey;
+ AccessTokenInfo accessTokenInfo;
+
+ try {
+ PrivilegedCarbonContext.startTenantFlow();
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
+
+ APIPublisherUtils.createScopePublishUserIfNotExists(tenantDomain);
+ apiApplicationKey = apiApplicationServices.createAndRetrieveApplicationCredentials(
+ "ClientForScopePublish",
+ "client_credentials password refresh_token");
+ accessTokenInfo = apiApplicationServices.generateAccessTokenFromRegisteredApplication(
+ apiApplicationKey.getClientId(), apiApplicationKey.getClientSecret());
+ } catch (APIServicesException e) {
+ msg = "Error occurred while generating the API application for tenant: '" + tenantDomain + "'.";
+ log.error(msg, e);
+ throw new TenantManagementException(msg, e);
+ }
+
+ try {
+ PublisherRESTAPIServices publisherRESTAPIServices = DeviceManagementDataHolder.getInstance().getPublisherRESTAPIServices();
+ Scope[] superTenantScopes = getAllScopesFromSuperTenant(apiApplicationServices, publisherRESTAPIServices);
+
+ if (superTenantScopes != null) {
+ if (log.isDebugEnabled()) {
+ log.debug("Number of super tenant scopes already published - " + superTenantScopes.length);
+ }
+
+ Scope[] subTenantScopes = publisherRESTAPIServices.getScopes(apiApplicationKey, accessTokenInfo);
+
+ if (subTenantScopes.length > 0) {
+ // If there is already existing scopes on the sub tenant space then do a comparison with the
+ // super tenant scopes to add those new scopes to sub tenant space or to delete them from
+ // sub tenant space if it is not existing on the super tenant scope list.
+
+ if (log.isDebugEnabled()) {
+ log.debug("Number of sub tenant scopes already published - " + subTenantScopes.length);
+ }
+
+ List missingScopes = new ArrayList<>();
+ List deletedScopes = new ArrayList<>();
+
+ for (Scope superTenantScope : superTenantScopes) {
+ boolean isMatchingScope = false;
+ for (Scope subTenantScope : subTenantScopes) {
+ if (superTenantScope.getName().equals(subTenantScope.getName())) {
+ isMatchingScope = true;
+ break;
+ }
+ }
+ if (!isMatchingScope) {
+ if (log.isDebugEnabled()) {
+ log.debug("Missing scope found in sub tenant space - " +
+ superTenantScope.getName());
+ }
+ missingScopes.add(superTenantScope);
+ }
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("Total number of missing scopes found in sub tenant space - " +
+ missingScopes.size());
+ }
+
+ if (missingScopes.size() > 0) {
+ if (log.isDebugEnabled()) {
+ log.debug("Starting to add new/updated shared scopes to the tenant: '" + tenantDomain + "'.");
+ }
+ publishSharedScopes(missingScopes, publisherRESTAPIServices, apiApplicationKey,
+ accessTokenInfo);
+ }
+
+ for (Scope subTenantScope : subTenantScopes) {
+ boolean isMatchingScope = false;
+ for (Scope superTenantScope : superTenantScopes) {
+ if (superTenantScope.getName().equals(subTenantScope.getName())) {
+ isMatchingScope = true;
+ break;
+ }
+ }
+ if (!isMatchingScope) {
+ if (log.isDebugEnabled()) {
+ log.debug("Deleted scope found in sub tenant space - " +
+ subTenantScope.getName());
+ }
+ deletedScopes.add(subTenantScope);
+ }
+ }
+
+ if (log.isDebugEnabled()) {
+ log.debug("Total number of deleted scopes found in sub tenant space - " +
+ deletedScopes.size());
+ }
+
+ if (deletedScopes.size() > 0) {
+ if (log.isDebugEnabled()) {
+ log.debug("Starting to delete shared scopes from the tenant: '" + tenantDomain + "'.");
+ }
+ for (Scope deletedScope : deletedScopes) {
+ if (publisherRESTAPIServices.isSharedScopeNameExists(apiApplicationKey, accessTokenInfo,
+ deletedScope.getName())) {
+ Scope scope = createScopeObject(deletedScope);
+ publisherRESTAPIServices.deleteSharedScope(apiApplicationKey, accessTokenInfo, scope);
+ }
+ }
+ }
+
+ if (missingScopes.size() > 0 || deletedScopes.size() > 0) {
+ updatePermScopeMetaData(superTenantPermScopeMapping, metadataManagementService);
+ }
+ } else {
+ if (log.isDebugEnabled()) {
+ log.debug("Starting to publish shared scopes to newly created tenant: '" + tenantDomain + "'.");
+ }
+
+ publishSharedScopes(Arrays.asList(superTenantScopes), publisherRESTAPIServices,
+ apiApplicationKey, accessTokenInfo);
+ updatePermScopeMetaData(superTenantPermScopeMapping, metadataManagementService);
+ }
+ } else {
+ msg = "Unable to publish scopes to sub tenants due to super tenant scopes list being empty.";
+ log.error(msg);
+ throw new TenantManagementException(msg);
+ }
+ } catch (BadRequestException e) {
+ msg = "Invalid request sent when publishing scopes to '" + tenantDomain + "' tenant space.";
+ log.error(msg, e);
+ throw new TenantManagementException(msg, e);
+ } catch (UnexpectedResponseException e) {
+ msg = "Unexpected response received when publishing scopes to '" + tenantDomain + "' tenant space.";
+ log.error(msg, e);
+ throw new TenantManagementException(msg, e);
+ } catch (APIServicesException e) {
+ msg = "Error occurred while publishing scopes to '" + tenantDomain + "' tenant space.";
+ log.error(msg, e);
+ throw new TenantManagementException(msg, e);
+ } catch (MetadataManagementException e) {
+ msg = "Error occurred trying to create metadata entry '" + Constants.PERM_SCOPE_MAPPING_META_KEY + "'.";
+ log.error(msg);
+ throw new TenantManagementException(msg);
+ } catch (MetadataKeyAlreadyExistsException e) {
+ msg = "Error occurred trying to create metadata entry '" + Constants.PERM_SCOPE_MAPPING_META_KEY + "'. The meta key " +
+ "already exists.";
+ log.error(msg);
+ throw new TenantManagementException(msg);
+ } finally {
+ APIPublisherUtils.removeScopePublishUserIfExists(tenantDomain);
+ PrivilegedCarbonContext.endTenantFlow();
+ }
+ }
+ }
+
+ /**
+ * This method will retrieve the value of the permission scope mapping meta key stored in each tenant's metadata
+ * @param tenantDomain the tenant domain that the permission scope mapping meta value retrieved from
+ * @return {@link Map} containing the permission key and the scope value
+ * @throws TenantManagementException if there is an error while retrieving permission scope metadata
+ */
+ private Map getPermScopeMapping(String tenantDomain) throws TenantManagementException {
+ if (log.isDebugEnabled()) {
+ log.debug("Retrieving permission scope mapping from metadata from the tenant: '" + tenantDomain + "'.");
+ }
+ Map permScopeMapping = null;
+ try {
+ PrivilegedCarbonContext.startTenantFlow();
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain, true);
+ MetadataManagementService metadataManagementService = DeviceManagementDataHolder.getInstance().getMetadataManagementService();
+ Metadata metadata = metadataManagementService.retrieveMetadata(Constants.PERM_SCOPE_MAPPING_META_KEY);
+ if (metadata != null) {
+ permScopeMapping = new Gson().fromJson(metadata.getMetaValue().toString(), HashMap.class);
+ }
+ } catch (MetadataManagementException e) {
+ msg = "Error occurred while retrieving permission scope mapping from metadata for tenant: '" + tenantDomain + "'.";
+ log.error(msg, e);
+ throw new TenantManagementException(msg, e);
+ } finally {
+ PrivilegedCarbonContext.endTenantFlow();
+ }
+ return permScopeMapping;
+ }
+
+ /**
+ * This method will create a new metadata entry or update the existing metadata entry in the sub tenant metadata repository which is
+ * taken from the super tenant metadata
+ * @param superTenantPermScopeMapping {@link Map} containing the permission key and the scope value of the super tenant
+ * @param metadataManagementService {@link MetadataManagementService} instance
+ * @throws MetadataManagementException if there is an error while creating or updating the metadata entry
+ * @throws MetadataKeyAlreadyExistsException if the metadata key already exists while trying to create a new metadata entry
+ */
+ private void updatePermScopeMetaData(Map superTenantPermScopeMapping,
+ MetadataManagementService metadataManagementService) throws MetadataManagementException,
+ MetadataKeyAlreadyExistsException {
+
+ Metadata newMetaData = new Metadata();
+ newMetaData.setMetaKey(Constants.PERM_SCOPE_MAPPING_META_KEY);
+ newMetaData.setMetaValue(new Gson().toJson(superTenantPermScopeMapping));
+ if (metadataManagementService.retrieveMetadata(Constants.PERM_SCOPE_MAPPING_META_KEY) == null) {
+ metadataManagementService.createMetadata(newMetaData);
+ } else {
+ metadataManagementService.updateMetadata(newMetaData);
+ }
+ }
+
+ /**
+ * Get all the scopes from the super tenant space
+ * @param apiApplicationServices {@link APIApplicationServices} is used to create an OAuth application and retrieve client ID and secret
+ * @param publisherRESTAPIServices {@link PublisherRESTAPIServices} is used to get all scopes under a given tenant using client credentials
+ * @return array of {@link Scope}
+ * @throws BadRequestException if an invalid request is sent to the API Manager Publisher REST API Service
+ * @throws UnexpectedResponseException if an unexpected response is received from the API Manager Publisher REST API Service
+ * @throws TenantManagementException if an error occurred while processing the request sent to API Manager Publisher REST API Service
+ */
+ private Scope[] getAllScopesFromSuperTenant(APIApplicationServices apiApplicationServices,
+ PublisherRESTAPIServices publisherRESTAPIServices) throws BadRequestException,
+ UnexpectedResponseException, TenantManagementException {
+
+ try {
+ // Get all scopes of super tenant to compare later with the sub tenant scopes. This is done
+ // in order to see if any new scopes were added or deleted
+ PrivilegedCarbonContext.startTenantFlow();
+ PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME, true);
+ APIApplicationKey superTenantApiApplicationKey = apiApplicationServices.createAndRetrieveApplicationCredentials(
+ "ClientForScopePublish",
+ "client_credentials password refresh_token");
+ AccessTokenInfo superTenantAccessToken = apiApplicationServices.generateAccessTokenFromRegisteredApplication(
+ superTenantApiApplicationKey.getClientId(), superTenantApiApplicationKey.getClientSecret());
+ return publisherRESTAPIServices.getScopes(superTenantApiApplicationKey, superTenantAccessToken);
+ } catch (APIServicesException e) {
+ msg = "Error occurred while retrieving access token from super tenant";
+ log.error(msg, e);
+ throw new TenantManagementException(msg, e);
+ } finally {
+ PrivilegedCarbonContext.endTenantFlow();
+ }
+ }
+
+ /**
+ * Add shared scopes to the tenant space.
+ * @param scopeList {@link List} of {@link Scope}
+ * @param publisherRESTAPIServices {@link PublisherRESTAPIServices} is used to add shared scopes to a given tenant using client credentials
+ * @param apiApplicationKey {@link APIApplicationKey} contains client credentials of the OAuth application
+ * @param accessTokenInfo {@link AccessTokenInfo} contains token information generated from the client credentials
+ * @throws BadRequestException if an invalid request is sent to the API Manager Publisher REST API Service
+ * @throws UnexpectedResponseException if an unexpected response is received from the API Manager Publisher REST API Service
+ * @throws APIServicesException if an error occurred while processing the request sent to API Manager Publisher REST API Service
+ */
+ private void publishSharedScopes (List scopeList, PublisherRESTAPIServices publisherRESTAPIServices,
+ APIApplicationKey apiApplicationKey, AccessTokenInfo accessTokenInfo)
+ throws BadRequestException, UnexpectedResponseException, APIServicesException {
+
+ for (Scope tenantScope : scopeList) {
+ if (!publisherRESTAPIServices.isSharedScopeNameExists(apiApplicationKey, accessTokenInfo,
+ tenantScope.getName())) {
+ Scope scope = createScopeObject(tenantScope);
+ publisherRESTAPIServices.addNewSharedScope(apiApplicationKey, accessTokenInfo, scope);
+ }
+ }
+ }
+
+ /**
+ * Creates a new scope object from the passed scope which includes the id, display name, description, name and bindings.
+ * @param tenantScope existing {@link Scope} from a tenant
+ * @return {@link Scope}
+ */
+ private Scope createScopeObject (Scope tenantScope) {
+ Scope scope = new Scope();
+ scope.setId(tenantScope.getId());
+ scope.setDisplayName(tenantScope.getDisplayName());
+ scope.setDescription(tenantScope.getDescription());
+ scope.setName(tenantScope.getName());
+ List bindings = new ArrayList<>();
+ bindings.add(Constants.ADMIN_ROLE_KEY);
+ scope.setBindings(bindings);
+ return scope;
+ }
}
\ No newline at end of file
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
index ea2a18eac4..b30c7d029d 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/service/DeviceManagementProviderServiceImpl.java
@@ -1568,6 +1568,8 @@ public class DeviceManagementProviderServiceImpl implements DeviceManagementProv
new TypedValue<>(String.class, DeviceManagerUtil.getServerBaseHttpsUrl()));
params.put(io.entgra.device.mgt.core.device.mgt.core.DeviceManagementConstants.EmailAttributes.SERVER_BASE_URL_HTTP,
new TypedValue<>(String.class, DeviceManagerUtil.getServerBaseHttpUrl()));
+ params.put(DeviceManagementConstants.EmailAttributes.DOC_URL,
+ new TypedValue<>(String.class, DeviceManagerUtil.getDocUrl()));
try {
EmailContext ctx =
new EmailContext.EmailContextBuilder(new ContentProviderInfo(templateName, params),
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagerUtil.java b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagerUtil.java
index ffefe8a2bd..5ff2c15b6d 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagerUtil.java
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/main/java/io/entgra/device/mgt/core/device/mgt/core/util/DeviceManagerUtil.java
@@ -19,8 +19,36 @@ package io.entgra.device.mgt.core.device.mgt.core.util;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.google.gson.Gson;
-import io.entgra.device.mgt.core.device.mgt.common.*;
-import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.*;
+import io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.MetaDataConfiguration;
+import io.entgra.device.mgt.core.device.mgt.core.config.metadata.mgt.documentation.DocConfiguration;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.http.HttpResponse;
+import org.apache.http.client.methods.HttpPost;
+import org.apache.http.entity.ContentType;
+import org.apache.http.entity.StringEntity;
+import org.apache.http.impl.client.CloseableHttpClient;
+import org.apache.http.impl.client.HttpClients;
+import org.apache.http.protocol.HTTP;
+import org.w3c.dom.Document;
+import org.wso2.carbon.base.MultitenantConstants;
+import org.wso2.carbon.caching.impl.CacheImpl;
+import org.wso2.carbon.context.CarbonContext;
+import org.wso2.carbon.context.PrivilegedCarbonContext;
+import io.entgra.device.mgt.core.device.mgt.common.AppRegistrationCredentials;
+import io.entgra.device.mgt.core.device.mgt.common.ApplicationRegistration;
+import io.entgra.device.mgt.core.device.mgt.common.ApplicationRegistrationException;
+import io.entgra.device.mgt.core.device.mgt.common.Device;
+import io.entgra.device.mgt.core.device.mgt.common.DeviceIdentifier;
+import io.entgra.device.mgt.core.device.mgt.common.EnrolmentInfo;
+import io.entgra.device.mgt.core.device.mgt.common.GroupPaginationRequest;
+import io.entgra.device.mgt.core.device.mgt.common.PaginationRequest;
+import io.entgra.device.mgt.core.device.mgt.common.PaginationResult;
+import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationEntry;
+import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.ConfigurationManagementException;
+import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.EnrollmentConfiguration;
+import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfiguration;
+import io.entgra.device.mgt.core.device.mgt.common.configuration.mgt.PlatformConfigurationManagementService;
import io.entgra.device.mgt.core.device.mgt.common.event.config.EventConfigurationProviderService;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceManagementException;
import io.entgra.device.mgt.core.device.mgt.common.exceptions.DeviceNotFoundException;
@@ -1254,4 +1282,14 @@ public final class DeviceManagerUtil {
+ deviceGroup.getGroupId();
}
}
+
+ /**
+ * Retrieve the documentation url
+ * @return documentation url
+ */
+ public static String getDocUrl() {
+ DeviceManagementConfig deviceManagementConfig = DeviceConfigurationManager.getInstance().getDeviceManagementConfig();
+ DocConfiguration docConfiguration = deviceManagementConfig.getMetaDataConfiguration().getDocConfiguration();
+ return docConfiguration.getDocUrl();
+ }
}
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml
index 0cf4f89617..d12d30b401 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.core/src/test/resources/carbon-home/repository/conf/cdm-config.xml
@@ -159,5 +159,10 @@
640
BYOD,COPE
+
+
+ https://docs.entgra.io/uem/6.0.0
+
+
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions/pom.xml
index fd11d3c198..6ccf1208d9 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions/pom.xml
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions/pom.xml
@@ -22,7 +22,7 @@
device-mgt
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/pom.xml b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/pom.xml
index 3a1cd3259a..af634bcdf5 100644
--- a/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/pom.xml
+++ b/components/device-mgt/io.entgra.device.mgt.core.device.mgt.url.printer/pom.xml
@@ -23,7 +23,7 @@
device-mgt
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml
index af16d36297..d4f5b55854 100644
--- a/components/device-mgt/pom.xml
+++ b/components/device-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/pom.xml b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/pom.xml
index e4109ce907..861bd174f4 100644
--- a/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/pom.xml
+++ b/components/heartbeat-management/io.entgra.device.mgt.core.server.bootup.heartbeat.beacon/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
heartbeat-management
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/heartbeat-management/pom.xml b/components/heartbeat-management/pom.xml
index 3d4b76fdf1..8d08e0d880 100644
--- a/components/heartbeat-management/pom.xml
+++ b/components/heartbeat-management/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/pom.xml
index cda780af94..5143a56eb5 100644
--- a/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/pom.xml
+++ b/components/identity-extensions/io.entgra.device.mgt.core.device.mgt.oauth.extensions/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
identity-extensions
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml
index f70c73a39d..cb7279dd5b 100644
--- a/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml
+++ b/components/identity-extensions/io.entgra.device.mgt.core.identity.jwt.client.extension/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
identity-extensions
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml
index 4b1e606b4c..3ae907323a 100644
--- a/components/identity-extensions/pom.xml
+++ b/components/identity-extensions/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/pom.xml b/components/logger/io.entgra.device.mgt.core.notification.logger/pom.xml
index 3e6c5e7171..8af7693b98 100644
--- a/components/logger/io.entgra.device.mgt.core.notification.logger/pom.xml
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/pom.xml
@@ -23,7 +23,7 @@
io.entgra.device.mgt.core
logger
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
io.entgra.device.mgt.core.notification.logger
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/GroupMgtLogContext.java b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/GroupMgtLogContext.java
new file mode 100644
index 0000000000..3eeb4f66bc
--- /dev/null
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/GroupMgtLogContext.java
@@ -0,0 +1,181 @@
+/*
+ * 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.
+ */
+
+package io.entgra.device.mgt.core.notification.logger;
+
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.LogContext;
+
+public class GroupMgtLogContext extends LogContext {
+ private final String groupId;
+ private final String name;
+ private final String owner;
+ private final String actionTag;
+ private final String deviceCount;
+ private final String devices;
+ private final String userName;
+ private final String tenantID;
+ private final String tenantDomain;
+
+ private GroupMgtLogContext(Builder builder) {
+ this.groupId = builder.groupId;
+ this.name = builder.name;
+ this.owner = builder.owner;
+ this.actionTag = builder.actionTag;
+ this.deviceCount = builder.deviceCount;
+ this.devices = builder.devices;
+ this.userName = builder.userName;
+ this.tenantID = builder.tenantID;
+ this.tenantDomain = builder.tenantDomain;
+ }
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public String getActionTag() {
+ return actionTag;
+ }
+
+ public String getDeviceCount() {
+ return deviceCount;
+ }
+
+ public String getDevices() {
+ return devices;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public String getTenantID() {
+ return tenantID;
+ }
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public static class Builder {
+ private String groupId;
+ private String name;
+ private String owner;
+ private String actionTag;
+ private String deviceCount;
+ private String devices;
+ private String userName;
+ private String tenantID;
+ private String tenantDomain;
+
+ public Builder() {
+ }
+
+ public String getGroupId() {
+ return groupId;
+ }
+
+ public Builder setGroupId(String groupId) {
+ this.groupId = groupId;
+ return this;
+ }
+
+ public String getName() {
+ return name;
+ }
+
+ public Builder setName(String name) {
+ this.name = name;
+ return this;
+ }
+
+ public String getOwner() {
+ return owner;
+ }
+
+ public Builder setOwner(String owner) {
+ this.owner = owner;
+ return this;
+ }
+
+ public String getActionTag() {
+ return actionTag;
+ }
+
+ public Builder setActionTag(String actionTag) {
+ this.actionTag = actionTag;
+ return this;
+ }
+
+ public String getDeviceCount() {
+ return deviceCount;
+ }
+
+ public Builder setDeviceCount(String deviceCount) {
+ this.deviceCount = deviceCount;
+ return this;
+ }
+
+ public String getDevices() {
+ return devices;
+ }
+
+ public Builder setDevices(String devices) {
+ this.devices = devices;
+ return this;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public Builder setUserName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public String getTenantID() {
+ return tenantID;
+ }
+
+ public Builder setTenantID(String tenantID) {
+ this.tenantID = tenantID;
+ return this;
+ }
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public Builder setTenantDomain(String tenantDomain) {
+ this.tenantDomain = tenantDomain;
+ return this;
+ }
+
+ public GroupMgtLogContext build() {
+ return new GroupMgtLogContext(this);
+ }
+ }
+}
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/RoleMgtLogContext.java b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/RoleMgtLogContext.java
new file mode 100644
index 0000000000..2fbeac4583
--- /dev/null
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/RoleMgtLogContext.java
@@ -0,0 +1,149 @@
+/*
+ * 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.
+ */
+
+package io.entgra.device.mgt.core.notification.logger;
+
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.LogContext;
+
+public class RoleMgtLogContext extends LogContext {
+ private final String userStoreDomain;
+ private final String roleName;
+ private final String users;
+ private final String actionTag;
+ private final String userName;
+ private final String tenantID;
+ private final String tenantDomain;
+
+ private RoleMgtLogContext(Builder builder) {
+ this.userStoreDomain = builder.userStoreDomain;
+ this.roleName = builder.roleName;
+ this.users = builder.users;
+ this.actionTag = builder.actionTag;
+ this.userName = builder.userName;
+ this.tenantID = builder.tenantID;
+ this.tenantDomain = builder.tenantDomain;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public String getUserStoreDomain() {
+ return userStoreDomain;
+ }
+
+ public String getUsers() {
+ return users;
+ }
+
+ public String getActionTag() {
+ return actionTag;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public String getTenantID() {
+ return tenantID;
+ }
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public static class Builder {
+ private String userStoreDomain;
+ private String roleName;
+ private String users;
+ private String actionTag;
+ private String userName;
+ private String tenantID;
+ private String tenantDomain;
+
+ public Builder() {
+ }
+
+ public String getUserStoreDomain() {
+ return userStoreDomain;
+ }
+
+ public Builder setUserStoreDomain(String userStoreDomain) {
+ this.userStoreDomain = userStoreDomain;
+ return this;
+ }
+
+ public String getRoleName() {
+ return roleName;
+ }
+
+ public Builder setRoleName(String roleName) {
+ this.roleName = roleName;
+ return this;
+ }
+
+ public String getUsers() {
+ return users;
+ }
+
+ public Builder setUsers(String users) {
+ this.users = users;
+ return this;
+ }
+
+ public String getActionTag() {
+ return actionTag;
+ }
+
+ public Builder setActionTag(String actionTag) {
+ this.actionTag = actionTag;
+ return this;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public Builder setUserName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public String getTenantID() {
+ return tenantID;
+ }
+
+ public Builder setTenantID(String tenantID) {
+ this.tenantID = tenantID;
+ return this;
+ }
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public Builder setTenantDomain(String tenantDomain) {
+ this.tenantDomain = tenantDomain;
+ return this;
+ }
+
+ public RoleMgtLogContext build() {
+ return new RoleMgtLogContext(this);
+ }
+ }
+}
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/UserLogContext.java b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/UserLoginLogContext.java
similarity index 84%
rename from components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/UserLogContext.java
rename to components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/UserLoginLogContext.java
index 25ed4fbc05..30ad6c4c6c 100644
--- a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/UserLogContext.java
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/UserLoginLogContext.java
@@ -20,22 +20,22 @@ package io.entgra.device.mgt.core.notification.logger;
import io.entgra.device.mgt.core.device.mgt.extensions.logger.LogContext;
-public class UserLogContext extends LogContext {
+public class UserLoginLogContext extends LogContext {
private final String userName;
private final String userEmail;
private final String metaInfo;
private final String tenantID;
private final boolean isUserRegistered;
- private final boolean isDeviceRegisterged;
+ private final boolean isDeviceRegistered;
private final String tenantDomain;
- private UserLogContext(Builder builder) {
+ private UserLoginLogContext(Builder builder) {
this.userEmail = builder.userEmail;
this.userName = builder.userName;
this.metaInfo = builder.metaInfo;
this.tenantID = builder.tenantID;
this.isUserRegistered = builder.isUserRegistered;
- this.isDeviceRegisterged = builder.isDeviceRegisterged;
+ this.isDeviceRegistered = builder.isDeviceRegistered;
this.tenantDomain = builder.tenantDomain;
}
@@ -59,8 +59,8 @@ public class UserLogContext extends LogContext {
return isUserRegistered;
}
- public boolean isDeviceRegisterged() {
- return isDeviceRegisterged;
+ public boolean isDeviceRegistered() {
+ return isDeviceRegistered;
}
public String getTenantDomain() {
@@ -73,7 +73,7 @@ public class UserLogContext extends LogContext {
private String metaInfo;
private String tenantID;
private boolean isUserRegistered;
- private boolean isDeviceRegisterged;
+ private boolean isDeviceRegistered;
private String tenantDomain;
public Builder() {
@@ -124,12 +124,12 @@ public class UserLogContext extends LogContext {
return this;
}
- public boolean getIsDeviceRegisterged() {
- return isDeviceRegisterged;
+ public boolean getIsDeviceRegistered() {
+ return isDeviceRegistered;
}
- public Builder setDeviceRegisterged(boolean deviceRegisterged) {
- isDeviceRegisterged = deviceRegisterged;
+ public Builder setDeviceRegistered(boolean deviceRegistered) {
+ isDeviceRegistered = deviceRegistered;
return this;
}
@@ -142,8 +142,8 @@ public class UserLogContext extends LogContext {
return this;
}
- public UserLogContext build() {
- return new UserLogContext(this);
+ public UserLoginLogContext build() {
+ return new UserLoginLogContext(this);
}
}
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/UserMgtLogContext.java b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/UserMgtLogContext.java
new file mode 100644
index 0000000000..ffd2408abb
--- /dev/null
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/UserMgtLogContext.java
@@ -0,0 +1,181 @@
+/*
+ * 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.
+ */
+
+package io.entgra.device.mgt.core.notification.logger;
+
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.LogContext;
+
+public class UserMgtLogContext extends LogContext {
+ private final String userStoreDomain;
+ private final String firstName;
+ private final String lastName;
+ private final String email;
+ private final String userRoles;
+ private final String actionTag;
+ private final String userName;
+ private final String tenantID;
+ private final String tenantDomain;
+
+ private UserMgtLogContext(Builder builder) {
+ this.userStoreDomain = builder.userStoreDomain;
+ this.firstName = builder.firstName;
+ this.lastName = builder.lastName;
+ this.email = builder.email;
+ this.userRoles = builder.userRoles;
+ this.actionTag = builder.actionTag;
+ this.userName = builder.userName;
+ this.tenantID = builder.tenantID;
+ this.tenantDomain = builder.tenantDomain;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public String getUserStoreDomain() {
+ return userStoreDomain;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public String getUserRoles() {
+ return userRoles;
+ }
+
+ public String getActionTag() {
+ return actionTag;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public String getTenantID() {
+ return tenantID;
+ }
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public static class Builder {
+ private String userStoreDomain;
+ private String firstName;
+ private String lastName;
+ private String email;
+ private String userRoles;
+ private String actionTag;
+ private String userName;
+ private String tenantID;
+ private String tenantDomain;
+
+ public Builder() {
+ }
+
+ public String getUserStoreDomain() {
+ return userStoreDomain;
+ }
+
+ public Builder setUserStoreDomain(String userStoreDomain) {
+ this.userStoreDomain = userStoreDomain;
+ return this;
+ }
+
+ public String getFirstName() {
+ return firstName;
+ }
+
+ public Builder setFirstName(String firstName) {
+ this.firstName = firstName;
+ return this;
+ }
+
+ public String getLastName() {
+ return lastName;
+ }
+
+ public Builder setLastName(String lastName) {
+ this.lastName = lastName;
+ return this;
+ }
+
+ public String getEmail() {
+ return email;
+ }
+
+ public Builder setEmail(String email) {
+ this.email = email;
+ return this;
+ }
+
+ public String getUserRoles() {
+ return userRoles;
+ }
+
+ public Builder setUserRoles(String userRoles) {
+ this.userRoles = userRoles;
+ return this;
+ }
+
+ public String getActionTag() {
+ return actionTag;
+ }
+
+ public Builder setActionTag(String actionTag) {
+ this.actionTag = actionTag;
+ return this;
+ }
+
+ public String getUserName() {
+ return userName;
+ }
+
+ public Builder setUserName(String userName) {
+ this.userName = userName;
+ return this;
+ }
+
+ public String getTenantID() {
+ return tenantID;
+ }
+
+ public Builder setTenantID(String tenantID) {
+ this.tenantID = tenantID;
+ return this;
+ }
+
+ public String getTenantDomain() {
+ return tenantDomain;
+ }
+
+ public Builder setTenantDomain(String tenantDomain) {
+ this.tenantDomain = tenantDomain;
+ return this;
+ }
+
+ public UserMgtLogContext build() {
+ return new UserMgtLogContext(this);
+ }
+ }
+}
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraGroupMgtLoggerImpl.java b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraGroupMgtLoggerImpl.java
new file mode 100644
index 0000000000..e845acc2d2
--- /dev/null
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraGroupMgtLoggerImpl.java
@@ -0,0 +1,318 @@
+/*
+ * 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.
+ */
+package io.entgra.device.mgt.core.notification.logger.impl;
+
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.LogContext;
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger;
+import io.entgra.device.mgt.core.notification.logger.GroupMgtLogContext;
+import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.MDC;
+
+public class EntgraGroupMgtLoggerImpl implements EntgraLogger {
+
+ private static Log log = null;
+
+ public EntgraGroupMgtLoggerImpl(Class> clazz) {
+ log = LogFactory.getLog(clazz);
+ }
+
+ public void info(String message) {
+ log.info(message);
+ }
+
+ public void info(String message, Throwable t) {
+ log.info(message, t);
+ }
+
+ @Override
+ public void info(Object o) {
+ log.info(o);
+ }
+
+ @Override
+ public void info(Object o, Throwable throwable) {
+ log.info(o, throwable);
+ }
+
+ @Override
+ public void info(String message, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.info(message);
+ }
+
+ @Override
+ public void info(Object object, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.info(object);
+ }
+
+ @Override
+ public void info(Object object, Throwable t, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.info(object, t);
+ }
+
+ public void debug(String message) {
+ log.debug(message);
+ }
+
+ public void debug(String message, Throwable t) {
+ log.debug(message, t);
+ }
+
+ @Override
+ public void debug(Object o) {
+ log.debug(o);
+ }
+
+ @Override
+ public void debug(Object o, Throwable throwable) {
+ log.debug(o, throwable);
+ }
+
+ @Override
+ public void debug(String message, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.debug(message);
+ }
+
+ @Override
+ public void debug(Object object, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.debug(object);
+ }
+
+ @Override
+ public void debug(Object object, Throwable t, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.debug(object, t);
+ }
+
+ public void error(String message) {
+ log.error(message);
+ }
+
+ public void error(String message, Throwable t) {
+ log.error(message, t);
+ }
+
+ @Override
+ public void error(Object o) {
+ log.error(o);
+ }
+
+ @Override
+ public void error(Object o, Throwable throwable) {
+ log.error(o, throwable);
+ }
+
+ @Override
+ public void error(String message, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.error(message);
+ }
+
+ @Override
+ public void error(String message, Throwable t, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.error(message, t);
+ }
+
+ @Override
+ public void error(Object object, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.error(object);
+ }
+
+ @Override
+ public void error(Object object, Throwable t, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.error(object, t);
+ }
+
+ public void warn(String message) {
+ log.warn(message);
+ }
+
+ public void warn(String message, Throwable t) {
+ log.warn(message, t);
+ }
+
+ @Override
+ public void warn(Object o) {
+ log.warn(o);
+ }
+
+ @Override
+ public void warn(Object o, Throwable throwable) {
+ log.warn(o, throwable);
+ }
+
+ @Override
+ public void warn(String message, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.warn(message);
+ }
+
+ @Override
+ public void warn(String message, Throwable t, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.warn(message, t);
+ }
+
+ @Override
+ public void warn(Object object, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.warn(object);
+ }
+
+ @Override
+ public void warn(Object object, Throwable t, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.warn(object, t);
+ }
+
+ public void trace(String message) {
+ log.trace(message);
+ }
+
+ public void trace(String message, Throwable t) {
+ log.trace(message, t);
+ }
+
+ @Override
+ public void trace(Object o) {
+ log.trace(o);
+ }
+
+ @Override
+ public void trace(Object o, Throwable throwable) {
+ log.trace(o, throwable);
+ }
+
+ @Override
+ public void trace(String message, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.trace(message);
+ }
+
+ @Override
+ public void trace(Object object, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.trace(object);
+ }
+
+ @Override
+ public void trace(Object object, Throwable t, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.trace(object, t);
+ }
+
+ public void fatal(String message) {
+ log.fatal(message);
+ }
+
+ public void fatal(String message, Throwable t) {
+ log.fatal(message, t);
+ }
+
+ @Override
+ public void fatal(Object o) {
+ log.fatal(0);
+ }
+
+ @Override
+ public void fatal(Object o, Throwable throwable) {
+ log.fatal(0, throwable);
+ }
+
+ @Override
+ public void fatal(String message, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.fatal(message);
+ }
+
+ @Override
+ public void fatal(Object object, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.fatal(object);
+ }
+
+ @Override
+ public void fatal(Object object, Throwable t, LogContext logContext) {
+ GroupMgtLogContext groupMgtLogContext = (GroupMgtLogContext) logContext;
+ MDCContextUtil.populateGroupMgtMDCContext(groupMgtLogContext);
+ log.fatal(object, t);
+ }
+
+ @Override
+ public boolean isDebugEnabled() {
+ return log.isDebugEnabled();
+ }
+
+ @Override
+ public boolean isErrorEnabled() {
+ return log.isErrorEnabled();
+ }
+
+ @Override
+ public boolean isFatalEnabled() {
+ return log.isFatalEnabled();
+ }
+
+ @Override
+ public boolean isInfoEnabled() {
+ return log.isInfoEnabled();
+ }
+
+ @Override
+ public boolean isTraceEnabled() {
+ return log.isTraceEnabled();
+ }
+
+ @Override
+ public boolean isWarnEnabled() {
+ return log.isWarnEnabled();
+ }
+
+ @Override
+ public void clearLogContext() {
+ MDC.clear();
+ }
+}
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraUserLoggerImpl.java b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraRoleMgtLoggerImpl.java
similarity index 66%
rename from components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraUserLoggerImpl.java
rename to components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraRoleMgtLoggerImpl.java
index fa482605f6..3e3a831466 100644
--- a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraUserLoggerImpl.java
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraRoleMgtLoggerImpl.java
@@ -19,17 +19,17 @@ package io.entgra.device.mgt.core.notification.logger.impl;
import io.entgra.device.mgt.core.device.mgt.extensions.logger.LogContext;
import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger;
-import io.entgra.device.mgt.core.notification.logger.UserLogContext;
+import io.entgra.device.mgt.core.notification.logger.RoleMgtLogContext;
import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.apache.log4j.MDC;
-public class EntgraUserLoggerImpl implements EntgraLogger {
+public class EntgraRoleMgtLoggerImpl implements EntgraLogger {
private static Log log = null;
- public EntgraUserLoggerImpl(Class> clazz) {
+ public EntgraRoleMgtLoggerImpl(Class> clazz) {
log = LogFactory.getLog(clazz);
}
@@ -53,26 +53,25 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
@Override
public void info(String message, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.info(message);
}
@Override
public void info(Object object, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.info(object);
}
@Override
public void info(Object object, Throwable t, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.info(object, t);
}
-
public void debug(String message) {
log.debug(message);
}
@@ -93,26 +92,25 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
@Override
public void debug(String message, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.debug(message);
}
@Override
public void debug(Object object, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.debug(object);
}
@Override
public void debug(Object object, Throwable t, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.debug(object, t);
}
-
public void error(String message) {
log.error(message);
}
@@ -133,33 +131,32 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
@Override
public void error(String message, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.error(message);
}
@Override
public void error(String message, Throwable t, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.error(message, t);
}
@Override
public void error(Object object, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.error(object);
}
@Override
public void error(Object object, Throwable t, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.error(object, t);
}
-
public void warn(String message) {
log.warn(message);
}
@@ -180,29 +177,29 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
@Override
public void warn(String message, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.warn(message);
}
@Override
public void warn(String message, Throwable t, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.warn(message, t);
}
@Override
public void warn(Object object, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.warn(object);
}
@Override
public void warn(Object object, Throwable t, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.warn(object, t);
}
@@ -226,27 +223,25 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
@Override
public void trace(String message, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.trace(message);
}
@Override
public void trace(Object object, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.trace(object);
}
@Override
public void trace(Object object, Throwable t, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.trace(object, t);
-
}
-
public void fatal(String message) {
log.fatal(message);
}
@@ -267,22 +262,22 @@ public class EntgraUserLoggerImpl implements EntgraLogger {
@Override
public void fatal(String message, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.fatal(message);
}
@Override
public void fatal(Object object, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.fatal(object);
}
@Override
public void fatal(Object object, Throwable t, LogContext logContext) {
- UserLogContext userLogContext = (UserLogContext) logContext;
- MDCContextUtil.populateUserMDCContext(userLogContext);
+ RoleMgtLogContext roleMgtLogContext = (RoleMgtLogContext) logContext;
+ MDCContextUtil.populateRoleMgtMDCContext(roleMgtLogContext);
log.fatal(object, t);
}
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraUserLoginLoggerImpl.java b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraUserLoginLoggerImpl.java
new file mode 100644
index 0000000000..087fc45eec
--- /dev/null
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraUserLoginLoggerImpl.java
@@ -0,0 +1,323 @@
+/*
+ * 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.
+ */
+package io.entgra.device.mgt.core.notification.logger.impl;
+
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.LogContext;
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger;
+import io.entgra.device.mgt.core.notification.logger.UserLoginLogContext;
+import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.MDC;
+
+public class EntgraUserLoginLoggerImpl implements EntgraLogger {
+
+ private static Log log = null;
+
+ public EntgraUserLoginLoggerImpl(Class> clazz) {
+ log = LogFactory.getLog(clazz);
+ }
+
+ public void info(String message) {
+ log.info(message);
+ }
+
+ public void info(String message, Throwable t) {
+ log.info(message, t);
+ }
+
+ @Override
+ public void info(Object o) {
+ log.info(o);
+ }
+
+ @Override
+ public void info(Object o, Throwable throwable) {
+ log.info(o, throwable);
+ }
+
+ @Override
+ public void info(String message, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.info(message);
+ }
+
+ @Override
+ public void info(Object object, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.info(object);
+ }
+
+ @Override
+ public void info(Object object, Throwable t, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.info(object, t);
+ }
+
+
+ public void debug(String message) {
+ log.debug(message);
+ }
+
+ public void debug(String message, Throwable t) {
+ log.debug(message, t);
+ }
+
+ @Override
+ public void debug(Object o) {
+ log.debug(o);
+ }
+
+ @Override
+ public void debug(Object o, Throwable throwable) {
+ log.debug(o, throwable);
+ }
+
+ @Override
+ public void debug(String message, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.debug(message);
+ }
+
+ @Override
+ public void debug(Object object, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.debug(object);
+ }
+
+ @Override
+ public void debug(Object object, Throwable t, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.debug(object, t);
+ }
+
+
+ public void error(String message) {
+ log.error(message);
+ }
+
+ public void error(String message, Throwable t) {
+ log.error(message, t);
+ }
+
+ @Override
+ public void error(Object o) {
+ log.error(o);
+ }
+
+ @Override
+ public void error(Object o, Throwable throwable) {
+ log.error(o, throwable);
+ }
+
+ @Override
+ public void error(String message, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.error(message);
+ }
+
+ @Override
+ public void error(String message, Throwable t, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.error(message, t);
+ }
+
+ @Override
+ public void error(Object object, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.error(object);
+ }
+
+ @Override
+ public void error(Object object, Throwable t, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.error(object, t);
+ }
+
+
+ public void warn(String message) {
+ log.warn(message);
+ }
+
+ public void warn(String message, Throwable t) {
+ log.warn(message, t);
+ }
+
+ @Override
+ public void warn(Object o) {
+ log.warn(o);
+ }
+
+ @Override
+ public void warn(Object o, Throwable throwable) {
+ log.warn(o, throwable);
+ }
+
+ @Override
+ public void warn(String message, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.warn(message);
+ }
+
+ @Override
+ public void warn(String message, Throwable t, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.warn(message, t);
+ }
+
+ @Override
+ public void warn(Object object, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.warn(object);
+ }
+
+ @Override
+ public void warn(Object object, Throwable t, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.warn(object, t);
+ }
+
+ public void trace(String message) {
+ log.trace(message);
+ }
+
+ public void trace(String message, Throwable t) {
+ log.trace(message, t);
+ }
+
+ @Override
+ public void trace(Object o) {
+ log.trace(o);
+ }
+
+ @Override
+ public void trace(Object o, Throwable throwable) {
+ log.trace(o, throwable);
+ }
+
+ @Override
+ public void trace(String message, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.trace(message);
+ }
+
+ @Override
+ public void trace(Object object, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.trace(object);
+ }
+
+ @Override
+ public void trace(Object object, Throwable t, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.trace(object, t);
+
+ }
+
+
+ public void fatal(String message) {
+ log.fatal(message);
+ }
+
+ public void fatal(String message, Throwable t) {
+ log.fatal(message, t);
+ }
+
+ @Override
+ public void fatal(Object o) {
+ log.fatal(0);
+ }
+
+ @Override
+ public void fatal(Object o, Throwable throwable) {
+ log.fatal(0, throwable);
+ }
+
+ @Override
+ public void fatal(String message, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.fatal(message);
+ }
+
+ @Override
+ public void fatal(Object object, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.fatal(object);
+ }
+
+ @Override
+ public void fatal(Object object, Throwable t, LogContext logContext) {
+ UserLoginLogContext userLoginLogContext = (UserLoginLogContext) logContext;
+ MDCContextUtil.populateUserMDCContext(userLoginLogContext);
+ log.fatal(object, t);
+ }
+
+ @Override
+ public boolean isDebugEnabled() {
+ return log.isDebugEnabled();
+ }
+
+ @Override
+ public boolean isErrorEnabled() {
+ return log.isErrorEnabled();
+ }
+
+ @Override
+ public boolean isFatalEnabled() {
+ return log.isFatalEnabled();
+ }
+
+ @Override
+ public boolean isInfoEnabled() {
+ return log.isInfoEnabled();
+ }
+
+ @Override
+ public boolean isTraceEnabled() {
+ return log.isTraceEnabled();
+ }
+
+ @Override
+ public boolean isWarnEnabled() {
+ return log.isWarnEnabled();
+ }
+
+ @Override
+ public void clearLogContext() {
+ MDC.clear();
+ }
+}
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraUserMgtLoggerImpl.java b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraUserMgtLoggerImpl.java
new file mode 100644
index 0000000000..fe9fd0ee01
--- /dev/null
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/impl/EntgraUserMgtLoggerImpl.java
@@ -0,0 +1,318 @@
+/*
+ * 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.
+ */
+package io.entgra.device.mgt.core.notification.logger.impl;
+
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.LogContext;
+import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger;
+import io.entgra.device.mgt.core.notification.logger.UserMgtLogContext;
+import io.entgra.device.mgt.core.notification.logger.util.MDCContextUtil;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.log4j.MDC;
+
+public class EntgraUserMgtLoggerImpl implements EntgraLogger {
+
+ private static Log log = null;
+
+ public EntgraUserMgtLoggerImpl(Class> clazz) {
+ log = LogFactory.getLog(clazz);
+ }
+
+ public void info(String message) {
+ log.info(message);
+ }
+
+ public void info(String message, Throwable t) {
+ log.info(message, t);
+ }
+
+ @Override
+ public void info(Object o) {
+ log.info(o);
+ }
+
+ @Override
+ public void info(Object o, Throwable throwable) {
+ log.info(o, throwable);
+ }
+
+ @Override
+ public void info(String message, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.info(message);
+ }
+
+ @Override
+ public void info(Object object, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.info(object);
+ }
+
+ @Override
+ public void info(Object object, Throwable t, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.info(object, t);
+ }
+
+ public void debug(String message) {
+ log.debug(message);
+ }
+
+ public void debug(String message, Throwable t) {
+ log.debug(message, t);
+ }
+
+ @Override
+ public void debug(Object o) {
+ log.debug(o);
+ }
+
+ @Override
+ public void debug(Object o, Throwable throwable) {
+ log.debug(o, throwable);
+ }
+
+ @Override
+ public void debug(String message, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.debug(message);
+ }
+
+ @Override
+ public void debug(Object object, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.debug(object);
+ }
+
+ @Override
+ public void debug(Object object, Throwable t, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.debug(object, t);
+ }
+
+ public void error(String message) {
+ log.error(message);
+ }
+
+ public void error(String message, Throwable t) {
+ log.error(message, t);
+ }
+
+ @Override
+ public void error(Object o) {
+ log.error(o);
+ }
+
+ @Override
+ public void error(Object o, Throwable throwable) {
+ log.error(o, throwable);
+ }
+
+ @Override
+ public void error(String message, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.error(message);
+ }
+
+ @Override
+ public void error(String message, Throwable t, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.error(message, t);
+ }
+
+ @Override
+ public void error(Object object, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.error(object);
+ }
+
+ @Override
+ public void error(Object object, Throwable t, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.error(object, t);
+ }
+
+ public void warn(String message) {
+ log.warn(message);
+ }
+
+ public void warn(String message, Throwable t) {
+ log.warn(message, t);
+ }
+
+ @Override
+ public void warn(Object o) {
+ log.warn(o);
+ }
+
+ @Override
+ public void warn(Object o, Throwable throwable) {
+ log.warn(o, throwable);
+ }
+
+ @Override
+ public void warn(String message, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.warn(message);
+ }
+
+ @Override
+ public void warn(String message, Throwable t, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.warn(message, t);
+ }
+
+ @Override
+ public void warn(Object object, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.warn(object);
+ }
+
+ @Override
+ public void warn(Object object, Throwable t, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.warn(object, t);
+ }
+
+ public void trace(String message) {
+ log.trace(message);
+ }
+
+ public void trace(String message, Throwable t) {
+ log.trace(message, t);
+ }
+
+ @Override
+ public void trace(Object o) {
+ log.trace(o);
+ }
+
+ @Override
+ public void trace(Object o, Throwable throwable) {
+ log.trace(o, throwable);
+ }
+
+ @Override
+ public void trace(String message, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.trace(message);
+ }
+
+ @Override
+ public void trace(Object object, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.trace(object);
+ }
+
+ @Override
+ public void trace(Object object, Throwable t, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.trace(object, t);
+ }
+
+ public void fatal(String message) {
+ log.fatal(message);
+ }
+
+ public void fatal(String message, Throwable t) {
+ log.fatal(message, t);
+ }
+
+ @Override
+ public void fatal(Object o) {
+ log.fatal(0);
+ }
+
+ @Override
+ public void fatal(Object o, Throwable throwable) {
+ log.fatal(0, throwable);
+ }
+
+ @Override
+ public void fatal(String message, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.fatal(message);
+ }
+
+ @Override
+ public void fatal(Object object, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.fatal(object);
+ }
+
+ @Override
+ public void fatal(Object object, Throwable t, LogContext logContext) {
+ UserMgtLogContext userMgtLogContext = (UserMgtLogContext) logContext;
+ MDCContextUtil.populateUserMgtMDCContext(userMgtLogContext);
+ log.fatal(object, t);
+ }
+
+ @Override
+ public boolean isDebugEnabled() {
+ return log.isDebugEnabled();
+ }
+
+ @Override
+ public boolean isErrorEnabled() {
+ return log.isErrorEnabled();
+ }
+
+ @Override
+ public boolean isFatalEnabled() {
+ return log.isFatalEnabled();
+ }
+
+ @Override
+ public boolean isInfoEnabled() {
+ return log.isInfoEnabled();
+ }
+
+ @Override
+ public boolean isTraceEnabled() {
+ return log.isTraceEnabled();
+ }
+
+ @Override
+ public boolean isWarnEnabled() {
+ return log.isWarnEnabled();
+ }
+
+ @Override
+ public void clearLogContext() {
+ MDC.clear();
+ }
+}
diff --git a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/util/MDCContextUtil.java b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/util/MDCContextUtil.java
index dc046e8eeb..1c9afa6948 100644
--- a/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/util/MDCContextUtil.java
+++ b/components/logger/io.entgra.device.mgt.core.notification.logger/src/main/java/io/entgra/device/mgt/core/notification/logger/util/MDCContextUtil.java
@@ -37,7 +37,7 @@ public final class MDCContextUtil {
}
}
- public static void populateUserMDCContext(final UserLogContext mdcContext) {
+ public static void populateUserMDCContext(final UserLoginLogContext mdcContext) {
if (mdcContext.getUserName() != null) {
MDC.put("UserName", mdcContext.getUserName());
}
@@ -53,8 +53,8 @@ public final class MDCContextUtil {
if (mdcContext.isUserRegistered()) {
MDC.put("IsUserRegistered", "Registered");
}
- if (mdcContext.isDeviceRegisterged()) {
- MDC.put("IsDeviceRegistered", mdcContext.isDeviceRegisterged());
+ if (mdcContext.isDeviceRegistered()) {
+ MDC.put("IsDeviceRegistered", mdcContext.isDeviceRegistered());
}
if (mdcContext.getTenantDomain() != null) {
MDC.put("TenantDomain", mdcContext.getTenantDomain());
@@ -160,6 +160,88 @@ public final class MDCContextUtil {
MDC.put("UserName", mdcContext.getUserName());
}
}
-}
+ public static void populateRoleMgtMDCContext(final RoleMgtLogContext mdcContext) {
+ if (mdcContext.getUserStoreDomain() != null) {
+ MDC.put("UserStoreDomain", mdcContext.getUserStoreDomain());
+ }
+ if (mdcContext.getRoleName() != null) {
+ MDC.put("RoleName", mdcContext.getRoleName());
+ }
+ if (mdcContext.getUsers() != null) {
+ MDC.put("Users", mdcContext.getUsers());
+ }
+ if (mdcContext.getActionTag() != null) {
+ MDC.put("ActionTag", mdcContext.getActionTag());
+ }
+ if (mdcContext.getUserName() != null) {
+ MDC.put("UserName", mdcContext.getUserName());
+ }
+ if (mdcContext.getTenantDomain() != null) {
+ MDC.put("TenantDomain", mdcContext.getTenantDomain());
+ }
+ if (mdcContext.getTenantID() != null) {
+ MDC.put("TenantId", mdcContext.getTenantID());
+ }
+ }
+ public static void populateUserMgtMDCContext(final UserMgtLogContext mdcContext) {
+ if (mdcContext.getUserStoreDomain() != null) {
+ MDC.put("UserStoreDomain", mdcContext.getUserStoreDomain());
+ }
+ if (mdcContext.getFirstName() != null) {
+ MDC.put("FirstName", mdcContext.getFirstName());
+ }
+ if (mdcContext.getLastName() != null) {
+ MDC.put("LastName", mdcContext.getLastName());
+ }
+ if (mdcContext.getEmail() != null) {
+ MDC.put("Email", mdcContext.getEmail());
+ }
+ if (mdcContext.getUserRoles() != null) {
+ MDC.put("UserRoles", mdcContext.getUserRoles());
+ }
+ if (mdcContext.getActionTag() != null) {
+ MDC.put("ActionTag", mdcContext.getActionTag());
+ }
+ if (mdcContext.getUserName() != null) {
+ MDC.put("UserName", mdcContext.getUserName());
+ }
+ if (mdcContext.getTenantDomain() != null) {
+ MDC.put("TenantDomain", mdcContext.getTenantDomain());
+ }
+ if (mdcContext.getTenantID() != null) {
+ MDC.put("TenantId", mdcContext.getTenantID());
+ }
+ }
+
+ public static void populateGroupMgtMDCContext(final GroupMgtLogContext mdcContext) {
+ if (mdcContext.getGroupId() != null) {
+ MDC.put("GroupId", mdcContext.getGroupId());
+ }
+ if (mdcContext.getName() != null) {
+ MDC.put("Name", mdcContext.getName());
+ }
+ if (mdcContext.getOwner() != null) {
+ MDC.put("Owner", mdcContext.getOwner());
+ }
+ if (mdcContext.getActionTag() != null) {
+ MDC.put("ActionTag", mdcContext.getActionTag());
+ }
+ if (mdcContext.getDeviceCount() != null) {
+ MDC.put("DeviceCount", mdcContext.getDeviceCount());
+ }
+ if (mdcContext.getDevices() != null) {
+ MDC.put("Devices", mdcContext.getDevices());
+ }
+ if (mdcContext.getUserName() != null) {
+ MDC.put("UserName", mdcContext.getUserName());
+ }
+ if (mdcContext.getTenantDomain() != null) {
+ MDC.put("TenantDomain", mdcContext.getTenantDomain());
+ }
+ if (mdcContext.getTenantID() != null) {
+ MDC.put("TenantId", mdcContext.getTenantID());
+ }
+ }
+}
diff --git a/components/logger/pom.xml b/components/logger/pom.xml
index 99e2a5ae68..a6738f5cf6 100644
--- a/components/logger/pom.xml
+++ b/components/logger/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
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 3810c33e35..dbed7a6d3c 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
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
operation-template-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/operation-template-mgt/pom.xml b/components/operation-template-mgt/pom.xml
index 83d1a69cbb..c6a65d17f7 100644
--- a/components/operation-template-mgt/pom.xml
+++ b/components/operation-template-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/pom.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/pom.xml
index 8532377e8c..683d0303d3 100644
--- a/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/pom.xml
+++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.decision.point/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
policy-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/pom.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/pom.xml
index f2a4708898..c48cf4e29d 100644
--- a/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/pom.xml
+++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.information.point/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
policy-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/pom.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/pom.xml
index 7fbd90ee64..73bc1bedb9 100644
--- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/pom.xml
+++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.common/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
policy-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/pom.xml b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/pom.xml
index dea7154a59..38b741b380 100644
--- a/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/pom.xml
+++ b/components/policy-mgt/io.entgra.device.mgt.core.policy.mgt.core/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
policy-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml
index a2c1e4517e..f96ac447e9 100644
--- a/components/policy-mgt/pom.xml
+++ b/components/policy-mgt/pom.xml
@@ -23,7 +23,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
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 cc30d54e68..75a364313d 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
@@ -20,7 +20,7 @@
io.entgra.device.mgt.core
subtype-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/subtype-mgt/pom.xml b/components/subtype-mgt/pom.xml
index ece5b14cc7..6f8055026f 100644
--- a/components/subtype-mgt/pom.xml
+++ b/components/subtype-mgt/pom.xml
@@ -20,7 +20,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/task-mgt/pom.xml b/components/task-mgt/pom.xml
index 9a526bb115..2749e3de53 100755
--- a/components/task-mgt/pom.xml
+++ b/components/task-mgt/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/pom.xml b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/pom.xml
index e2ba2013f6..74afc4dd9c 100755
--- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/pom.xml
+++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.common/pom.xml
@@ -20,7 +20,7 @@
task-manager
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/pom.xml b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/pom.xml
index 7f86add007..cfbb16d3e9 100755
--- a/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/pom.xml
+++ b/components/task-mgt/task-manager/io.entgra.device.mgt.core.task.mgt.core/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
task-manager
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/task-mgt/task-manager/pom.xml b/components/task-mgt/task-manager/pom.xml
index 41541ca19a..0d2ea0ca21 100755
--- a/components/task-mgt/task-manager/pom.xml
+++ b/components/task-mgt/task-manager/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
task-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/pom.xml b/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/pom.xml
index ebddc98a79..8282d4d148 100755
--- a/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/pom.xml
+++ b/components/task-mgt/task-watcher/io.entgra.device.mgt.core.task.mgt.watcher/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
task-watcher
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/task-mgt/task-watcher/pom.xml b/components/task-mgt/task-watcher/pom.xml
index 2615004359..f686811120 100755
--- a/components/task-mgt/task-watcher/pom.xml
+++ b/components/task-mgt/task-watcher/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
task-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.common/pom.xml b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.common/pom.xml
index 7e7bfe2071..8fa9568bdf 100644
--- a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.common/pom.xml
+++ b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.common/pom.xml
@@ -20,7 +20,7 @@
tenant-mgt
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/pom.xml b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/pom.xml
index 75caf7ee6f..3826464485 100644
--- a/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/pom.xml
+++ b/components/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.core/pom.xml
@@ -20,7 +20,7 @@
tenant-mgt
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/tenant-mgt/pom.xml b/components/tenant-mgt/pom.xml
index 193647d759..3339833ccf 100644
--- a/components/tenant-mgt/pom.xml
+++ b/components/tenant-mgt/pom.xml
@@ -20,7 +20,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/pom.xml b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/pom.xml
index dc4b7e3fae..4940fd96b4 100644
--- a/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/pom.xml
+++ b/components/transport-mgt/email-sender/io.entgra.device.mgt.core.transport.mgt.email.sender.core/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
email-sender
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/email-sender/pom.xml b/components/transport-mgt/email-sender/pom.xml
index 1262255970..d40ca073a1 100644
--- a/components/transport-mgt/email-sender/pom.xml
+++ b/components/transport-mgt/email-sender/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
transport-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/pom.xml b/components/transport-mgt/pom.xml
index 199e7390d7..04bfcd6a49 100644
--- a/components/transport-mgt/pom.xml
+++ b/components/transport-mgt/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/pom.xml b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/pom.xml
index 3f49f928e6..f000a2c9bf 100644
--- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
sms-handler
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.common/pom.xml b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.common/pom.xml
index 62991bf49d..a76803b808 100644
--- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.common/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.common/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
sms-handler
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/pom.xml b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/pom.xml
index 2ed770e8fe..eadde8db32 100644
--- a/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/pom.xml
+++ b/components/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.core/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
sms-handler
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/transport-mgt/sms-handler/pom.xml b/components/transport-mgt/sms-handler/pom.xml
index 1b4a8cf879..e3a8638d75 100644
--- a/components/transport-mgt/sms-handler/pom.xml
+++ b/components/transport-mgt/sms-handler/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
transport-mgt
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/pom.xml b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/pom.xml
index ad7428b8f5..261f41efaa 100644
--- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/pom.xml
+++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/pom.xml
@@ -21,7 +21,7 @@
ui-request-interceptor
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
4.0.0
diff --git a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java
index e67152cd3d..8ef651c3bb 100644
--- a/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java
+++ b/components/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor/src/main/java/io/entgra/device/mgt/core/ui/request/interceptor/UserHandler.java
@@ -25,8 +25,8 @@ import com.google.gson.JsonSyntaxException;
import io.entgra.device.mgt.core.device.mgt.core.config.DeviceConfigurationManager;
import io.entgra.device.mgt.core.device.mgt.core.config.DeviceManagementConfig;
import io.entgra.device.mgt.core.device.mgt.extensions.logger.spi.EntgraLogger;
-import io.entgra.device.mgt.core.notification.logger.UserLogContext;
-import io.entgra.device.mgt.core.notification.logger.impl.EntgraUserLoggerImpl;
+import io.entgra.device.mgt.core.notification.logger.UserLoginLogContext;
+import io.entgra.device.mgt.core.notification.logger.impl.EntgraUserLoginLoggerImpl;
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;
@@ -55,8 +55,8 @@ import java.util.Map;
@MultipartConfig
@WebServlet("/user")
public class UserHandler extends HttpServlet {
- private static final EntgraLogger log = new EntgraUserLoggerImpl(UserHandler.class);
- UserLogContext.Builder userLogContextBuilder = new UserLogContext.Builder();
+ private static final EntgraLogger log = new EntgraUserLoginLoggerImpl(UserHandler.class);
+ UserLoginLogContext.Builder userLoginLogContextBuilder = new UserLoginLogContext.Builder();
private static final long serialVersionUID = 9050048549140517002L;
@Override
@@ -129,8 +129,13 @@ public class UserHandler extends HttpServlet {
HandlerUtil.handleSuccess(resp, proxyResponse);
httpSession.setAttribute(HandlerConstants.USERNAME_WITH_DOMAIN, nodeMap.get("username").toString());
-// log.info("Customer login",
-// userLogContextBuilder.setUserName(nodeMap.get("username").toString()).setUserRegistered(true).build());
+ log.info(
+ "User " + proxyResponse.getData() + " logged in",
+ userLoginLogContextBuilder
+ .setUserName(proxyResponse.getData().toString())
+ .setUserRegistered(true)
+ .build()
+ );
} catch (IOException e) {
log.error("Error occurred while sending the response into the socket. ", e);
} catch (JsonSyntaxException e) {
diff --git a/components/ui-request-interceptor/pom.xml b/components/ui-request-interceptor/pom.xml
index 2a82b1cb6b..d4001393ce 100644
--- a/components/ui-request-interceptor/pom.xml
+++ b/components/ui-request-interceptor/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/pom.xml
index a53a087758..e0e50b9d91 100644
--- a/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/pom.xml
+++ b/components/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
webapp-authenticator-framework
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml
index f539a01c3b..35386e2eda 100644
--- a/components/webapp-authenticator-framework/pom.xml
+++ b/components/webapp-authenticator-framework/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api.feature/pom.xml b/features/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api.feature/pom.xml
index 7dd6fac0d4..008414fcfc 100644
--- a/features/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api.feature/pom.xml
+++ b/features/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.api.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
grafana-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.server.feature/pom.xml b/features/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.server.feature/pom.xml
index 642f13501d..a2dfb019c5 100644
--- a/features/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.server.feature/pom.xml
+++ b/features/analytics-mgt/grafana-mgt/io.entgra.device.mgt.core.analytics.mgt.grafana.proxy.server.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
grafana-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/analytics-mgt/grafana-mgt/pom.xml b/features/analytics-mgt/grafana-mgt/pom.xml
index ffca0757bb..3289b6447c 100644
--- a/features/analytics-mgt/grafana-mgt/pom.xml
+++ b/features/analytics-mgt/grafana-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
analytics-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/analytics-mgt/pom.xml b/features/analytics-mgt/pom.xml
index 5a7d0f4d5a..66f399a262 100644
--- a/features/analytics-mgt/pom.xml
+++ b/features/analytics-mgt/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension.feature/pom.xml b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension.feature/pom.xml
index 52179e2ff9..a01c08ad62 100644
--- a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension.feature/pom.xml
+++ b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.analytics.extension.feature/pom.xml
@@ -20,7 +20,7 @@
io.entgra.device.mgt.core
apimgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.feature/pom.xml b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.feature/pom.xml
index cce9d76822..1e21a3e81d 100644
--- a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.feature/pom.xml
+++ b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.application.extension.feature/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
apimgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api.feature/pom.xml b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api.feature/pom.xml
index d55d671af1..47f3fa7678 100644
--- a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api.feature/pom.xml
+++ b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.extension.rest.api.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
apimgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.feature/pom.xml b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.feature/pom.xml
index e3384ca665..e55405d351 100644
--- a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.feature/pom.xml
+++ b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.keymgt.extension.feature/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
apimgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher.feature/pom.xml
index 7336c725cd..1963eb4d14 100644
--- a/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher.feature/pom.xml
+++ b/features/apimgt-extensions/io.entgra.device.mgt.core.apimgt.webapp.publisher.feature/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
apimgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml
index 6bdfe9370f..fc8527edfc 100644
--- a/features/apimgt-extensions/pom.xml
+++ b/features/apimgt-extensions/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/pom.xml b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/pom.xml
index a3061f55a2..a757e48781 100644
--- a/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/pom.xml
+++ b/features/application-mgt/io.entgra.device.mgt.core.application.mgt.server.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
application-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/application-mgt/pom.xml b/features/application-mgt/pom.xml
index 04ae409554..972a4870f7 100644
--- a/features/application-mgt/pom.xml
+++ b/features/application-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api.feature/pom.xml b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api.feature/pom.xml
index 95bc0eb763..915aebbfb2 100644
--- a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api.feature/pom.xml
+++ b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.api.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
certificate-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.feature/pom.xml b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.feature/pom.xml
index df1a40373e..db6ddbe679 100644
--- a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.feature/pom.xml
+++ b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.cert.admin.api.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
certificate-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.server.feature/pom.xml b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.server.feature/pom.xml
index 245c7ce0a5..75ea5117b7 100644
--- a/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.server.feature/pom.xml
+++ b/features/certificate-mgt/io.entgra.device.mgt.core.certificate.mgt.server.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
certificate-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml
index 292a42fffb..ecbf2d29c7 100644
--- a/features/certificate-mgt/pom.xml
+++ b/features/certificate-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.feature/pom.xml
index 64caf2eec0..09ce735cdd 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.defaultrole.manager.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature/pom.xml
index 61787c1c62..0d3bce9098 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.device.type.deployer.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger.feature/pom.xml
index b29becf144..48a83ef382 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.logger.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml
index 4d33840e37..49a61fbffb 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.fcm.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.feature/pom.xml
index c59ffecdc8..2bdfc54f76 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.http.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml
index 04aeaaeeba..aaf2fa3f83 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml
index c5abc6c575..2a133b5b78 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine.feature/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine.feature/pom.xml
index ac6c2f54f7..1bcf1b16cd 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine.feature/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.stateengine.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.userstore.role.mapper/pom.xml b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.userstore.role.mapper/pom.xml
index d1e5b996ab..ecaf5c887b 100644
--- a/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.userstore.role.mapper/pom.xml
+++ b/features/device-mgt-extensions/io.entgra.device.mgt.core.device.mgt.extensions.userstore.role.mapper/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-extensions-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml
index bb4996b990..5095f19015 100644
--- a/features/device-mgt-extensions/pom.xml
+++ b/features/device-mgt-extensions/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.api.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.api.feature/pom.xml
index 6b2dd66b5d..9e9b4d415e 100644
--- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.api.feature/pom.xml
+++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.api.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/pom.xml
index 46671fd11e..bd65b6903e 100644
--- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/pom.xml
+++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml
index 97c4ca9a3e..a9214f24a8 100644
--- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml
+++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/cdm-config.xml
@@ -189,7 +189,7 @@
<a href='https://entgra.io' target='_blank'>
Entgra
</a>
- UEM Server 5.3.0 | © 2023
+ UEM Server 6.0.0 | © 2024
, All Rights Reserved.
Entgra
@@ -201,6 +201,9 @@
default
+
+ https://docs.entgra.io/uem/6.0.0
+
diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
index 50e75857bd..b4b84e47fc 100644
--- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
+++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf/mdm-ui-config.xml
@@ -368,6 +368,7 @@
dm:metadata:view
dm:metadata:create
dm:metadata:update
+ dm:metadata:remove
and:ops:add-google-acc
and:ops:authenticate-acc
and:ops:update-default-sim
diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2 b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2
index bd6961e7d8..259a12301a 100644
--- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2
+++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.basics.feature/src/main/resources/conf_templates/templates/repository/conf/cdm-config.xml.j2
@@ -344,6 +344,11 @@
default
+
+ {% if product_conf is defined %}
+ https://docs.entgra.io/uem/{{product_conf.server_version}}
+ {% endif %}
+
diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions.feature/pom.xml
index 0055a26a90..5f7ab4c6e8 100644
--- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions.feature/pom.xml
+++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.extensions.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.feature/pom.xml
index df0eaaef54..64f16a46fb 100644
--- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.feature/pom.xml
+++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.server.feature/pom.xml b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.server.feature/pom.xml
index 596433c6c4..5346a64490 100644
--- a/features/device-mgt/io.entgra.device.mgt.core.device.mgt.server.feature/pom.xml
+++ b/features/device-mgt/io.entgra.device.mgt.core.device.mgt.server.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
device-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml
index 83ab15ef17..bcc49ce2ac 100644
--- a/features/device-mgt/pom.xml
+++ b/features/device-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/heartbeat-management/io.entgra.device.mgt.core.server.heart.beat.feature/pom.xml b/features/heartbeat-management/io.entgra.device.mgt.core.server.heart.beat.feature/pom.xml
index 419471dfd7..285bc3072b 100644
--- a/features/heartbeat-management/io.entgra.device.mgt.core.server.heart.beat.feature/pom.xml
+++ b/features/heartbeat-management/io.entgra.device.mgt.core.server.heart.beat.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
heart-beat-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/heartbeat-management/pom.xml b/features/heartbeat-management/pom.xml
index 6a476c6ba5..5f8ac1b4ea 100644
--- a/features/heartbeat-management/pom.xml
+++ b/features/heartbeat-management/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/jwt-client/io.entgra.device.mgt.core.identity.jwt.client.extension.feature/pom.xml b/features/jwt-client/io.entgra.device.mgt.core.identity.jwt.client.extension.feature/pom.xml
index 16481a34ff..92dd441e87 100644
--- a/features/jwt-client/io.entgra.device.mgt.core.identity.jwt.client.extension.feature/pom.xml
+++ b/features/jwt-client/io.entgra.device.mgt.core.identity.jwt.client.extension.feature/pom.xml
@@ -23,7 +23,7 @@
io.entgra.device.mgt.core
jwt-client-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml
index 4f7b44389e..476332000b 100644
--- a/features/jwt-client/pom.xml
+++ b/features/jwt-client/pom.xml
@@ -23,7 +23,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/logger/io.entgra.device.mgt.core.notification.logger.feature/pom.xml b/features/logger/io.entgra.device.mgt.core.notification.logger.feature/pom.xml
index 79fe7e4a83..e0a5acd7ae 100644
--- a/features/logger/io.entgra.device.mgt.core.notification.logger.feature/pom.xml
+++ b/features/logger/io.entgra.device.mgt.core.notification.logger.feature/pom.xml
@@ -23,7 +23,7 @@
io.entgra.device.mgt.core
logger-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/logger/pom.xml b/features/logger/pom.xml
index f275faddcc..5c5ff87776 100644
--- a/features/logger/pom.xml
+++ b/features/logger/pom.xml
@@ -23,7 +23,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/operation-template-mgt-plugin-feature/io.entgra.device.mgt.core.operation.template.feature/pom.xml b/features/operation-template-mgt-plugin-feature/io.entgra.device.mgt.core.operation.template.feature/pom.xml
index ea99b32f74..b40f25c9e2 100644
--- a/features/operation-template-mgt-plugin-feature/io.entgra.device.mgt.core.operation.template.feature/pom.xml
+++ b/features/operation-template-mgt-plugin-feature/io.entgra.device.mgt.core.operation.template.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
operation-template-mgt-plugin-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/operation-template-mgt-plugin-feature/pom.xml b/features/operation-template-mgt-plugin-feature/pom.xml
index e3d5cfc56a..9ad404a621 100644
--- a/features/operation-template-mgt-plugin-feature/pom.xml
+++ b/features/operation-template-mgt-plugin-feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/policy-mgt/io.entgra.device.mgt.core.policy.mgt.server.feature/pom.xml b/features/policy-mgt/io.entgra.device.mgt.core.policy.mgt.server.feature/pom.xml
index 3ea4afe744..75a89533af 100644
--- a/features/policy-mgt/io.entgra.device.mgt.core.policy.mgt.server.feature/pom.xml
+++ b/features/policy-mgt/io.entgra.device.mgt.core.policy.mgt.server.feature/pom.xml
@@ -23,7 +23,7 @@
io.entgra.device.mgt.core
policy-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml
index c83938e6b6..1d6d5d0b77 100644
--- a/features/policy-mgt/pom.xml
+++ b/features/policy-mgt/pom.xml
@@ -23,7 +23,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt.feature/pom.xml b/features/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt.feature/pom.xml
index 4ada4aa589..5fe4ef56be 100644
--- a/features/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt.feature/pom.xml
+++ b/features/subtype-mgt/io.entgra.device.mgt.core.subtype.mgt.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../../pom.xml
diff --git a/features/subtype-mgt/pom.xml b/features/subtype-mgt/pom.xml
index 4df9f69171..efb822872a 100644
--- a/features/subtype-mgt/pom.xml
+++ b/features/subtype-mgt/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/task-mgt/io.entgra.device.mgt.core.task.mgt.feature/pom.xml b/features/task-mgt/io.entgra.device.mgt.core.task.mgt.feature/pom.xml
index 30086d9604..49f3fca58a 100755
--- a/features/task-mgt/io.entgra.device.mgt.core.task.mgt.feature/pom.xml
+++ b/features/task-mgt/io.entgra.device.mgt.core.task.mgt.feature/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../../pom.xml
diff --git a/features/task-mgt/pom.xml b/features/task-mgt/pom.xml
index 43b2684b96..f9f52d46dc 100755
--- a/features/task-mgt/pom.xml
+++ b/features/task-mgt/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.server.feature/pom.xml b/features/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.server.feature/pom.xml
index 9c9f6a8f59..b9c45305f3 100644
--- a/features/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.server.feature/pom.xml
+++ b/features/tenant-mgt/io.entgra.device.mgt.core.tenant.mgt.server.feature/pom.xml
@@ -20,7 +20,7 @@
tenant-mgt-feature
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/tenant-mgt/pom.xml b/features/tenant-mgt/pom.xml
index ee497ac228..0d02f689fa 100644
--- a/features/tenant-mgt/pom.xml
+++ b/features/tenant-mgt/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/transport-mgt/email-sender/io.entgra.device.mgt.core.email.sender.feature/pom.xml b/features/transport-mgt/email-sender/io.entgra.device.mgt.core.email.sender.feature/pom.xml
index 4e44a1afb3..cd05002458 100644
--- a/features/transport-mgt/email-sender/io.entgra.device.mgt.core.email.sender.feature/pom.xml
+++ b/features/transport-mgt/email-sender/io.entgra.device.mgt.core.email.sender.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
email-sender-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/email-sender/pom.xml b/features/transport-mgt/email-sender/pom.xml
index babe6d5434..c6747ae370 100644
--- a/features/transport-mgt/email-sender/pom.xml
+++ b/features/transport-mgt/email-sender/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
transport-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/pom.xml b/features/transport-mgt/pom.xml
index 957f6bd615..66ce012172 100644
--- a/features/transport-mgt/pom.xml
+++ b/features/transport-mgt/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api.feature/pom.xml b/features/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api.feature/pom.xml
index 0434e1a21d..3756fe49d7 100644
--- a/features/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api.feature/pom.xml
+++ b/features/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.api.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
sms-handler-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.server.feature/pom.xml b/features/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.server.feature/pom.xml
index c5b2fc6d4c..61a4a5dad8 100644
--- a/features/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.server.feature/pom.xml
+++ b/features/transport-mgt/sms-handler/io.entgra.device.mgt.core.transport.mgt.sms.handler.server.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
sms-handler-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/transport-mgt/sms-handler/pom.xml b/features/transport-mgt/sms-handler/pom.xml
index dc63b226d0..062855607a 100644
--- a/features/transport-mgt/sms-handler/pom.xml
+++ b/features/transport-mgt/sms-handler/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
transport-mgt-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor.feature/pom.xml b/features/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor.feature/pom.xml
index 9c991948cb..9938cc6c6a 100644
--- a/features/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor.feature/pom.xml
+++ b/features/ui-request-interceptor/io.entgra.device.mgt.core.ui.request.interceptor.feature/pom.xml
@@ -21,7 +21,7 @@
ui-request-interceptor-feature
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
4.0.0
diff --git a/features/ui-request-interceptor/pom.xml b/features/ui-request-interceptor/pom.xml
index 801325a547..139b7dc7e8 100644
--- a/features/ui-request-interceptor/pom.xml
+++ b/features/ui-request-interceptor/pom.xml
@@ -21,7 +21,7 @@
io.entgra.device.mgt.core.parent
io.entgra.device.mgt.core
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/features/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature/pom.xml b/features/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature/pom.xml
index a96d41ac3f..03a73e24cb 100644
--- a/features/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature/pom.xml
+++ b/features/webapp-authenticator-framework/io.entgra.device.mgt.core.webapp.authenticator.framework.server.feature/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
webapp-authenticator-framework-feature
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../pom.xml
diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml
index 8d5061241a..6839692f66 100644
--- a/features/webapp-authenticator-framework/pom.xml
+++ b/features/webapp-authenticator-framework/pom.xml
@@ -22,7 +22,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
../../pom.xml
diff --git a/pom.xml b/pom.xml
index b5e809ef26..2f52137d1c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,7 @@
io.entgra.device.mgt.core
io.entgra.device.mgt.core.parent
pom
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
WSO2 Carbon - Device Management - Parent
https://entgra.io
WSO2 Connected Device Manager Components
@@ -2002,7 +2002,7 @@
1.2.11-wso2v25
- 5.0.35-SNAPSHOT
+ 5.0.38-SNAPSHOT
4.9.2