Pasindu 7 years ago
commit ab15813824

@ -22,13 +22,13 @@
<parent>
<artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.annotations</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Annotations</name>
<description>WSO2 Carbon - API Management Custom Annotation Module</description>

@ -21,12 +21,12 @@
<parent>
<artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension.api</artifactId>
<packaging>war</packaging>
<name>WSO2 Carbon - API Application Management API</name>

@ -22,12 +22,12 @@
<parent>
<artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<artifactId>org.wso2.carbon.apimgt.application.extension</artifactId>
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Application Management</name>

@ -21,13 +21,13 @@
<parent>
<artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.handlers</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Security Handler Component</name>
<description>WSO2 Carbon - API Management Security Handler Module</description>

@ -13,13 +13,13 @@
<parent>
<artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Client</name>
<description>WSO2 Carbon - API Management Integration Client</description>

@ -22,22 +22,35 @@ import feign.RequestInterceptor;
import org.wso2.carbon.apimgt.integration.client.publisher.PublisherClient;
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
import org.wso2.carbon.identity.jwt.client.extension.dto.AccessTokenInfo;
import java.util.HashMap;
import java.util.Map;
public class IntegrationClientServiceImpl implements IntegrationClientService {
private static StoreClient storeClient;
private static PublisherClient publisherClient;
private static Map<String, AccessTokenInfo> tenantUserTokenMap = new HashMap<>();
private static IntegrationClientServiceImpl instance;
private StoreClient storeClient;
private PublisherClient publisherClient;
private OAuthRequestInterceptor oAuthRequestInterceptor;
public IntegrationClientServiceImpl() {
RequestInterceptor oAuthRequestInterceptor = new OAuthRequestInterceptor();
private IntegrationClientServiceImpl() {
oAuthRequestInterceptor = new OAuthRequestInterceptor();
storeClient = new StoreClient(oAuthRequestInterceptor);
publisherClient = new PublisherClient(oAuthRequestInterceptor);
}
public static IntegrationClientServiceImpl getInstance() {
if (instance == null) {
synchronized (IntegrationClientService.class) {
if (instance == null) {
instance = new IntegrationClientServiceImpl();
}
}
}
return instance;
}
public void resetUserInfo(String userName, String tenantDomain) {
oAuthRequestInterceptor.removeToken(userName, tenantDomain);
}
@Override
public StoreClient getStoreClient() {
return storeClient;
@ -47,8 +60,4 @@ public class IntegrationClientServiceImpl implements IntegrationClientService {
public PublisherClient getPublisherClient() {
return publisherClient;
}
public static Map<String, AccessTokenInfo> getTenantUserTokenMap() {
return tenantUserTokenMap;
}
}

@ -40,6 +40,7 @@ import org.wso2.carbon.identity.jwt.client.extension.exception.JWTClientExceptio
import java.util.HashMap;
import java.util.Map;
import java.util.concurrent.ConcurrentHashMap;
/**
* This is a request interceptor to add oauth token header.
@ -55,6 +56,7 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
private static final long DEFAULT_REFRESH_TIME_OFFSET_IN_MILLIS = 100000;
private DCRClient dcrClient;
private static OAuthApplication oAuthApplication;
private static Map<String, AccessTokenInfo> tenantUserTokenMap = new ConcurrentHashMap<>();
private static final Log log = LogFactory.getLog(OAuthRequestInterceptor.class);
/**
@ -88,7 +90,7 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
username = username + "@" + tenantDomain;
}
AccessTokenInfo tenantBasedAccessTokenInfo = IntegrationClientServiceImpl.getTenantUserTokenMap().get(username);
AccessTokenInfo tenantBasedAccessTokenInfo = tenantUserTokenMap.get(username);
if ((tenantBasedAccessTokenInfo == null ||
((System.currentTimeMillis() + DEFAULT_REFRESH_TIME_OFFSET_IN_MILLIS) >
tenantBasedAccessTokenInfo.getExpiresIn()))) {
@ -96,8 +98,8 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
JWTClient jwtClient = APIIntegrationClientDataHolder.getInstance().getJwtClientManagerService()
.getJWTClient();
tenantBasedAccessTokenInfo = jwtClient.getAccessToken(oAuthApplication.getClientId(),
oAuthApplication.getClientSecret(), username,
REQUIRED_SCOPE);
oAuthApplication.getClientSecret(), username,
REQUIRED_SCOPE);
tenantBasedAccessTokenInfo.setExpiresIn(
System.currentTimeMillis() + (tenantBasedAccessTokenInfo.getExpiresIn() * 1000));
if (tenantBasedAccessTokenInfo.getScopes() == null) {
@ -105,7 +107,7 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
}
if (tenantBasedAccessTokenInfo.getScopes().contains(APIM_SUBSCRIBE_SCOPE)) {
IntegrationClientServiceImpl.getTenantUserTokenMap().put(username, tenantBasedAccessTokenInfo);
tenantUserTokenMap.put(username, tenantBasedAccessTokenInfo);
}
}
@ -118,4 +120,11 @@ public class OAuthRequestInterceptor implements RequestInterceptor {
}
}
public void removeToken(String username, String tenantDomain) {
if (!tenantDomain.equals(MultitenantConstants.SUPER_TENANT_DOMAIN_NAME)) {
username = username + "@" + tenantDomain;
}
tenantUserTokenMap.remove(username);
}
}

@ -49,7 +49,7 @@ public class APIIntegrationClientServiceComponent {
/* Initializing webapp publisher configuration */
APIMConfigReader.init();
BundleContext bundleContext = componentContext.getBundleContext();
bundleContext.registerService(IntegrationClientService.class.getName(), new IntegrationClientServiceImpl(), null);
bundleContext.registerService(IntegrationClientService.class.getName(), IntegrationClientServiceImpl.getInstance(), null);
if (log.isDebugEnabled()) {
log.debug("apimgt client bundle has been successfully initialized");

@ -26,6 +26,9 @@ import org.wso2.carbon.apimgt.integration.client.store.StoreClient;
*/
public interface IntegrationClientService {
void resetUserInfo(String username, String tenantDomain);
/**
*
* @return API Store Client.

@ -13,13 +13,13 @@
<parent>
<artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.generated.client</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Integration Generated Client</name>
<description>WSO2 Carbon - API Management Integration Client</description>

@ -22,13 +22,13 @@
<parent>
<artifactId>apimgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.webapp.publisher</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - API Management Webapp Publisher</name>
<description>WSO2 Carbon - API Management Webapp Publisher</description>

@ -22,13 +22,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>apimgt-extensions</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Component</name>
<url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent>
<artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>certificate-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -21,13 +21,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.core</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Certificate Management Core</name>
<description>WSO2 Carbon - Certificate Management Core</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Certificate Management Component</name>
<url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>carbon-devicemgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -3,7 +3,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -177,6 +177,11 @@
<artifactId>org.wso2.carbon.device.mgt.extensions</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.apimgt.integration.client</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.device.mgt.core</artifactId>

@ -30,6 +30,7 @@ import org.wso2.carbon.device.mgt.jaxrs.beans.RoleList;
import org.wso2.carbon.device.mgt.jaxrs.service.api.RoleManagementService;
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.FilteringUtil;
import org.wso2.carbon.device.mgt.jaxrs.service.impl.util.RequestValidationUtil;
import org.wso2.carbon.device.mgt.jaxrs.util.Constants;
import org.wso2.carbon.device.mgt.jaxrs.util.DeviceMgtAPIUtils;
import org.wso2.carbon.device.mgt.jaxrs.util.SetReferenceTransformer;
import org.wso2.carbon.registry.api.Registry;
@ -68,6 +69,9 @@ public class RoleManagementServiceImpl implements RoleManagementService {
@HeaderParam("If-Modified-Since") String ifModifiedSince,
@QueryParam("offset") int offset, @QueryParam("limit") int limit) {
RequestValidationUtil.validatePaginationParameters(offset, limit);
if (limit == 0){
limit = Constants.DEFAULT_PAGE_LIMIT;
}
List<String> filteredRoles;
RoleList targetRoles = new RoleList();

@ -88,12 +88,12 @@ public class UserManagementServiceImpl implements UserManagementService {
// Permissions that are given for a normal device user.
private static final Permission[] PERMISSIONS_FOR_DEVICE_USER = {
new Permission("/permission/admin/Login", "ui.execute"),
new Permission("/permission/admin/device-mgt/device/api/subscribe", "ui.execute"),
new Permission("/permission/admin/device-mgt/devices/enroll", "ui.execute"),
new Permission("/permission/admin/device-mgt/devices/disenroll", "ui.execute"),
new Permission("/permission/admin/device-mgt/devices/owning-device/view", "ui.execute"),
new Permission("/permission/admin/manage/portal", "ui.execute")
new Permission("/permission/admin/Login", "ui.execute"),
new Permission("/permission/admin/device-mgt/device/api/subscribe", "ui.execute"),
new Permission("/permission/admin/device-mgt/devices/enroll", "ui.execute"),
new Permission("/permission/admin/device-mgt/devices/disenroll", "ui.execute"),
new Permission("/permission/admin/device-mgt/devices/owning-device/view", "ui.execute"),
new Permission("/permission/admin/manage/portal", "ui.execute")
};
@POST
@ -134,7 +134,7 @@ public class UserManagementServiceImpl implements UserManagementService {
}
userStoreManager.addUser(userInfo.getUsername(), initialUserPassword,
roles, defaultUserClaims, null);
roles, defaultUserClaims, null);
// Outputting debug message upon successful addition of user
if (log.isDebugEnabled()) {
log.debug("User '" + userInfo.getUsername() + "' has successfully been added.");
@ -158,7 +158,7 @@ public class UserManagementServiceImpl implements UserManagementService {
dms.sendRegistrationEmail(metaInfo);
return Response.created(new URI(API_BASE_PATH + "/" + URIEncoder.encode(userInfo.getUsername(), "UTF-8")))
.entity(
createdUserInfo).build();
createdUserInfo).build();
} catch (UserStoreException e) {
String msg = "Error occurred while trying to add user '" + userInfo.getUsername() + "' to the " +
"underlying user management system";
@ -227,11 +227,11 @@ public class UserManagementServiceImpl implements UserManagementService {
if (!userStoreManager.isExistingUser(username)) {
if (log.isDebugEnabled()) {
log.debug("User by username: " + username +
" doesn't exists. Therefore, request made to update user was refused.");
" doesn't exists. Therefore, request made to update user was refused.");
}
return Response.status(Response.Status.NOT_FOUND).entity(
new ErrorResponse.ErrorResponseBuilder().setMessage("User by username: " +
username + " doesn't exist.").build()).build();
username + " doesn't exist.").build()).build();
}
Map<String, String> defaultUserClaims =
@ -240,7 +240,7 @@ public class UserManagementServiceImpl implements UserManagementService {
if (StringUtils.isNotEmpty(userInfo.getPassword())) {
// Decoding Base64 encoded password
userStoreManager.updateCredentialByAdmin(username,
userInfo.getPassword());
userInfo.getPassword());
log.debug("User credential of username: " + username + " has been changed");
}
List<String> currentRoles = this.getFilteredRoles(userStoreManager, username);
@ -259,8 +259,8 @@ public class UserManagementServiceImpl implements UserManagementService {
rolesToDelete.remove(ROLE_EVERYONE);
rolesToAdd.remove(ROLE_EVERYONE);
userStoreManager.updateRoleListOfUser(username,
rolesToDelete.toArray(new String[rolesToDelete.size()]),
rolesToAdd.toArray(new String[rolesToAdd.size()]));
rolesToDelete.toArray(new String[rolesToDelete.size()]),
rolesToAdd.toArray(new String[rolesToAdd.size()]));
userStoreManager.setUserClaimValues(username, defaultUserClaims, null);
// Outputting debug message upon successful addition of user
if (log.isDebugEnabled()) {
@ -363,7 +363,9 @@ public class UserManagementServiceImpl implements UserManagementService {
}
RequestValidationUtil.validatePaginationParameters(offset, limit);
if (limit == 0) {
limit = Constants.DEFAULT_PAGE_LIMIT;
}
List<BasicUserInfo> userList, offsetList;
String appliedFilter = ((filter == null) || filter.isEmpty() ? "*" : filter + "*");
// to get whole set of users, appliedLimit is set to -1
@ -420,7 +422,7 @@ public class UserManagementServiceImpl implements UserManagementService {
UserStoreCountRetriever userStoreCountRetrieverService = DeviceMgtAPIUtils.getUserStoreCountRetrieverService();
RealmConfiguration secondaryRealmConfiguration = CarbonContext.getThreadLocalCarbonContext().getUserRealm().
getRealmConfiguration().getSecondaryRealmConfig();
if (secondaryRealmConfiguration != null) {
if (!secondaryRealmConfiguration.isPrimary() && !Constants.JDBC_USERSTOREMANAGER.
equals(secondaryRealmConfiguration.getUserStoreClass().getClass())) {
@ -473,7 +475,8 @@ public class UserManagementServiceImpl implements UserManagementService {
@GET
@Path("/checkUser")
@Override public Response isUserExists(@QueryParam("username") String userName) {
@Override
public Response isUserExists(@QueryParam("username") String userName) {
try {
UserStoreManager userStoreManager = DeviceMgtAPIUtils.getUserStoreManager();
boolean userExists = false;
@ -494,7 +497,7 @@ public class UserManagementServiceImpl implements UserManagementService {
@Path("/search/usernames")
@Override
public Response getUserNames(@QueryParam("filter") String filter, @QueryParam("domain") String domain,
@HeaderParam("If-Modified-Since") String timestamp,
@HeaderParam("If-Modified-Since") String timestamp,
@QueryParam("offset") int offset, @QueryParam("limit") int limit) {
if (log.isDebugEnabled()) {
log.debug("Getting the list of users with all user-related information using the filter : " + filter);
@ -503,21 +506,23 @@ public class UserManagementServiceImpl implements UserManagementService {
if (domain != null && !domain.isEmpty()) {
userStoreDomain = domain;
}
if (limit == 0){
//If there is no limit is passed, then return all.
limit = -1;
}
List<UserInfo> userList;
try {
UserStoreManager userStoreManager = DeviceMgtAPIUtils.getUserStoreManager();
String[] users = userStoreManager.listUsers(userStoreDomain + "/*", -1);
String[] users = userStoreManager.listUsers(userStoreDomain + "/" + filter + "*", limit);
userList = new ArrayList<>();
UserInfo user;
for (String username : users) {
if (username.contains(filter)) {
user = new UserInfo();
user.setUsername(username);
user.setEmailAddress(getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS));
user.setFirstname(getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME));
user.setLastname(getClaimValue(username, Constants.USER_CLAIM_LAST_NAME));
userList.add(user);
}
user = new UserInfo();
user.setUsername(username);
user.setEmailAddress(getClaimValue(username, Constants.USER_CLAIM_EMAIL_ADDRESS));
user.setFirstname(getClaimValue(username, Constants.USER_CLAIM_FIRST_NAME));
user.setLastname(getClaimValue(username, Constants.USER_CLAIM_LAST_NAME));
userList.add(user);
}
return Response.status(Response.Status.OK).entity(userList).build();
} catch (UserStoreException e) {
@ -558,11 +563,16 @@ public class UserManagementServiceImpl implements UserManagementService {
EmailMetaInfo metaInfo = new EmailMetaInfo(recipient, props);
dms.sendEnrolmentInvitation(DeviceManagementConstants.EmailAttributes.USER_ENROLLMENT_TEMPLATE,
metaInfo);
metaInfo);
}
} catch (DeviceManagementException e) {
String msg = "Error occurred while inviting user to enrol their device";
if (e.getMessage() != null && !e.getMessage().isEmpty()) {
msg = e.getMessage();
}
log.error(msg, e);
return Response.serverError().entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(msg).build()).build();
} catch (UserStoreException e) {
String msg = "Error occurred while getting claim values to invite user";
log.error(msg, e);
@ -655,8 +665,8 @@ public class UserManagementServiceImpl implements UserManagementService {
private String getEnrollmentTemplateName(String deviceType) {
String templateName = deviceType + "-enrollment-invitation";
File template = new File(CarbonUtils.getCarbonHome() + File.separator + "repository" + File.separator
+ "resources" + File.separator + "email-templates" + File.separator + templateName
+ ".vm");
+ "resources" + File.separator + "email-templates" + File.separator + templateName
+ ".vm");
if (template.exists()) {
return templateName;
} else {

@ -30,6 +30,7 @@ public class Constants {
public static final String DEFAULT_STREAM_VERSION = "1.0.0";
public static final String SCOPE = "scope";
public static final String JDBC_USERSTOREMANAGER = "org.wso2.carbon.user.core.jdbc.JDBCUserStoreManager";
public static final int DEFAULT_PAGE_LIMIT = 50;
public final class ErrorMessages {

@ -20,8 +20,6 @@ package org.wso2.carbon.device.mgt.jaxrs.util;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.apimgt.integration.client.IntegrationClientServiceImpl;
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.context.CarbonContext;
import org.wso2.carbon.context.PrivilegedCarbonContext;
import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse;
@ -56,7 +54,7 @@ public class CredentialManagementResponseBuilder {
RequestValidationUtil.validateCredentials(credentials);
if (!validateCredential(credentials.getNewPassword())) {
String errorMsg = DeviceMgtAPIUtils.getRealmService().getBootstrapRealmConfiguration()
.getUserStoreProperty(PASSWORD_VALIDATION_ERROR_MSG_TAG);
.getUserStoreProperty(PASSWORD_VALIDATION_ERROR_MSG_TAG);
return Response.status(Response.Status.BAD_REQUEST).entity(
new ErrorResponse.ErrorResponseBuilder().setMessage(errorMsg).build()).build();
}
@ -66,9 +64,8 @@ public class CredentialManagementResponseBuilder {
username = CarbonContext.getThreadLocalCarbonContext().getUsername();
userStoreManager.updateCredential(username, credentials.getNewPassword(),
credentials.getOldPassword());
IntegrationClientServiceImpl integrationClientService = (IntegrationClientServiceImpl) PrivilegedCarbonContext.
getThreadLocalCarbonContext().getOSGiService(IntegrationClientService.class, null);
integrationClientService.getTenantUserTokenMap().remove(username);
DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username,
PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
return Response.status(Response.Status.OK).entity("UserImpl password by username: " +
username + " was successfully changed.").build();
} catch (UserStoreException e) {
@ -111,6 +108,8 @@ public class CredentialManagementResponseBuilder {
new ErrorResponse.ErrorResponseBuilder().setMessage(errorMsg).build()).build();
}
userStoreManager.updateCredentialByAdmin(username, credentials.getNewPassword());
DeviceMgtAPIUtils.getIntegrationClientService().resetUserInfo(username,
PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantDomain());
return Response.status(Response.Status.OK).entity("UserImpl password by username: " +
username + " was successfully changed.").build();
} catch (UserStoreException e) {

@ -29,6 +29,7 @@ import org.apache.commons.httpclient.protocol.ProtocolSocketFactory;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.wso2.carbon.analytics.stream.persistence.stub.EventStreamPersistenceAdminServiceStub;
import org.wso2.carbon.apimgt.integration.client.service.IntegrationClientService;
import org.wso2.carbon.base.ServerConfiguration;
import org.wso2.carbon.analytics.api.AnalyticsDataAPI;
import org.wso2.carbon.context.CarbonContext;
@ -128,6 +129,8 @@ public class DeviceMgtAPIUtils {
private static KeyStore trustStore;
private static char[] keyStorePassword;
private static IntegrationClientService integrationClientService;
static {
String keyStorePassword = ServerConfiguration.getInstance().getFirstProperty("Security.KeyStore.Password");
String trustStorePassword = ServerConfiguration.getInstance().getFirstProperty(
@ -297,6 +300,23 @@ public class DeviceMgtAPIUtils {
return realmService;
}
public static IntegrationClientService getIntegrationClientService() {
if (integrationClientService == null) {
synchronized (DeviceMgtAPIUtils.class) {
if (integrationClientService == null) {
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
integrationClientService = (IntegrationClientService) ctx.getOSGiService(IntegrationClientService.class, null);
if (integrationClientService == null) {
String msg = "IntegrationClientService is not initialized";
log.error(msg);
throw new IllegalStateException(msg);
}
}
}
}
return integrationClientService;
}
public static RegistryService getRegistryService() {
RegistryService registryService;
PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext();
@ -459,7 +479,7 @@ public class DeviceMgtAPIUtils {
return realmService.getTenantManager().getTenantId(tenantDomain);
} catch (UserStoreException e) {
throw new DeviceManagementException("Error occured while trying to " +
"obtain tenant id of currently logged in user");
"obtain tenant id of currently logged in user");
}
}
@ -513,8 +533,8 @@ public class DeviceMgtAPIUtils {
streamOptions.setProperty(HTTPConstants.HTTP_HEADERS, list);
streamOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER
, new Protocol(DEFAULT_HTTP_PROTOCOL
, (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext)
, Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT))));
, (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext)
, Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT))));
eventStreamAdminServiceStub._getServiceClient().setOptions(streamOptions);
return eventStreamAdminServiceStub;
}
@ -544,8 +564,8 @@ public class DeviceMgtAPIUtils {
eventReciverOptions.setProperty(HTTPConstants.HTTP_HEADERS, list);
eventReciverOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER
, new Protocol(DEFAULT_HTTP_PROTOCOL
, (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext)
, Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT))));
, (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext)
, Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT))));
receiverAdminServiceStub._getServiceClient().setOptions(eventReciverOptions);
return receiverAdminServiceStub;
@ -576,8 +596,8 @@ public class DeviceMgtAPIUtils {
eventReciverOptions.setProperty(HTTPConstants.HTTP_HEADERS, list);
eventReciverOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER
, new Protocol(DEFAULT_HTTP_PROTOCOL
, (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext)
, Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT))));
, (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext)
, Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT))));
eventPublisherAdminServiceStub._getServiceClient().setOptions(eventReciverOptions);
return eventPublisherAdminServiceStub;
}
@ -608,8 +628,8 @@ public class DeviceMgtAPIUtils {
eventReciverOptions.setProperty(HTTPConstants.HTTP_HEADERS, list);
eventReciverOptions.setProperty(HTTPConstants.CUSTOM_PROTOCOL_HANDLER
, new Protocol(DEFAULT_HTTP_PROTOCOL
, (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext)
, Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT))));
, (ProtocolSocketFactory) new SSLProtocolSocketFactory(sslContext)
, Integer.parseInt(Utils.replaceSystemProperty(DAS_PORT))));
eventStreamPersistenceAdminServiceStub._getServiceClient().setOptions(eventReciverOptions);
return eventStreamPersistenceAdminServiceStub;
@ -617,6 +637,7 @@ public class DeviceMgtAPIUtils {
/**
* This method is used to create the Cache that holds the event definition of the device type..
*
* @return Cachemanager
*/
public static synchronized Cache<String, EventAttributeList> getDynamicEventCache() {
@ -669,7 +690,7 @@ public class DeviceMgtAPIUtils {
* Initializes the SSL Context
*/
private static void initSSLConnection() throws NoSuchAlgorithmException, UnrecoverableKeyException,
KeyStoreException, KeyManagementException {
KeyStoreException, KeyManagementException {
KeyManagerFactory keyManagerFactory = KeyManagerFactory.getInstance(KEY_MANAGER_TYPE);
keyManagerFactory.init(keyStore, keyStorePassword);
TrustManagerFactory trustManagerFactory = TrustManagerFactory.getInstance(TRUST_MANAGER_TYPE);

@ -21,7 +21,7 @@
<parent>
<artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -65,4 +65,10 @@ public class GroupPaginationRequest {
this.groupName = groupName;
}
@Override
public String toString() {
return "Group Name '" + this.groupName + "' num of rows: " + this.rowCount + " start index: " + this.startIndex
+ " owner' " + this.owner + "'";
}
}

@ -129,4 +129,12 @@ public class PaginationRequest {
public void setOwnerPattern(String ownerPattern) {
this.ownerPattern = ownerPattern;
}
@Override
public String toString() {
return "Device type '" + this.deviceType + "' Device Name '" + this.deviceName + "' row count: " + this.rowCount
+ " Owner role '" + this.ownerRole + "' owner pattern '" + this.ownerPattern + "' ownership "
+ this.ownership + "' Status '" + this.status + "' owner '" + this.owner + "' groupId: " + this.groupId
+ " start index: " + this.startIndex;
}
}

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -350,7 +350,9 @@ public class DeviceManagementPluginRepository implements DeviceManagerStartupLis
if (deviceStatusTaskPluginConfig != null && deviceStatusTaskPluginConfig.isRequireStatusMonitoring()) {
try {
DeviceManagementDataHolder.getInstance().removeDeviceStatusTaskPluginConfig(deviceType);
deviceStatusTaskManagerService.stopTask(deviceType, deviceStatusTaskPluginConfig);
if (deviceStatusTaskManagerService != null) {
deviceStatusTaskManagerService.stopTask(deviceType, deviceStatusTaskPluginConfig);
}
} catch (DeviceStatusTaskException e) {
throw new DeviceManagementException("Error occurred while stopping Device Status task service for '" +
deviceManagementService.getType() + "'", e);

@ -182,16 +182,7 @@ public class GenericOperationDAOImpl implements OperationDAO {
stmt.setString(3, Operation.Status.PENDING.toString());
// This will return only one result always.
rs = stmt.executeQuery();
int id = 0;
if (rs.next()) {
id = rs.getInt("ID");
}
if (id != 0) {
stmt = connection.prepareStatement(
"UPDATE DM_ENROLMENT_OP_MAPPING SET UPDATED_TIMESTAMP = ? " + "WHERE ID = ?");
stmt.setLong(1, System.currentTimeMillis() / 1000);
stmt.setInt(2, id);
stmt.executeUpdate();
result = true;
}
} catch (SQLException e) {

@ -65,6 +65,14 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public void createGroup(DeviceGroup deviceGroup, String defaultRole, String[] defaultPermissions)
throws GroupManagementException, GroupAlreadyExistException {
if (deviceGroup == null) {
String msg = "Received incomplete data for createGroup";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Creating group '" + deviceGroup.getName() + "'");
}
if (deviceGroup == null) {
throw new GroupManagementException("DeviceGroup cannot be null.", new NullPointerException());
}
@ -80,10 +88,17 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
}
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
throw new GroupManagementException("Error occurred while adding deviceGroup " +
"'" + deviceGroup.getName() + "' to database.", e);
String msg = "Error occurred while adding deviceGroup '" + deviceGroup.getName() + "' to database.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (TransactionManagementException e) {
throw new GroupManagementException("Error occurred while initiating transaction.", e);
String msg = "Error occurred while initiating transaction.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in creating group '" + deviceGroup.getName() + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -99,6 +114,14 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public void updateGroup(DeviceGroup deviceGroup, int groupId)
throws GroupManagementException, GroupAlreadyExistException {
if (deviceGroup == null) {
String msg = "Received incomplete data for updateGroup";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("update group '" + deviceGroup.getName() + "'");
}
if (deviceGroup == null) {
throw new GroupManagementException("DeviceGroup cannot be null.", new NullPointerException());
}
@ -114,10 +137,17 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
}
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
throw new GroupManagementException("Error occurred while modifying deviceGroup " +
"'" + deviceGroup.getName() + "'.", e);
String msg = "Error occurred while modifying deviceGroup '" + deviceGroup.getName() + "'.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (TransactionManagementException e) {
throw new GroupManagementException("Error occurred while initiating transaction.", e);
String msg = "Error occurred while initiating transaction.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in updating group '" + deviceGroup.getName() + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -128,6 +158,9 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
*/
@Override
public boolean deleteGroup(int groupId) throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Delete group: " + groupId);
}
DeviceGroup deviceGroup = getGroup(groupId);
if (deviceGroup == null) {
return false;
@ -142,9 +175,17 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
return true;
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
throw new GroupManagementException("Error occurred while removing group data.", e);
String msg = "Error occurred while removing group data.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (TransactionManagementException e) {
throw new GroupManagementException("Error occurred while initiating transaction.", e);
String msg = "Error occurred while initiating transaction.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in deleting group: " + groupId;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -155,14 +196,25 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
*/
@Override
public DeviceGroup getGroup(int groupId) throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Get group by id: " + groupId);
}
DeviceGroup deviceGroup;
try {
GroupManagementDAOFactory.openConnection();
deviceGroup = this.groupDAO.getGroup(groupId, CarbonContext.getThreadLocalCarbonContext().getTenantId());
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while obtaining group '" + groupId + "'", e);
String msg = "Error occurred while obtaining group '" + groupId + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getGroup for groupId: " + groupId;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -174,14 +226,30 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
*/
@Override
public DeviceGroup getGroup(String groupName) throws GroupManagementException {
if (groupName == null) {
String msg = "Received empty groupName for getGroup";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Get group by name '" + groupName + "'");
}
DeviceGroup deviceGroup;
try {
GroupManagementDAOFactory.openConnection();
deviceGroup = this.groupDAO.getGroup(groupName, CarbonContext.getThreadLocalCarbonContext().getTenantId());
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while obtaining group with name: '" + groupName + "'", e);
String msg = "Error occurred while obtaining group with name: '" + groupName + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getGroup with name " + groupName;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -190,15 +258,26 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public List<DeviceGroup> getGroups() throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Get groups");
}
List<DeviceGroup> deviceGroups = new ArrayList<>();
try {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
GroupManagementDAOFactory.openConnection();
deviceGroups = this.groupDAO.getGroups(tenantId);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while retrieving all groups in tenant", e);
String msg = "Error occurred while retrieving all groups in tenant";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getGroups";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -207,6 +286,14 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public PaginationResult getGroups(GroupPaginationRequest request) throws GroupManagementException {
if (request == null) {
String msg = "Received incomplete data for getGroup";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Get groups with pagination " + request.toString());
}
request = DeviceManagerUtil.validateGroupListPageSize(request);
List<DeviceGroup> deviceGroups = new ArrayList<>();
try {
@ -214,9 +301,17 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
GroupManagementDAOFactory.openConnection();
deviceGroups = this.groupDAO.getGroups(request, tenantId);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while retrieving all groups in tenant", e);
String msg = "Error occurred while retrieving all groups in tenant";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getGroups";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -228,6 +323,14 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public List<DeviceGroup> getGroups(String username) throws GroupManagementException {
if (username == null || username.isEmpty()) {
String msg = "Received null user name for getGroups";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Get groups of owner '" + username + "'");
}
Map<Integer, DeviceGroup> groups = new HashMap<>();
UserStoreManager userStoreManager;
try {
@ -245,11 +348,20 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
groups.put(deviceGroup.getGroupId(), deviceGroup);
}
} catch (UserStoreException e) {
throw new GroupManagementException("Error occurred while getting user store manager.", e);
String msg = "Error occurred while getting user store manager.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while retrieving all groups accessible to user.", e);
String msg = "Error occurred while retrieving all groups accessible to user.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (GroupManagementDAOException e) {
log.error(e);
throw new GroupManagementException(e);
} catch (Exception e) {
String msg = "Error occurred in getGroups for " + username;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -257,6 +369,14 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
}
private List<Integer> getGroupIds(String username) throws GroupManagementException {
if (username == null || username.isEmpty()) {
String msg = "Received empty user name for getGroupIds";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Get groups Ids of owner '" + username + "'");
}
UserStoreManager userStoreManager;
List<Integer> deviceGroupIds = new ArrayList<>();
try {
@ -268,11 +388,20 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
deviceGroupIds = this.groupDAO.getOwnGroupIds(username, tenantId);
deviceGroupIds.addAll(this.groupDAO.getGroupIds(roleList, tenantId));
} catch (UserStoreException e) {
throw new GroupManagementException("Error occurred while getting user store manager.", e);
String msg = "Error occurred while getting user store manager.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while retrieving all groups accessible to user.", e);
String msg = "Error occurred while retrieving all groups accessible to user.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (GroupManagementDAOException e) {
log.error(e);
throw new GroupManagementException(e);
} catch (Exception e) {
String msg = "Error occurred in getGroups for username '" + username + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -282,6 +411,14 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public PaginationResult getGroups(String currentUser, GroupPaginationRequest request)
throws GroupManagementException {
if (currentUser == null || request == null) {
String msg = "Received incomplete date for getGroups";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Get all groups of user '" + currentUser + "' pagination request " + request.toString());
}
request = DeviceManagerUtil.validateGroupListPageSize(request);
List<Integer> allDeviceGroupIdsOfUser = getGroupIds(currentUser);
List<DeviceGroup> allMatchingGroups = new ArrayList<>();
@ -290,9 +427,17 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
GroupManagementDAOFactory.openConnection();
allMatchingGroups = this.groupDAO.getGroups(request, allDeviceGroupIdsOfUser, tenantId);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while retrieving all groups in tenant", e);
String msg = "Error occurred while retrieving all groups in tenant";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getGroups";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -304,28 +449,55 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public int getGroupCount() throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Get groups count");
}
try {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
GroupManagementDAOFactory.openConnection();
return groupDAO.getGroupCount(tenantId);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while retrieving all groups in tenant", e);
String msg = "Error occurred while retrieving all groups in tenant";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
}
private int getGroupCount(GroupPaginationRequest request) throws GroupManagementException {
if (request == null) {
String msg = "Received empty request for getGroupCount";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Get groups count, pagination request " + request.toString());
}
try {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
GroupManagementDAOFactory.openConnection();
return groupDAO.getGroupCount(request, tenantId);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while retrieving all groups in tenant", e);
String msg = "Error occurred while retrieving all groups in tenant";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getGroupCount";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -336,6 +508,14 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
*/
@Override
public int getGroupCount(String username) throws GroupManagementException {
if (username == null || username.isEmpty()) {
String msg = "Received empty user name for getGroupCount";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Get groups count of '" + username + "'");
}
UserStoreManager userStoreManager;
int count;
try {
@ -348,11 +528,21 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
count += groupDAO.getGroupsCount(roleList, tenantId);
return count;
} catch (UserStoreException e) {
throw new GroupManagementException("Error occurred while getting user store manager.", e);
String msg = "Error occurred while getting user store manager.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while retrieving group count of user '" + username + "'", e);
String msg = "Error occurred while retrieving group count of user '" + username + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getGroupCount for username '" + username + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -364,41 +554,52 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public void manageGroupSharing(int groupId, List<String> newRoles)
throws GroupManagementException, RoleDoesNotExistException {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
UserStoreManager userStoreManager;
try {
userStoreManager =
DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm(
tenantId).getUserStoreManager();
List<String> currentUserRoles = getRoles(groupId);
GroupManagementDAOFactory.beginTransaction();
if (newRoles != null) {
for (String role : newRoles) {
if (!userStoreManager.isExistingRole(role)) {
throw new RoleDoesNotExistException("Role '" + role + "' does not exists in the user store.");
}
// Removing role from current user roles of the group will return true if role exist.
// So we don't need to add it to the db again.
if (!currentUserRoles.remove(role)) {
// If group doesn't have the role, it is adding to the db.
groupDAO.addRole(groupId, role, tenantId);
}
if (log.isDebugEnabled()) {
log.debug("Manage group sharing for group: " + groupId);
}
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
UserStoreManager userStoreManager;
try {
userStoreManager =
DeviceManagementDataHolder.getInstance().getRealmService().getTenantUserRealm(
tenantId).getUserStoreManager();
List<String> currentUserRoles = getRoles(groupId);
GroupManagementDAOFactory.beginTransaction();
if (newRoles != null) {
for (String role : newRoles) {
if (!userStoreManager.isExistingRole(role)) {
throw new RoleDoesNotExistException("Role '" + role + "' does not exists in the user store.");
}
// Removing role from current user roles of the group will return true if role exist.
// So we don't need to add it to the db again.
if (!currentUserRoles.remove(role)) {
// If group doesn't have the role, it is adding to the db.
groupDAO.addRole(groupId, role, tenantId);
}
}
for (String role : currentUserRoles) {
// Removing old roles from db which are not available in the new roles list.
groupDAO.removeRole(groupId, role, tenantId);
}
GroupManagementDAOFactory.commitTransaction();
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
throw new GroupManagementException(e);
} catch (UserStoreException e) {
throw new GroupManagementException("User store error in updating sharing roles.", e);
} catch (TransactionManagementException e) {
throw new GroupManagementException(e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
for (String role : currentUserRoles) {
// Removing old roles from db which are not available in the new roles list.
groupDAO.removeRole(groupId, role, tenantId);
}
GroupManagementDAOFactory.commitTransaction();
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
log.error(e);
throw new GroupManagementException(e);
} catch (UserStoreException e) {
String msg = "User store error in updating sharing roles.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (TransactionManagementException e) {
log.error(e);
throw new GroupManagementException(e);
} catch (Exception e) {
String msg = "Error occurred in manageGroupSharing for groupId: " + groupId;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
}
@ -407,14 +608,25 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
*/
@Override
public List<String> getRoles(int groupId) throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Group roles for group: " + groupId);
}
try {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
GroupManagementDAOFactory.openConnection();
return groupDAO.getRoles(groupId, tenantId);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while retrieving all groups in tenant", e);
String msg = "Error occurred while retrieving all groups in tenant";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getRoles for groupId: " + groupId;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -426,6 +638,9 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public List<Device> getDevices(int groupId, int startIndex, int rowCount)
throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Group devices of group: " + groupId + " start index " + startIndex + " row count " + rowCount);
}
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
List<Device> devices;
try {
@ -433,11 +648,21 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
GroupManagementDAOFactory.openConnection();
devices = this.groupDAO.getDevices(groupId, startIndex, rowCount, tenantId);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while getting devices in group.", e);
String msg = "Error occurred while getting devices in group.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (DeviceManagementException e) {
throw new GroupManagementException("Error occurred while validating the limit of the devices to be returned", e);
String msg = "Error occurred while validating the limit of the devices to be returned";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getDevices for groupId: " + groupId;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -449,13 +674,24 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
*/
@Override
public int getDeviceCount(int groupId) throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Group devices count of group: " + groupId);
}
try {
GroupManagementDAOFactory.openConnection();
return groupDAO.getDeviceCount(groupId, CarbonContext.getThreadLocalCarbonContext().getTenantId());
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while retrieving all groups in tenant", e);
String msg = "Error occurred while retrieving all groups in tenant";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening a connection to the data source.", e);
String msg = "Error occurred while opening a connection to the data source.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getDeviceCount for groupId: " + groupId;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -467,6 +703,9 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public void addDevices(int groupId, List<DeviceIdentifier> deviceIdentifiers)
throws GroupManagementException, DeviceNotFoundException {
if (log.isDebugEnabled()) {
log.debug("Group devices to the group: " + groupId);
}
Device device;
try {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
@ -483,12 +722,22 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
}
GroupManagementDAOFactory.commitTransaction();
} catch (DeviceManagementException e) {
throw new GroupManagementException("Error occurred while retrieving device.", e);
String msg = "Error occurred while retrieving device.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
throw new GroupManagementException("Error occurred while adding device to group.", e);
String msg = "Error occurred while adding device to group.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (TransactionManagementException e) {
throw new GroupManagementException("Error occurred while initiating transaction.", e);
String msg = "Error occurred while initiating transaction.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in addDevices for groupId " + groupId;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -500,6 +749,9 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
@Override
public void removeDevice(int groupId, List<DeviceIdentifier> deviceIdentifiers)
throws GroupManagementException, DeviceNotFoundException {
if (log.isDebugEnabled()) {
log.debug("Remove devices from the group: " + groupId);
}
Device device;
try {
int tenantId = CarbonContext.getThreadLocalCarbonContext().getTenantId();
@ -514,12 +766,22 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
}
GroupManagementDAOFactory.commitTransaction();
} catch (DeviceManagementException e) {
throw new GroupManagementException("Error occurred while retrieving device.", e);
String msg = "Error occurred while retrieving device.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (TransactionManagementException e) {
throw new GroupManagementException("Error occurred while initiating transaction.", e);
String msg = "Error occurred while initiating transaction.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (GroupManagementDAOException e) {
GroupManagementDAOFactory.rollbackTransaction();
throw new GroupManagementException("Error occurred while adding device to group.", e);
String msg = "Error occurred while adding device to group.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in removeDevice for groupId: " + groupId;
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -530,6 +792,9 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
*/
@Override
public List<DeviceGroup> getGroups(String username, String permission) throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Get groups of user '" + username + "'");
}
List<DeviceGroup> deviceGroups = getGroups(username);
Map<Integer, DeviceGroup> permittedDeviceGroups = new HashMap<>();
UserRealm userRealm;
@ -546,13 +811,27 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
}
}
} catch (UserStoreException e) {
throw new GroupManagementException("Error occurred while getting user realm.", e);
String msg = "Error occurred while getting user realm.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getGroups for username '" + username + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
}
return new ArrayList<>(permittedDeviceGroups.values());
}
@Override
public List<DeviceGroup> getGroups(DeviceIdentifier deviceIdentifier) throws GroupManagementException {
if (deviceIdentifier == null) {
String msg = "Received empty device identifier for getGroups";
log.error(msg);
throw new GroupManagementException(msg);
}
if (log.isDebugEnabled()) {
log.debug("Get groups of device " + deviceIdentifier.getId());
}
DeviceManagementProviderService managementProviderService = new DeviceManagementProviderServiceImpl();
try {
Device device = managementProviderService.getDevice(deviceIdentifier, false);
@ -560,11 +839,21 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
return groupDAO.getGroups(device.getId(),
PrivilegedCarbonContext.getThreadLocalCarbonContext().getTenantId());
} catch (DeviceManagementException e) {
throw new GroupManagementException("Error occurred while retrieving the device details.", e);
String msg = "Error occurred while retrieving the device details.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (GroupManagementDAOException e) {
throw new GroupManagementException("Error occurred while retrieving device groups.", e);
String msg = "Error occurred while retrieving device groups.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (SQLException e) {
throw new GroupManagementException("Error occurred while opening database connection.", e);
String msg = "Error occurred while opening database connection.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in getGroups";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} finally {
GroupManagementDAOFactory.closeConnection();
}
@ -575,7 +864,9 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
*/
@Override
public DeviceGroup createDefaultGroup(String groupName) throws GroupManagementException {
if (log.isDebugEnabled()) {
log.debug("Create default group " + groupName);
}
DeviceGroup defaultGroup = this.getGroup(groupName);
if (defaultGroup == null) {
defaultGroup = new DeviceGroup(groupName);
@ -586,10 +877,13 @@ public class GroupManagementProviderServiceImpl implements GroupManagementProvid
this.createGroup(defaultGroup, DeviceGroupConstants.Roles.DEFAULT_ADMIN_ROLE,
DeviceGroupConstants.Permissions.DEFAULT_ADMIN_PERMISSIONS);
} catch (GroupAlreadyExistException e) {
if (log.isDebugEnabled()) {
log.debug("Default group: " + defaultGroup.getName() + " already exists. Skipping group creation.",
e);
}
String msg = "Default group: " + defaultGroup.getName() + " already exists. Skipping group creation.";
log.error(msg, e);
throw new GroupManagementException(msg, e);
} catch (Exception e) {
String msg = "Error occurred in createDefaultGroup for groupName '" + groupName + "'";
log.error(msg, e);
throw new GroupManagementException(msg, e);
}
return this.getGroup(groupName);
} else {

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -237,10 +237,12 @@
data-search="{{status}}"
data-display="{{status}}">
</td>
<td class="text-right content-fill text-left-on-grid-view no-wrap">
<td class="text-right content-fill text-left-on-grid-view no-wrap tooltip-overflow-fix">
<!--suppress HtmlUnknownTarget -->
<a href="{{@app.context}}/policy/edit?id={{id}}&deviceType={{platform}}"
data-id="{{id}}"
data-toggle="tooltip"
data-original-title="Edit"
data-click-event="remove-form"
class="btn padding-reduce-on-grid-view policy-update-link">
<span class="fw-stack">

@ -385,4 +385,7 @@ $(document).ready(function () {
$("#policy-listing-status").removeClass("hidden");
}
$("#policy-grid").removeClass("hidden");
$('[data-toggle="tooltip"]').tooltip();
});

@ -37,6 +37,14 @@
</li>
{{/zone}}
{{#zone "navbarActions"}}
{{#if canEdit}}
<li id="policy-edit">
</li>
{{/if}}
{{/zone}}
{{#zone "content"}}
{{unit "cdmf.unit.device.operation-mod"}}
{{unit "cdmf.unit.policy.view"}}

@ -17,7 +17,14 @@
*/
function onRequest(context) {
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var utility = require("/app/modules/utility.js")["utility"];
var deviceType = request.getParameter("type");
return {"deviceTypePolicyView": utility.getTenantedDeviceUnitName(deviceType, "policy-view")};
var canEdit = false;
if(userModule.isAuthorized("/permission/admin/device-mgt/policy/manage")) {
canEdit = true;
}
return {"deviceTypePolicyView": utility.getTenantedDeviceUnitName(deviceType, "policy-view"), "canEdit": canEdit};
}

@ -150,6 +150,8 @@ function loadRoles() {
var innerhtml = '';
var isAdminRole = $("#role-table").data("role") === data.name;
var editLink = '<a onclick="javascript:loadRoleBasedActionURL(\'edit\', \'' + data.name + '\')" ' +
'data-role="' + data.name + '" ' +
'data-click-event="edit-form" ' +
@ -196,7 +198,7 @@ function loadRoles() {
'<span class="hidden-xs hidden-on-grid-view">Remove</span>' +
'</a>';
if (!isCloud) {
if (!isCloud && !isAdminRole) {
innerhtml = editLink + editPermissionLink + removeLink;
}
return innerhtml;

@ -35,6 +35,21 @@
</li>
{{/zone}}
{{#zone "navbarActions"}}
{{#if canEdit}}
<li>
<a href="{{@app.context}}/user/edit?username={{user.username}}" data-username="{{user.username}}"
data-click-event="edit-form" class="btn padding-reduce-on-grid-view edit-user-link">
<span class="fw-stack">
<i class="fw fw-circle-outline fw-stack-2x"></i>
<i class="fw fw-edit fw-stack-1x"></i>
</span>
Edit
</a>
</li>
{{/if}}
{{/zone}}
{{#zone "content"}}
{{#if canView}}
{{#if exists}}

@ -18,8 +18,6 @@
function onRequest(context) {
var userModule = require("/app/modules/business-controllers/user.js")["userModule"];
var username = request.getParameter("username");
var user = userModule.getUser(username)["content"];
var deviceMgtProps = require("/app/modules/conf-reader/main.js")["conf"];
var isExsistingUser = false;
var userName = request.getParameter("username");
@ -48,7 +46,14 @@ function onRequest(context) {
canView = true;
}
var canEdit = false;
if (userModule.isAuthorized("/permission/admin/device-mgt/users/edit") &&
userName !== deviceMgtProps['adminUser'].split("@")[0]) {
canEdit = true;
}
var isCloud = deviceMgtProps.isCloud;
return {"exists": isExsistingUser, "user": user, "userRoles": userRoles, "devices": devices, "canView": canView, "isCloud" : isCloud};
return {"exists": isExsistingUser, "user": user, "userRoles": userRoles, "devices": devices, "canEdit": canEdit,
"canView": canView, "isCloud" : isCloud};
}

@ -89,10 +89,11 @@ $("a#invite-user-link").click(function () {
modalDialog.hide();
});
},
function () {
function (data) {
var msg = JSON.parse(data.responseText);
modalDialog.header('<span class="fw-stack"> <i class="fw fw-circle-outline fw-stack-2x"></i> <i class="fw ' +
'fw-error fw-stack-1x"></i> </span> Unexpected Error !');
modalDialog.content('An unexpected error occurred. Try again later.');
modalDialog.content(msg.message);
modalDialog.footer('<div class="buttons"><a href="#" id="invite-user-error-link" ' +
'class="btn-operations">Ok </a></div>');
$("a#invite-user-error-link").click(function () {
@ -293,7 +294,10 @@ function loadUsers() {
//noinspection JSUnusedLocalSymbols
var fnCreatedRow = function (nRow, aData, iDataIndex) {
$(nRow).attr('data-type', 'selectable');
var adminUser = $("#user-table").data("user");
if (adminUser !== aData["filter"]) {
$(nRow).attr('data-type', 'selectable');
}
$(nRow).attr('data-username', aData["filter"]);
};

@ -66,6 +66,7 @@ var displayPolicy = function (policyPayloadObj) {
$("#roles-row").addClass("hidden");
}
var policyId = policyPayloadObj["id"];
var deviceType = policy["platform"];
var policyOperations = $("#policy-operations");
var policyViewTemplateSrc = $(policyOperations).data("template");
@ -110,6 +111,23 @@ var displayPolicy = function (policyPayloadObj) {
if (!hasPolicyProfileScript) {
populateGenericProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]);
}
var policyEditContent =
"<a href=" + context + "/policy/edit?id=" + policyId + "&deviceType=" + deviceType + "\n" +
"data-id=" + policyId +
"data-toggle=\"tooltip\"\n" +
"data-original-title=\"Edit\"\n" +
"data-click-event=\"remove-form\"\n" +
"class=\"btn remove-margin padding-reduce-on-grid-view policy-update-link\">" +
"<span class=\"fw-stack\">" +
"<i class=\"fw fw-circle-outline fw-stack-2x\"></i>" +
"<i class=\"fw fw-edit fw-stack-1x\"></i>" +
"</span>" +
" Edit" +
"</a>";
$("#policy-edit").html(policyEditContent);
};
/**

@ -19,68 +19,80 @@
<div class="row">
<div class="col-md-12">
<!-- content -->
<div id="role-create-form" data-cloud={{isCloud}} class="container col-centered wr-content">
<div class="wr-form">
<p class="page-sub-title">Edit Role</p>
<p>Please note that * sign represents required fields of data.</p>
<hr/>
<div class="row">
<div class="col-lg-8">
<div id="role-create-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<label class="wr-input-label">Domain</label>
<div class="wr-input-control">
<select id="domain" class="form-control select" disabled>
<option>{{userStore}}</option>
</select>
</div>
<label class="wr-input-label">
Role Name *
</label>
<br>
<label class="wr-input-label" id="roleNameValidationText">
( {{roleNameHelpText}} )
</label>
{{#if isCloud}}
<div id="roleNameField" class="form-group wr-input-control input-group">
<!--suppress HtmlFormInputWithoutLabel -->
<span class="input-group-addon" id="basic-addon1">devicemgt</span>
<input aria-describedby="basic-addon1" type="text" id="rolename"
data-regex="{{roleNameJSRegEx}}"
data-errormsg="{{roleNameRegExViolationErrorMsg}}" class="form-control"
data-currentrole="{{role.roleName}}"
value="{{role.roleName}}"/>
{{else}}
<div id="roleNameField" class="form-group wr-input-control">
<input type="text" id="rolename" data-regex="{{roleNameJSRegEx}}"
data-errormsg="{{roleNameRegExViolationErrorMsg}}" class="form-control"
data-currentrole="{{role.roleName}}"
value="{{role.roleName}}"/>
{{/if}}
{{#if isAdminRole}}
<div class="container col-centered wr-content">
<div class="wr-form">
<p class="page-sub-title">Attention!</p>
<hr/>
<br>This is an prohibited action.
</div>
</div>
{{else}}
<div id="role-create-form" data-cloud={{isCloud}} class="container">
<div class="wr-form">
<p class="page-sub-title">Edit Role</p>
<p>Please note that * sign represents required fields of data.</p>
<hr/>
<div class="row">
<div class="col-lg-8">
<div id="role-create-error-msg" class="alert alert-danger hidden" role="alert">
<i class="icon fw fw-error"></i><span></span>
</div>
<label class="wr-input-label">Domain</label>
<div class="wr-input-control">
<select id="domain" class="form-control select" disabled>
<option>{{userStore}}</option>
</select>
</div>
<label class="wr-input-label">
Role Name *
</label>
<br>
<label class="wr-input-label" id="roleNameValidationText">
( {{roleNameHelpText}} )
</label>
{{#if isCloud}}
<div id="roleNameField" class="form-group wr-input-control input-group">
<!--suppress HtmlFormInputWithoutLabel -->
<span class="input-group-addon" id="basic-addon1">devicemgt</span>
<input aria-describedby="basic-addon1" type="text" id="rolename"
data-regex="{{roleNameJSRegEx}}"
data-errormsg="{{roleNameRegExViolationErrorMsg}}" class="form-control"
data-currentrole="{{role.roleName}}"
value="{{role.roleName}}"/>
</div>
{{else}}
<div id="roleNameField" class="form-group wr-input-control">
<input type="text" id="rolename" data-regex="{{roleNameJSRegEx}}"
data-errormsg="{{roleNameRegExViolationErrorMsg}}" class="form-control"
data-currentrole="{{role.roleName}}"
value="{{role.roleName}}"/>
</div>
{{/if}}
<span class=" rolenameError hidden glyphicon glyphicon-remove form-control-feedback"></span>
<label class="error rolenameEmpty hidden" for="summary">Role name is required & Should be in
minimum 3 characters long and do not
include any whitespaces. </label>
minimum 3 characters long and do not
include any whitespaces. </label>
<br>
<button id="add-role-btn" class="wr-btn">Update Role</button>
<div id="role-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form">
<p class="page-sub-title">Role was updated successfully.</p>
<br>You will be redirected to Roles Listing Page in a moment.
</div>
</div>
<!-- /content -->
<div id="app-context" data-app-context="{{@app.context}}" class="hidden"></div>
</div>
</div>
</div>
<br>
<button id="add-role-btn" class="wr-btn">Update Role</button>
</div>
</div>
<div id="role-created-msg" class="container col-centered wr-content hidden">
<div class="wr-form">
<p class="page-sub-title">Role was updated successfully.</p>
<br>You will be redirected to Roles Listing Page in a moment.
</div>
</div>
<!-- /content -->
<div id="app-context" data-app-context="{{@app.context}}" class="hidden"></div>
</div>
{{/if}}
</div>
<!-- /content/body -->
{{#zone "bottomJs"}}
{{js "js/bottomJs.js"}}
{{/zone}}
</div>
<!-- /content/body -->
{{#zone "bottomJs"}}
{{js "js/bottomJs.js"}}
{{/zone}}

@ -31,6 +31,8 @@ function onRequest(context) {
var userStore;
context.isCloud = deviceMgtProps.isCloud;
var isAdminRole = deviceMgtProps["adminRole"] === roleName;
if (roleName) {
if (roleName.indexOf("/") > -1) {
userStore = roleName.substr(0, roleName.indexOf("/"));
@ -41,6 +43,7 @@ function onRequest(context) {
if (response["status"] == "success") {
context["role"] = response["content"];
}
context["isAdminRole"] = isAdminRole;
context["userStore"] = userStore;
context["roleNameJSRegEx"] = deviceMgtProps["roleValidationConfig"]["roleNameJSRegEx"];
context["roleNameHelpText"] = deviceMgtProps["roleValidationConfig"]["roleNameHelpMsg"];

@ -293,4 +293,20 @@ ul#noty_topRight_layout_container li{
a.new-notification {
text-transform: capitalize;
}
}
/**
* This is to fix the issue https://github.com/wso2/product-iots/issues/1354.
* Proper fix should be given for this.
*/
.modal {
z-index: 1000;
}
.modal-backdrop {
z-index: 999;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice {
color: #0f0f0f;
}

@ -4186,7 +4186,7 @@ a.wr-side-panel-toggle-btn.selected {
.wr-help-tip {
font-size: 14px;
padding: 0 10px;
padding-left: 10px;
color: #666;
}

@ -23,7 +23,7 @@
<parent>
<artifactId>device-mgt</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>email-sender</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -65,8 +65,13 @@ public class EmailSenderServiceImpl implements EmailSenderService {
for (String recipient : emailCtx.getRecipients()) {
ContentProviderInfo info = emailCtx.getContentProviderInfo();
EmailData emailData;
String transportSenderName = "mailto";
try {
emailData = contentProvider.getContent(info.getTemplate(), info.getParams());
if(EmailSenderDataHolder.getInstance().getConfigurationContextService()
.getServerConfigContext().getAxisConfiguration().getTransportOut(transportSenderName) == null){
throw new EmailSendingFailedException("Email transport is not configured.");
}
} catch (ContentProcessingInterruptedException e) {
throw new EmailSendingFailedException("Error occurred while retrieving email content to be " +
"sent for recipient '" + recipient + "'", e);

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,13 +22,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>identity-extensions</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.oauth.extensions</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - OAuth Extensions</name>
<url>http://wso2.org</url>

@ -21,7 +21,7 @@
<parent>
<artifactId>identity-extensions</artifactId>
<groupId>org.wso2.carbon.devicemgt</groupId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>identity-extensions</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.complex.policy.decision.point</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Decision Point</name>
<description>WSO2 Carbon - Policy Decision Point</description>

@ -3,14 +3,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.decision.point</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Decision Point</name>
<description>WSO2 Carbon - Policy Decision Point</description>

@ -3,7 +3,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
@ -11,7 +11,7 @@
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.information.point</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Information Point</name>
<description>WSO2 Carbon - Policy Information Point</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.mgt.common</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Management Common</name>
<description>WSO2 Carbon - Policy Management Common</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>policy-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.policy.mgt.core</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Policy Management Core</name>
<description>WSO2 Carbon - Policy Management Core</description>

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>policy-mgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Policy Management Component</name>
<url>http://wso2.org</url>

@ -21,14 +21,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>webapp-authenticator-framework</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>org.wso2.carbon.webapp.authenticator.framework</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>bundle</packaging>
<name>WSO2 Carbon - Web Application Authenticator Framework Bundle</name>
<description>WSO2 Carbon - Web Application Authenticator Framework Bundle</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>webapp-authenticator-framework</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Webapp Authenticator Framework</name>
<url>http://wso2.org</url>

@ -21,14 +21,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.application.extension.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - API Management Application Extension Feature</name>
<url>http://wso2.org</url>
<description>This feature contains an implementation of a api application registration, which takes care of subscription

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.handler.server.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management - APIM handler Server Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the handler for the api authentications

@ -21,13 +21,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.integration.client.feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - APIM Integration Client Feature</name>
<url>http://wso2.org</url>

@ -21,14 +21,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.apimgt.webapp.publisher.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - API Management Webapp Publisher Feature</name>
<url>http://wso2.org</url>
<description>This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>apimgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - API Management Extensions Feature</name>
<url>http://wso2.org</url>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.certificate.mgt.server.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - Certificate Management Server Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for back-end Certificate Management functionality

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>certificate-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Certificate Management Feature</name>
<url>http://wso2.org</url>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - Device Type Deployer Feature</name>
<url>http://wso2.org</url>
<description>WSO2 Carbon - Device Type Deployer Feature</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.fcm.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - FCM Based Push Notification Provider Feature</name>
<url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.http.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name>
<url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - MQTT Based Push Notification Provider Feature</name>
<url>http://wso2.org</url>
<description>WSO2 Carbon - MQTT Based Push Notification Provider Feature</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - XMPP Based Push Notification Provider Feature</name>
<url>http://wso2.org</url>
<description>WSO2 Carbon - XMPP Based Push Notification Provider Feature</description>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -3,13 +3,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.analytics.dashboard.feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management Dashboard Analytics Feature</name>
<description>WSO2 Carbon - Device Management Dashboard Analytics Feature</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.analytics.data.publisher.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Server Feature</name>
<url>http://wso2.org</url>
<description>This feature contains bundles related to device analytics data publisher</description>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -4,14 +4,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.extensions.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Extensions Feature</name>
<url>http://wso2.org</url>
<description>This feature contains common extensions used by key device management functionalities

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.server.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - Device Management Server Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for Back-end Device Management functionality

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>device-mgt-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>

@ -22,7 +22,7 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>email-sender-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.email.sender.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - Email Sender Feature</name>
<url>http://wso2.org</url>
<description>This feature contains the core bundles required for email sender related functionality

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>email-sender-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Email Sender Feature</name>
<url>http://wso2.org</url>

@ -23,14 +23,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>jwt-client-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.identity.jwt.client.extension.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - JWT Client Feature</name>
<url>http://wso2.org</url>
<description>This feature contains jwt client implementation from which we can get a access token using the jwt

@ -23,13 +23,13 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>jwt-client-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - JWT Client Extension Feature</name>
<url>http://wso2.org</url>

@ -23,14 +23,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>oauth-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>org.wso2.carbon.device.mgt.oauth.extensions.feature</artifactId>
<packaging>pom</packaging>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<name>WSO2 Carbon - Device Mgt OAuth Extensions Feature</name>
<url>http://wso2.org</url>
<description>This feature contains devicemgt related OAuth extensions</description>

@ -22,14 +22,14 @@
<parent>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>carbon-devicemgt</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>
<modelVersion>4.0.0</modelVersion>
<groupId>org.wso2.carbon.devicemgt</groupId>
<artifactId>oauth-extensions-feature</artifactId>
<version>3.0.89-SNAPSHOT</version>
<version>3.0.101-SNAPSHOT</version>
<packaging>pom</packaging>
<name>WSO2 Carbon - Device Management OAuth Extensions Feature</name>
<url>http://wso2.org</url>

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save