diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml index c3b257f504..ff3012e10e 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.annotations/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.annotations - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - API Management Annotations WSO2 Carbon - API Management Custom Annotation Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml index a48a6ef2e8..74aa6fd76b 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/pom.xml @@ -21,12 +21,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT org.wso2.carbon.apimgt.application.extension.api war WSO2 Carbon - API Application Management API @@ -173,6 +173,11 @@ org.wso2.carbon.device.mgt.common provided + + org.wso2.carbon + org.wso2.carbon.registry.core + provided + diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java index 9c1dfac4bd..5f05dfb337 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/filter/ApiPermissionFilter.java @@ -56,6 +56,9 @@ public class ApiPermissionFilter implements Filter { PermissionConfiguration permissionConfiguration = (PermissionConfiguration) unmarshaller.unmarshal(permissionStream); permissions = permissionConfiguration.getPermissions(); + for (Permission permission : permissions) { + APIUtil.putPermission(PERMISSION_PREFIX + permission.getPath()); + } } catch (JAXBException e) { log.error("invalid permissions.xml", e); } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/util/APIUtil.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/util/APIUtil.java index a3830019a5..cdce160c54 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/util/APIUtil.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/java/org/wso2/carbon/apimgt/application/extension/api/util/APIUtil.java @@ -21,12 +21,18 @@ package org.wso2.carbon.apimgt.application.extension.api.util; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; import org.wso2.carbon.apimgt.application.extension.APIManagementProviderService; +import org.wso2.carbon.base.MultitenantConstants; import org.wso2.carbon.context.PrivilegedCarbonContext; import org.wso2.carbon.device.mgt.common.DeviceManagementException; import org.wso2.carbon.device.mgt.core.service.DeviceManagementProviderService; +import org.wso2.carbon.registry.api.Resource; +import org.wso2.carbon.registry.core.Registry; +import org.wso2.carbon.registry.core.exceptions.RegistryException; +import org.wso2.carbon.registry.core.service.RegistryService; import org.wso2.carbon.user.core.service.RealmService; import java.util.List; +import java.util.StringTokenizer; /** * This class provides utility functions used by REST-API. @@ -35,6 +41,8 @@ public class APIUtil { private static Log log = LogFactory.getLog(APIUtil.class); private static final String DEFAULT_CDMF_API_TAG = "device_management"; + private static final String DEFAULT_CERT_API_TAG = "scep_management"; + public static final String PERMISSION_PROPERTY_NAME = "name"; public static String getAuthenticatedUser() { PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext(); @@ -48,8 +56,7 @@ public class APIUtil { public static String getTenantDomainOftheUser() { PrivilegedCarbonContext threadLocalCarbonContext = PrivilegedCarbonContext.getThreadLocalCarbonContext(); - String tenantDomain = threadLocalCarbonContext.getTenantDomain(); - return tenantDomain; + return threadLocalCarbonContext.getTenantDomain(); } public static APIManagementProviderService getAPIManagementProviderService() { @@ -92,6 +99,55 @@ public class APIUtil { //Todo get allowed cdmf service tags from config. List allowedApisTags = getDeviceManagementProviderService().getAvailableDeviceTypes(); allowedApisTags.add(DEFAULT_CDMF_API_TAG); + allowedApisTags.add(DEFAULT_CERT_API_TAG); return allowedApisTags; } + + public static void putPermission(String permission) { + try { + StringTokenizer tokenizer = new StringTokenizer(permission, "/"); + String lastToken = "", currentToken, tempPath; + while (tokenizer.hasMoreTokens()) { + currentToken = tokenizer.nextToken(); + tempPath = lastToken + "/" + currentToken; + if (!checkResourceExists(tempPath)) { + createRegistryCollection(tempPath, currentToken); + + } + lastToken = tempPath; + } + } catch (org.wso2.carbon.registry.api.RegistryException e) { + log.error("Failed to creation permission in registry" + permission, e); + } + } + + public static void createRegistryCollection(String path, String resourceName) + throws org.wso2.carbon.registry.api.RegistryException { + Resource resource = getGovernanceRegistry().newCollection(); + resource.addProperty(PERMISSION_PROPERTY_NAME, resourceName); + getGovernanceRegistry().beginTransaction(); + getGovernanceRegistry().put(path, resource); + getGovernanceRegistry().commitTransaction(); + } + + public static boolean checkResourceExists(String path) + throws RegistryException { + return getGovernanceRegistry().resourceExists(path); + } + + public static Registry getGovernanceRegistry() throws RegistryException { + return getRegistryService().getGovernanceSystemRegistry(MultitenantConstants.SUPER_TENANT_ID); + } + + public static RegistryService getRegistryService() { + PrivilegedCarbonContext ctx = PrivilegedCarbonContext.getThreadLocalCarbonContext(); + RegistryService registryService = + (RegistryService) ctx.getOSGiService(RegistryService.class, null); + if (registryService == null) { + String msg = "registry service has not initialized."; + log.error(msg); + throw new IllegalStateException(msg); + } + return registryService; + } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/permissions.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/permissions.xml index 0124990741..591725fa12 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/permissions.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/META-INF/permissions.xml @@ -37,14 +37,14 @@ Register application - /device-mgt/user/api/application + /device-mgt/api/application /register POST application_user Delete application - /device-mgt/user/api/application + /device-mgt/api/application /unregister DELETE application_user diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml index e771ee6c09..9850eb5da5 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.api/src/main/webapp/WEB-INF/web.xml @@ -35,10 +35,6 @@ CXFServlet /* - - isAdminService - false - doAuthentication true diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml index 0b3e9061a1..9d36ef9b70 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.application.extension/pom.xml @@ -22,12 +22,12 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT org.wso2.carbon.apimgt.application.extension bundle WSO2 Carbon - API Application Management diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml index 451e5ed293..e8e3b15821 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/pom.xml @@ -21,13 +21,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handlers - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - API Security Handler Component WSO2 Carbon - API Management Security Handler Module diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java index 087adce638..c5fe71dd4a 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.handlers/src/main/java/org/wso2/carbon/apimgt/handlers/AuthenticationHandler.java @@ -38,6 +38,7 @@ import java.net.URI; import java.net.URISyntaxException; import java.util.HashMap; import java.util.Map; +import java.util.StringTokenizer; /** * Synapse gateway handler for API authentication. @@ -48,6 +49,12 @@ public class AuthenticationHandler extends AbstractHandler { private HandlerDescription handlerDesc; private RESTInvoker restInvoker; + private static final String X_JWT_ASSERTION = "X-JWT-Assertion"; + private static final String JWTTOKEN = "JWTToken"; + private static final String AUTHORIZATION = "Authorization"; + private static final String BEARER = "Bearer "; + private static final String CONTENT_TYPE = "Content-Type"; + private IOTServerConfiguration iotServerConfiguration; /** @@ -62,6 +69,7 @@ public class AuthenticationHandler extends AbstractHandler { /** * Handling the message and checking the security. + * * @param messageContext * @return */ @@ -84,14 +92,9 @@ public class AuthenticationHandler extends AbstractHandler { if (log.isDebugEnabled()) { log.debug("Verify Cert:\n" + mdmSignature); } - String accessToken = Utils.getAccessToken(iotServerConfiguration); - String deviceType = this.getDeviceType(messageContext.getTo().getAddress().trim()); URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + deviceType); - - Map certVerifyHeaders = new HashMap<>(); - certVerifyHeaders.put("Authorization", "Bearer " + accessToken); - certVerifyHeaders.put("Content-Type", "application/json"); + Map certVerifyHeaders = this.setHeaders(); Certificate certificate = new Certificate(); certificate.setPem(mdmSignature); @@ -104,15 +107,16 @@ public class AuthenticationHandler extends AbstractHandler { null, certVerifyContent); String str = response.getContent(); - if (str.contains("JWTToken")) { - ValidationResponce validationResponce = gson.fromJson(str, ValidationResponce.class); - // TODO: send the JWT token with user details. - // headers.put("X-JWT-Assertion", validationResponce.getJWTToken()); - } if (log.isDebugEnabled()) { log.debug("Verify response:" + response.getContent()); log.debug("Response String : " + str); } + if (response.getHttpStatus() == 200 && str.contains(JWTTOKEN)) { + ValidationResponce validationResponce = gson.fromJson(str, ValidationResponce.class); + headers.put(X_JWT_ASSERTION, validationResponce.getJWTToken()); + } else { + return false; + } } else if (headers.containsKey(AuthConstants.PROXY_MUTUAL_AUTH_HEADER)) { String subjectDN = headers.get(AuthConstants.PROXY_MUTUAL_AUTH_HEADER).toString(); @@ -120,12 +124,10 @@ public class AuthenticationHandler extends AbstractHandler { if (log.isDebugEnabled()) { log.debug("Verify subject DN: " + subjectDN); } - String accessToken = Utils.getAccessToken(iotServerConfiguration); + String deviceType = this.getDeviceType(messageContext.getTo().getAddress().trim()); URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + deviceType); - Map certVerifyHeaders = new HashMap<>(); - certVerifyHeaders.put("Authorization", "Bearer " + accessToken); - certVerifyHeaders.put("Content-Type", "application/json"); + Map certVerifyHeaders = this.setHeaders(); Certificate certificate = new Certificate(); certificate.setPem(subjectDN); certificate.setTenantId(tenantId); @@ -143,11 +145,9 @@ public class AuthenticationHandler extends AbstractHandler { if (log.isDebugEnabled()) { log.debug("Verify Cert:\n" + encodedPem); } - String accessToken = Utils.getAccessToken(iotServerConfiguration); - URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + "android"); - Map certVerifyHeaders = new HashMap<>(); - certVerifyHeaders.put("Authorization", "Bearer " + accessToken); - certVerifyHeaders.put("Content-Type", "application/json"); + String deviceType = this.getDeviceType(messageContext.getTo().getAddress().trim()); + URI certVerifyUrl = new URI(iotServerConfiguration.getVerificationEndpoint() + deviceType); + Map certVerifyHeaders = this.setHeaders(); Certificate certificate = new Certificate(); certificate.setPem(encodedPem); @@ -188,13 +188,21 @@ public class AuthenticationHandler extends AbstractHandler { } - // TODO : take this from the url. private String getDeviceType(String url) { - if (url.contains("ios")) { - return "ios"; - } else if (url.contains("android")) { - return "android"; - } else return null; + StringTokenizer parts = new StringTokenizer(url, "/"); + while (parts.hasMoreElements()) { + if (parts.nextElement().equals("api")) { + return (String) parts.nextElement(); + } + } + return null; + } + private Map setHeaders() throws APIMCertificateMGTException { + Map map = new HashMap<>(); + String accessToken = Utils.getAccessToken(iotServerConfiguration); + map.put(AUTHORIZATION, BEARER + accessToken); + map.put(CONTENT_TYPE, "application/json"); + return map; } } diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml index aee804b2e5..cde47a7f60 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/pom.xml @@ -22,13 +22,13 @@ apimgt-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - API Management Webapp Publisher WSO2 Carbon - API Management Webapp Publisher diff --git a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java index 8c95252db8..2c2f21f19c 100644 --- a/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java +++ b/components/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher/src/main/java/org/wso2/carbon/apimgt/webapp/publisher/lifecycle/util/AnnotationProcessor.java @@ -73,6 +73,10 @@ public class AnnotationProcessor { private static final String SWAGGER_ANNOTATIONS_PROPERTIES_CONTEXT = "context"; private static final String SWAGGER_ANNOTATIONS_PROPERTIES_VALUE = "value"; private static final String ANNOTATIONS_SCOPES = "scopes"; + private static final String ANNOTATIONS_SCOPE = "scope"; + private static final String DEFAULT_SCOPE_NAME = "default admin scope"; + private static final String DEFAULT_SCOPE_KEY = "perm:admin"; + private static final String DEFAULT_SCOPE_PERMISSION = "/permision/device-mgt"; private static final String PERMISSION_PREFIX = "/permission/admin"; @@ -273,7 +277,19 @@ public class AnnotationProcessor { resource.setProduces(invokeMethod(producesClassMethods[0], producesAnno, STRING_ARR)); } if (annotations[i].annotationType().getName().equals(ApiOperation.class.getName())) { - resource.setScope(this.getScope(annotations[i])); + Scope scope = this.getScope(annotations[i]); + if (scope != null) { + resource.setScope(scope); + } else { + log.warn("Scope is not defined for '" + makeContextURLReady(resourceRootContext) + + makeContextURLReady(subCtx) + "' endpoint, hence assigning the default scope"); + scope = new Scope(); + scope.setName(DEFAULT_SCOPE_NAME); + scope.setDescription(DEFAULT_SCOPE_NAME); + scope.setKey(DEFAULT_SCOPE_KEY); + scope.setRoles(DEFAULT_SCOPE_PERMISSION); + resource.setScope(scope); + } } } resourceList.add(resource); @@ -444,18 +460,25 @@ public class AnnotationProcessor { InvocationHandler methodHandler = Proxy.getInvocationHandler(currentMethod); Annotation[] extensions = (Annotation[]) methodHandler.invoke(currentMethod, apiOperation.getMethod(SWAGGER_ANNOTATIONS_EXTENSIONS, null), null); - methodHandler = Proxy.getInvocationHandler(extensions[0]); - Annotation[] properties = (Annotation[])methodHandler.invoke(extensions[0], extensionClass - .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES,null), null); - - for (Annotation property : properties) { - methodHandler = Proxy.getInvocationHandler(property); - String scopeKey = (String) methodHandler.invoke(property, extensionPropertyClass - .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES_VALUE, null),null); - if (scopeKey.isEmpty()) { - return null; + if (extensions != null) { + methodHandler = Proxy.getInvocationHandler(extensions[0]); + Annotation[] properties = (Annotation[]) methodHandler.invoke(extensions[0], extensionClass + .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES, null), null); + String scopeKey; + String propertyName; + for (Annotation property : properties) { + methodHandler = Proxy.getInvocationHandler(property); + propertyName = (String) methodHandler.invoke(property, extensionPropertyClass + .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES_NAME, null), null); + if (ANNOTATIONS_SCOPE.equals(propertyName)) { + scopeKey = (String) methodHandler.invoke(property, extensionPropertyClass + .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES_VALUE, null), null); + if (scopeKey.isEmpty()) { + return null; + } + return apiScopes.get(scopeKey); + } } - return apiScopes.get(scopeKey); } return null; } diff --git a/components/apimgt-extensions/pom.xml b/components/apimgt-extensions/pom.xml index 0a0d21aaa5..8720c345cb 100644 --- a/components/apimgt-extensions/pom.xml +++ b/components/apimgt-extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 apimgt-extensions - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - API Management Extensions Component http://wso2.org diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml index d0b957e510..7dd00860b1 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/WEB-INF/web.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/WEB-INF/web.xml index 93933546b5..62a814568e 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/WEB-INF/web.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.api/src/main/webapp/WEB-INF/web.xml @@ -33,11 +33,6 @@ 60 - - - isAdminService - false - doAuthentication true diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml index a6dbbaa957..72d3e072b5 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/pom.xml @@ -22,7 +22,7 @@ certificate-mgt org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java index 14d06f00f0..a2b90633ea 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/CertificateManagementAdminService.java @@ -64,6 +64,12 @@ import javax.ws.rs.core.Response; description = "Deleting an SSL Certificate", key = "perm:admin:certificates:delete", permissions = {"/device-mgt/admin/certificates/delete"} + ), + @Scope( + name = "Verify SSL certificate", + description = "Verify SSL certificate", + key = "perm:admin:certificates:verify", + permissions = {"/device-mgt/admin/certificates/verify"} ) } ) @@ -338,84 +344,8 @@ public interface CertificateManagementAdminService { defaultValue = "12438035315552875930") @PathParam("serialNumber") String serialNumber); -// /** -// * Verify IOS Certificate for the API security filter -// * -// * @param certificate to be verified as a String -// * @return Status of the certificate verification. -// */ -// @POST -// @Path("/verify/ios") -// @ApiOperation( -// consumes = MediaType.APPLICATION_JSON, -// produces = MediaType.APPLICATION_JSON, -// httpMethod = "POST", -// value = "Verify IOS SSL certificate", -// notes = "Verify IOS Certificate for the API security filter.\n", -// tags = "Certificate Management") -// @ApiResponses( -// value = { -// @ApiResponse( -// code = 200, -// message = "Return the status of the IOS certificate verification.", -// responseHeaders = { -// @ResponseHeader( -// name = "Content-Type", -// description = "The content type of the body")}), -// @ApiResponse( -// code = 400, -// message = "Bad Request. \n Invalid request or validation error.", -// response = ErrorResponse.class) -// }) -// Response verifyIOSCertificate( -// @ApiParam( -// name = "certificate", -// value = "The properties to verify certificate. It includes the following: \n" + -// "serial: The unique ID of the certificate. (optional) \n" + -// "pem: mdm-signature of the certificate", -// required = true) EnrollmentCertificate certificate); -// -// /** -// * Verify Android Certificate for the API security filter -// * -// * @param certificate to be verified as a String -// * @return Status of the certificate verification. -// */ -// @POST -// @Path("/verify/android") -// @ApiOperation( -// consumes = MediaType.APPLICATION_JSON, -// produces = MediaType.APPLICATION_JSON, -// httpMethod = "POST", -// value = "Verify Android SSL certificate", -// notes = "Verify Android Certificate for the API security filter.\n", -// tags = "Certificate Management") -// @ApiResponses( -// value = { -// @ApiResponse( -// code = 200, -// message = "Return the status of the Android certificate verification.", -// responseHeaders = { -// @ResponseHeader( -// name = "Content-Type", -// description = "The content type of the body")}), -// @ApiResponse( -// code = 400, -// message = "Bad Request. \n Invalid request or validation error.", -// response = ErrorResponse.class) -// }) -// Response verifyAndroidCertificate( -// @ApiParam( -// name = "certificate", -// value = "The properties to verify certificate. It includes the following: \n" + -// "serial: The unique ID of the certificate. (optional) \n" + -// "pem: pem String of the certificate", -// required = true) EnrollmentCertificate certificate); -// - - /** - * Verify Android Certificate for the API security filter + * Verify Certificate for the API security filter * * @param certificate to be verified as a String * @return Status of the certificate verification. @@ -426,14 +356,20 @@ public interface CertificateManagementAdminService { consumes = MediaType.APPLICATION_JSON, produces = MediaType.APPLICATION_JSON, httpMethod = "POST", - value = "Verify Android SSL certificate", - notes = "Verify Android Certificate for the API security filter.\n", - tags = "Certificate Management") + value = "Verify SSL certificate", + notes = "Verify Certificate for the API security filter.\n", + tags = "Certificate Management", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = SCOPE, value = "perm:admin:certificates:verify") + }) + } + ) @ApiResponses( value = { @ApiResponse( code = 200, - message = "Return the status of the Android certificate verification.", + message = "Return the status of the certificate verification.", responseHeaders = { @ResponseHeader( name = "Content-Type", diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java index 0f62d9e72b..3a8a39d3f8 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/java/org/wso2/carbon/certificate/mgt/cert/jaxrs/api/impl/CertificateManagementAdminServiceImpl.java @@ -27,7 +27,9 @@ import javax.ws.rs.*; import javax.ws.rs.core.Response; import java.security.cert.X509Certificate; import java.util.ArrayList; +import java.util.HashMap; import java.util.List; +import java.util.Map; @Path("/admin/certificates") public class CertificateManagementAdminServiceImpl implements CertificateManagementAdminService { @@ -230,10 +232,20 @@ public class CertificateManagementAdminServiceImpl implements CertificateManagem deviceIdentifier.setId(challengeToken); deviceIdentifier.setType(DeviceManagementConstants.MobileDeviceTypes.MOBILE_DEVICE_TYPE_IOS); TenantedDeviceWrapper tenantedDeviceWrapper = scepManager.getValidatedDevice(deviceIdentifier); +// +// var claims = {"http://wso2.org/claims/enduserTenantId": adminUserTenantId, +// "http://wso2.org/claims/enduser": adminUsername}; + + Map claims = new HashMap<>(); + + claims.put("http://wso2.org/claims/enduserTenantId", String.valueOf(tenantedDeviceWrapper.getTenantId())); + claims.put("http://wso2.org/claims/enduser", tenantedDeviceWrapper.getDevice().getEnrolmentInfo().getOwner()); + claims.put("http://wso2.org/claims/deviceIdentifier", tenantedDeviceWrapper.getDevice().getDeviceIdentifier()); + claims.put("http://wso2.org/claims/deviceIdType", tenantedDeviceWrapper.getDevice().getType()); JWTClientManagerService jwtClientManagerService = CertificateMgtAPIUtils.getJwtClientManagerService(); String jwdToken = jwtClientManagerService.getJWTClient().getJwtToken( - tenantedDeviceWrapper.getDevice().getEnrolmentInfo().getOwner()); + tenantedDeviceWrapper.getDevice().getEnrolmentInfo().getOwner(), claims); ValidationResponce validationResponce = new ValidationResponce(); validationResponce.setDeviceId(challengeToken); diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/WEB-INF/web.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/WEB-INF/web.xml index 0efd4bc25a..72020e147e 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/WEB-INF/web.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api/src/main/webapp/WEB-INF/web.xml @@ -38,11 +38,6 @@ 60 - - - isAdminService - false - doAuthentication true diff --git a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml index 1dd5a70d09..f1de4f3d62 100644 --- a/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml +++ b/components/certificate-mgt/org.wso2.carbon.certificate.mgt.core/pom.xml @@ -21,13 +21,13 @@ org.wso2.carbon.devicemgt certificate-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.core - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - Certificate Management Core WSO2 Carbon - Certificate Management Core diff --git a/components/certificate-mgt/pom.xml b/components/certificate-mgt/pom.xml index 2412934b90..9877f9bcc3 100644 --- a/components/certificate-mgt/pom.xml +++ b/components/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Certificate Management Component http://wso2.org diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml index 81ec60bbd3..26be512777 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml index 4a5bd40660..654c79e72f 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml index 20fac79e86..703f3ba348 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml index e947af9b54..3b8675d30b 100644 --- a/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml +++ b/components/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp/pom.xml @@ -22,7 +22,7 @@ device-mgt-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt-extensions/pom.xml b/components/device-mgt-extensions/pom.xml index 7a162c59ce..258484e69a 100644 --- a/components/device-mgt-extensions/pom.xml +++ b/components/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ carbon-devicemgt org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml index 7a503f37b7..b10784a845 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt device-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml index a64fae321a..4f75e85d25 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml index ce88139cb6..d93d23221d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java index 621ec26d73..2938b7bb96 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/DeviceManagementService.java @@ -29,7 +29,6 @@ import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; import io.swagger.annotations.ResponseHeader; -import org.json.JSONObject; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.mgt.common.Device; @@ -80,6 +79,12 @@ import javax.ws.rs.core.Response; key = "perm:devices:details", permissions = {"/device-mgt/devices/owning-device/view"} ), + @Scope( + name = "Update the device specified by device id", + description = "Update the device specified by device id", + key = "perm:devices:update", + permissions = {"/device-mgt/devices/owning-device/view"} + ), @Scope( name = "Delete the device specified by device id", description = "Delete the device specified by device id", diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java index 7edf7a7556..8656456f1f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/PolicyManagementService.java @@ -18,27 +18,36 @@ */ package org.wso2.carbon.device.mgt.jaxrs.service.api; -import io.swagger.annotations.SwaggerDefinition; -import io.swagger.annotations.Info; -import io.swagger.annotations.ExtensionProperty; -import io.swagger.annotations.Extension; -import io.swagger.annotations.Tag; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiParam; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.Extension; +import io.swagger.annotations.ExtensionProperty; +import io.swagger.annotations.Info; import io.swagger.annotations.ResponseHeader; +import io.swagger.annotations.SwaggerDefinition; +import io.swagger.annotations.Tag; import org.wso2.carbon.apimgt.annotations.api.Scope; import org.wso2.carbon.apimgt.annotations.api.Scopes; +import org.wso2.carbon.device.mgt.common.policy.mgt.Policy; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; import org.wso2.carbon.device.mgt.jaxrs.beans.PolicyWrapper; import org.wso2.carbon.device.mgt.jaxrs.beans.PriorityUpdatedPolicyWrapper; import org.wso2.carbon.device.mgt.jaxrs.util.Constants; -import org.wso2.carbon.device.mgt.common.policy.mgt.Policy; import javax.validation.Valid; -import javax.ws.rs.*; +import javax.validation.constraints.Size; +import javax.ws.rs.Consumes; +import javax.ws.rs.GET; +import javax.ws.rs.HeaderParam; +import javax.ws.rs.POST; +import javax.ws.rs.PUT; +import javax.ws.rs.Path; +import javax.ws.rs.PathParam; +import javax.ws.rs.Produces; +import javax.ws.rs.QueryParam; import javax.ws.rs.core.MediaType; import javax.ws.rs.core.Response; import java.util.List; @@ -118,6 +127,12 @@ import java.util.List; description = "Updating the Policy Priorities", key = "perm:policies:priorities", permissions = {"/device-mgt/policies/manage"} + ), + @Scope( + name = "Fetching the Effective Policy", + description = "Fetching the Effective Policy", + key = "perm:policies:effective-policy", + permissions = {"/device-mgt/policies/view"} ) } ) @@ -605,6 +620,69 @@ public interface PolicyManagementService { @GET @Path("/effective-policy/{deviceType}/{deviceId}") - Response getEffectivePolicy(@PathParam("deviceId") String deviceId, @PathParam("deviceType") String deviceType); - + @ApiOperation( + consumes = MediaType.APPLICATION_JSON, + produces = MediaType.APPLICATION_JSON, + httpMethod = "GET", + value = "Getting the Effective Policy", + notes = "Retrieve the effective policy of a device using this API.", + tags = "Device Policy Management", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:policies:effective-policy") + }) + } + ) + @ApiResponses( + value = { + @ApiResponse( + code = 200, + message = "OK. \n Successfully fetched the policy.", + response = Policy.class, + responseHeaders = { + @ResponseHeader( + name = "Content-Type", + description = "The content type of the body"), + @ResponseHeader( + name = "ETag", + description = "Entity Tag of the response resource.\n" + + "Used by caches, or in conditional requests."), + @ResponseHeader( + name = "Last-Modified", + description = "Date and time the resource was last modified.\n" + + "Used by caches, or in conditional requests."), + } + ), + @ApiResponse( + code = 304, + message = "Not Modified. \n Empty body because the client already has the latest version of the requested resource.\n"), + @ApiResponse( + code = 404, + message = "Not Found. \n A specified policy was not found.", + response = ErrorResponse.class), + @ApiResponse( + code = 406, + message = "Not Acceptable.\n The requested media type is not supported."), + @ApiResponse( + code = 500, + message = "Internal Server Error. \n Server error occurred while fetching the " + + "policy.", + response = ErrorResponse.class) + }) + Response getEffectivePolicy( + @ApiParam( + name = "deviceType", + value = "The device type, such as ios, android or windows.", + required = true, + allowableValues = "android, ios, windows") + @PathParam("deviceType") + @Size(max = 45) + String deviceType, + @ApiParam( + name = "deviceId", + value = "The device identifier of the device you want ot get details.", + required = true) + @PathParam("deviceId") + @Size(max = 45) + String deviceId); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java index 1b9acd0c65..ff3de73d80 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/UserManagementService.java @@ -771,11 +771,10 @@ public interface UserManagementService { value = "Sending Enrollment Invitations to email address", notes = "Send the a mail inviting recipients to enroll devices.", tags = "User Management", - authorizations = { - @Authorization( - value = "permission", - scopes = {@AuthorizationScope(scope = "/device-mgt/users/invite", description = "Invite Users")} - ) + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:users:send-invitation") + }) } ) @ApiResponses(value = { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java index bea9ebedd5..8a46b9b194 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/api/admin/DeviceAccessAuthorizationAdminService.java @@ -22,9 +22,17 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiResponse; import io.swagger.annotations.ApiResponses; +import io.swagger.annotations.Extension; +import io.swagger.annotations.ExtensionProperty; +import io.swagger.annotations.Info; +import io.swagger.annotations.SwaggerDefinition; +import io.swagger.annotations.Tag; +import org.wso2.carbon.apimgt.annotations.api.Scope; +import org.wso2.carbon.apimgt.annotations.api.Scopes; import org.wso2.carbon.device.mgt.common.authorization.DeviceAuthorizationResult; import org.wso2.carbon.device.mgt.jaxrs.beans.AuthorizationRequest; import org.wso2.carbon.device.mgt.jaxrs.beans.ErrorResponse; +import org.wso2.carbon.device.mgt.jaxrs.util.Constants; import javax.ws.rs.Consumes; import javax.ws.rs.POST; @@ -37,6 +45,32 @@ import javax.ws.rs.core.Response; @Api(value = "Device Authorization Administrative Service", description = "This an API intended to be used by " + "'internal' components to log in as an admin user and validate whether the user/device are trusted entity." + "Further, this is strictly restricted to admin users only ") + +@SwaggerDefinition( + info = @Info( + version = "1.0.0", + title = "", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = "name", value = "DeviceAccessAuthorizationAdminService"), + @ExtensionProperty(name = "context", value = "/api/device-mgt/v1.0/admin/authorization"), + }) + } + ), + tags = { + @Tag(name = "device_management", description = "") + } +) +@Scopes( + scopes = { + @Scope( + name = "Verify device authorization", + description = "Verify device authorization", + key = "perm:authorization:verify", + permissions = {"/device-mgt/authorization/verify"} + ) + } +) @Produces(MediaType.APPLICATION_JSON) @Consumes(MediaType.APPLICATION_JSON) /** @@ -52,7 +86,13 @@ public interface DeviceAccessAuthorizationAdminService { value = "Check for device access authorization\n", notes = "This is an internal API that can be used to check for authorization.", response = DeviceAuthorizationResult.class, - tags = "Authorization Administrative Service") + tags = "Authorization Administrative Service", + extensions = { + @Extension(properties = { + @ExtensionProperty(name = Constants.SCOPE, value = "perm:authorization:verify") + }) + }) + @ApiResponses(value = { @ApiResponse( code = 200, diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java index 76718d6381..7c1fe8e407 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/java/org/wso2/carbon/device/mgt/jaxrs/service/impl/PolicyManagementServiceImpl.java @@ -376,7 +376,7 @@ public class PolicyManagementServiceImpl implements PolicyManagementService { @GET @Path("/effective-policy/{deviceType}/{deviceId}") @Override - public Response getEffectivePolicy(@PathParam("deviceId") String deviceId, @PathParam("deviceType") String deviceType) { + public Response getEffectivePolicy(@PathParam("deviceType") String deviceType, @PathParam("deviceId") String deviceId) { PolicyManagerService policyManagementService = DeviceMgtAPIUtils.getPolicyManagementService(); final Policy policy; try { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/web.xml b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/web.xml index 1f3c59562b..dc7eda629b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/web.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.api/src/main/webapp/WEB-INF/web.xml @@ -40,30 +40,10 @@ 60 - - isAdminService - false - doAuthentication true - diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml index 32a3f61424..4462f70308 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.common/pom.xml @@ -21,7 +21,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml index 141027ac8f..2c0ddf4f52 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java index 01532e259e..52c59d753f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/config/permission/AnnotationProcessor.java @@ -70,7 +70,9 @@ public class AnnotationProcessor { private static final String SWAGGER_ANNOTATIONS_PROPERTIES_KEY = "key"; private static final String SWAGGER_ANNOTATIONS_PROPERTIES_PERMISSIONS = "permissions"; private static final String ANNOTATIONS_SCOPES = "scopes"; - + private static final String ANNOTATIONS_SCOPE = "scope"; + private static final String DEFAULT_PERM_NAME = "default"; + private static final String DEFAULT_PERM = "/device-mgt"; private static final String PERMISSION_PREFIX = "/permission/admin"; private StandardContext context; @@ -251,7 +253,12 @@ public class AnnotationProcessor { this.setPermission(annotations[i], permission); } } - permissions.add(permission); + if (permission.getName() == null || permission.getPath() == null) { + log.warn("Permission not assigned to the resource url - " + permission.getMethod() + ":" + + permission.getUrl()); + } else { + permissions.add(permission); + } } } return permissions; @@ -375,19 +382,33 @@ public class AnnotationProcessor { InvocationHandler methodHandler = Proxy.getInvocationHandler(currentMethod); Annotation[] extensions = (Annotation[]) methodHandler.invoke(currentMethod, apiOperation.getMethod(SWAGGER_ANNOTATIONS_EXTENSIONS, null), null); - methodHandler = Proxy.getInvocationHandler(extensions[0]); - Annotation[] properties = (Annotation[])methodHandler.invoke(extensions[0], extensionClass - .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES,null), null); - Scope scope; - for (Annotation property : properties) { - methodHandler = Proxy.getInvocationHandler(property); - String scopeKey = (String) methodHandler.invoke(property, extensionPropertyClass - .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES_VALUE, null),null); - if (!scopeKey.isEmpty()) { - scope = apiScopes.get(scopeKey); - permission.setName(scope.getName()); - //TODO: currently permission tree supports only adding one permission per API point. - permission.setPath(scope.getRoles().split(" ")[0]); + if (extensions != null) { + methodHandler = Proxy.getInvocationHandler(extensions[0]); + Annotation[] properties = (Annotation[]) methodHandler.invoke(extensions[0], extensionClass + .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES, null), null); + Scope scope; + String scopeKey; + String propertyName; + for (Annotation property : properties) { + methodHandler = Proxy.getInvocationHandler(property); + propertyName = (String) methodHandler.invoke(property, extensionPropertyClass + .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES_NAME, null), null); + if (ANNOTATIONS_SCOPE.equals(propertyName)) { + scopeKey = (String) methodHandler.invoke(property, extensionPropertyClass + .getMethod(SWAGGER_ANNOTATIONS_PROPERTIES_VALUE, null), null); + if (!scopeKey.isEmpty()) { + scope = apiScopes.get(scopeKey); + if (scope != null) { + permission.setName(scope.getName()); + //TODO: currently permission tree supports only adding one permission per API point. + permission.setPath(scope.getRoles().split(" ")[0]); + } else { + log.warn("No Scope mapping is done for scope key: " + scopeKey); + permission.setName(DEFAULT_PERM_NAME); + permission.setPath(DEFAULT_PERM); + } + } + } } } } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java index 1cd85960f0..07865c5095 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java +++ b/components/device-mgt/org.wso2.carbon.device.mgt.core/src/main/java/org/wso2/carbon/device/mgt/core/permission/mgt/PermissionManagerServiceImpl.java @@ -55,7 +55,7 @@ public class PermissionManagerServiceImpl implements PermissionManagerService { @Override public boolean addPermission(Permission permission) throws PermissionManagementException { // adding a permission to the tree - permission.setPath(PermissionUtils.getAbsolutePermissionPath(permission.getPath())); + permission.setPath(permission.getPath()); permissionTree.addPermission(permission); return PermissionUtils.putPermission(permission); } diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml index c126e47943..381405847b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.extensions/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml index 9545736da9..1fb0b5eac7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/pom.xml @@ -22,7 +22,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json index 83671e61be..573d973b3a 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/conf/config.json @@ -1,7 +1,7 @@ { "appContext": "/devicemgt/", - "httpsURL" : "https://localhost:8243", - "httpURL" : "http://localhost:8280", + "httpsURL" : "https://%server.ip%:8243", + "httpURL" : "http://%server.ip%:8280", "wssURL" : "https://localhost:9445", "wsURL" : "%http.ip%", "portalURL": "https://%server.ip%:9445", @@ -139,7 +139,9 @@ "perm:admin:certificates:delete", "perm:admin:certificates:details", "perm:admin:certificates:view", - "perm:admin:certificates:add" + "perm:admin:certificates:add", + "perm:admin:certificates:verify", + "perm:admin" ], "isOAuthEnabled" : true, "backendRestEndpoints" : { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js index 1365fed267..6ac07ce87c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/oauth/token-handlers.js @@ -28,6 +28,7 @@ var handlers = function () { var tokenUtil = require("/app/modules/oauth/token-handler-utils.js")["utils"]; var constants = require("/app/modules/constants.js"); var devicemgtProps = require("/app/modules/conf-reader/main.js")["conf"]; + var utility = require("/app/modules/utility.js")["utility"]; var publicMethods = {}; var privateMethods = {}; @@ -49,6 +50,7 @@ var handlers = function () { var tokenData; // tokenPair will include current access token as well as current refresh token var arrayOfScopes = devicemgtProps["scopes"]; + arrayOfScopes = arrayOfScopes.concat(utility.getDeviceTypesScopesList()); var stringOfScopes = ""; arrayOfScopes.forEach(function (entry) { stringOfScopes += entry + " "; @@ -78,19 +80,20 @@ var handlers = function () { publicMethods["setupTokenPairBySamlGrantType"] = function (username, samlToken) { if (!username || !samlToken) { throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up access token pair by " + - "saml grant type. Either username of logged in user, samlToken or both are missing " + - "as input - setupTokenPairByPasswordGrantType(x, y)"); + "saml grant type. Either username of logged in user, samlToken or both are missing " + + "as input - setupTokenPairBySamlGrantType(x, y)"); } else { privateMethods.setUpEncodedTenantBasedClientAppCredentials(username); privateMethods.setUpEncodedTenantBasedWebSocketClientAppCredentials(username); var encodedClientAppCredentials = session.get(constants["ENCODED_TENANT_BASED_CLIENT_APP_CREDENTIALS"]); if (!encodedClientAppCredentials) { throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up access token pair " + - "by saml grant type. Encoded client credentials are " + - "missing - setupTokenPairByPasswordGrantType(x, y)"); + "by saml grant type. Encoded client credentials are " + + "missing - setupTokenPairBySamlGrantType(x, y)"); } else { var tokenData; var arrayOfScopes = devicemgtProps["scopes"]; + arrayOfScopes = arrayOfScopes.concat(utility.getDeviceTypesScopesList()); var stringOfScopes = ""; arrayOfScopes.forEach(function (entry) { stringOfScopes += entry + " "; @@ -98,11 +101,11 @@ var handlers = function () { // accessTokenPair will include current access token as well as current refresh token tokenData = tokenUtil. - getTokenPairAndScopesBySAMLGrantType(samlToken, encodedClientAppCredentials, stringOfScopes); + getTokenPairAndScopesBySAMLGrantType(samlToken, encodedClientAppCredentials, stringOfScopes); if (!tokenData) { throw new Error("{/app/modules/oauth/token-handlers.js} Could not set up token " + - "pair by password grant type. Error in token " + - "retrieval - setupTokenPairByPasswordGrantType(x, y)"); + "pair by password grant type. Error in token " + + "retrieval - setupTokenPairBySamlGrantType(x, y)"); } else { var tokenPair = {}; tokenPair["accessToken"] = tokenData["accessToken"]; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js index 3b96ff0056..49b1a0d5b1 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/modules/utility.js @@ -125,5 +125,33 @@ utility = function () { return null; }; + publicMethods.getDeviceTypesScopesList = function () { + var dirs = new File("/app/units/").listFiles(); + var scopesList = []; + for (var i = 0; i < dirs.length; i++) { + var unitName = dirs[i].getName(); + if (unitName.match(/^cdmf\.unit\.device\.type\..*\.type-view$/g)) { + var deviceTypeConfigFile = new File("/app/units/" + unitName + "/private/config.json"); + if (deviceTypeConfigFile.isExists()) { + try { + deviceTypeConfigFile.open("r"); + var config = deviceTypeConfigFile.readAll(); + config = config.replace("%https.ip%", server.address("https")); + config = config.replace("%http.ip%", server.address("http")); + var deviceTypeConfig = parse(config); + if (deviceTypeConfig.deviceType && deviceTypeConfig.deviceType.scopes) { + scopesList = scopesList.concat(deviceTypeConfig.deviceType.scopes); + } + } catch (err) { + log.error("Error while reading device config file for `" + deviceType + "`: " + err); + } finally { + deviceTypeConfigFile.close(); + } + } + } + } + return scopesList; + }; + return publicMethods; }(); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/templates/device-listing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/templates/device-listing.hbs index 4fd4390096..c0fe171866 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/templates/device-listing.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.device.search/public/templates/device-listing.hbs @@ -20,7 +20,7 @@ {{enrolmentInfo.owner}} - {{#equal enrolmentInfo.status "ACTIVE"}} Active{{/equal}} + {{#equal enrolmentInfo.status "ACTIVE"}} Active{{/equal}} {{#equal enrolmentInfo.status "INACTIVE"}} Inactive{{/equal}} {{#equal enrolmentInfo.status "BLOCKED"}} Blocked{{/equal}} {{#equal enrolmentInfo.status "REMOVED"}} Removed{{/equal}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js index b3c977f9d1..bae88512d5 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.devices/public/js/listing.js @@ -277,7 +277,7 @@ function loadDevices(searchType, searchParam) { var html; switch (status) { case 'ACTIVE' : - html = ' Active'; + html = ' Active'; break; case 'INACTIVE' : html = ' Inactive'; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.hbs index f4b147cfa2..ad28493c61 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.hbs @@ -182,9 +182,9 @@ {{#each policyListToView}} -
- + data-url="{{@app.context}}/policy/view?id={{id}}&deviceType={{platform}}" data-id="{{id}}"> +
+
Active/Updated {{/equal}} {{#equal status "Active"}} - Active + Active {{/equal}} {{#equal status "Inactive/Updated"}} Inactive/Updated @@ -239,7 +239,7 @@ - diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js index 515a002f94..3fe5ab9c3f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.policies/policies.js @@ -30,9 +30,15 @@ function onRequest(context) { var page = {}; var policyModule = require("/app/modules/business-controllers/policy.js")["policyModule"]; var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; + var utility = require("/app/modules/utility.js")["utility"]; var response = policyModule.getAllPolicies(); if (response["status"] == "success") { var policyListToView = response["content"]; + for(var index in policyListToView) { + if(policyListToView.hasOwnProperty(index)) { + policyListToView[index]["icon"] = utility.getDeviceThumb(policyListToView[index]["platform"]); + } + } page["policyListToView"] = policyListToView; var policyCount = policyListToView.length; if (policyCount == 0) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js index ea67fcc832..82b0068f7c 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/pages/cdmf.page.register/public/js/validate-register.js @@ -121,12 +121,12 @@ $(document).ready(function(){ $("#add-user-btn").prop('disabled', false); if (data == 200) { $('.wr-validation-summary strong').html( - " Successfully Submitted."); + " Successfully Submitted."); $('.wr-validation-summary').removeClass("alert-danger"); $('.wr-validation-summary').addClass("alert-success"); } else if (data == 201) { $('.wr-validation-summary strong').html( - " User created succssfully. You will be " + + " User created succssfully. You will be " + "redirected to login page."); $('.wr-validation-summary').removeClass("alert-danger"); $('.wr-validation-summary').addClass("alert-success"); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.overview-section/overview-section.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.overview-section/overview-section.hbs index 34d64824e9..8cf8c0cfd7 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.overview-section/overview-section.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.overview-section/overview-section.hbs @@ -51,7 +51,7 @@ Status {{#equal device.status "ACTIVE"}} Active{{/equal}} + class="fw fw-success icon-success"> Active{{/equal}} {{#equal device.status "INACTIVE"}} Inactive{{/equal}} {{#equal device.status "BLOCKED"}} Blocked{{/equal}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs index 9b6667ab8c..d40bb52ada 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.types.listing/listing.hbs @@ -16,7 +16,7 @@ under the License. }} -{{#if virtualDeviceTypesList}} +{{#if deviceTypesList}}
Device Types diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js index 3672656fd4..b0fb423aa2 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/js/device-view.js @@ -81,7 +81,7 @@ var html; switch (status) { case "COMPLETED" : - html = " Completed"; + html = " Completed"; break; case "PENDING" : html = " Pending"; @@ -90,10 +90,10 @@ html = " Error"; break; case "IN_PROGRESS" : - html = " In Progress"; + html = " In Progress"; break; case "REPEATED" : - html = " Repeated"; + html = " Repeated"; break; } return html; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/policy-compliance.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/policy-compliance.hbs index 590662aa20..c4872949cd 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/policy-compliance.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/policy-compliance.hbs @@ -26,7 +26,7 @@
Compliance : {{#equal compliance "COMPLIANT"}} - Compliant + Compliant {{/equal}} {{#equal compliance "NON-COMPLIANT"}} Not Compliant @@ -62,7 +62,7 @@ {{featureCode}} - {{#equal compliance true}} Compliant{{/equal}} + {{#equal compliance true}} Compliant{{/equal}} {{#equal compliance false}} Not Compliant{{/equal}} diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/policy-list.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/policy-list.hbs index 25a119461d..e90198678b 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/policy-list.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.device.view/public/templates/policy-list.hbs @@ -15,7 +15,7 @@ Active/Updated {{/equal}} {{#equal status "Active"}} - Active + Active {{/equal}} {{#equal status "Inactive/Updated"}} Inactive/Updated diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.effective-policy.view/public/js/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.effective-policy.view/public/js/view.js index a41d89fa1b..27a1960b8f 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.effective-policy.view/public/js/view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.effective-policy.view/public/js/view.js @@ -30,7 +30,7 @@ var displayPolicy = function (policyPayloadObj) { if (policyPayloadObj["active"] == true && policyPayloadObj["updated"] == true) { policyStatus = ' Active/Updated'; } else if (policyPayloadObj["active"] == true && policyPayloadObj["updated"] == false) { - policyStatus = ' Active'; + policyStatus = ' Active'; } else if (policyPayloadObj["active"] == false && policyPayloadObj["updated"] == true) { policyStatus = ' Inactive/Updated'; } else if (policyPayloadObj["active"] == false && policyPayloadObj["updated"] == false) { diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs index 64f90e2749..44a501021d 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.hbs @@ -2,6 +2,8 @@ {{#if isAuthorized }} +
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.js index cdaf4ae8b4..4f7f10346e 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/edit.js @@ -17,8 +17,8 @@ */ function onRequest(context) { - var log = new Log("policy-view-edit-unit backend js"); - + var deviceType = request.getParameter("deviceType"); + var utility = require("/app/modules/utility.js").utility; var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; var groupModule = require("/app/modules/business-controllers/group.js")["groupModule"]; @@ -31,12 +31,30 @@ function onRequest(context) { if (usersResult.status == "success") { context.users = usersResult.content; } - context["groups"] = groupModule.getGroups(); - var user = userModule.getCarbonUser(); context["user"] = {username: user.username, domain: user.domain, tenantId: user.tenantId}; + context["policyOperations"] = {}; + var policyEditSrc = "/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-edit"); + if (new File(policyEditSrc).isExists()) { + var policyOperationsTemplateSrc = policyEditSrc + "/public/templates/" + deviceType + "-policy-edit.hbs"; + if (new File(policyOperationsTemplateSrc).isExists()) { + context["policyOperations"].template = "/public/cdmf.unit.device.type." + deviceType + + ".policy-edit/templates/" + deviceType + "-policy-edit.hbs"; + } + var policyOperationsScriptSrc = policyEditSrc + "/public/js/" + deviceType + "-policy-edit.js"; + if (new File(policyOperationsScriptSrc).isExists()) { + context["policyOperations"].script = "/public/cdmf.unit.device.type." + deviceType + ".policy-edit/js/" + + deviceType + "-policy-edit.js"; + } + var policyOperationsStylesSrc = policyEditSrc + "/public/css/" + deviceType + "-policy-edit.css"; + if (new File(policyOperationsStylesSrc).isExists()) { + context["policyOperations"].style = "/public/cdmf.unit.device.type." + deviceType + ".policy-edit/css/" + + deviceType + "-policy-edit.css"; + } + } + context.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/manage"); context.isAuthorizedViewUsers = userModule.isAuthorized("/permission/admin/device-mgt/roles/view"); context.isAuthorizedViewRoles = userModule.isAuthorized("/permission/admin/device-mgt/users/view"); diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js index 9b711ffc22..309f7ea640 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.edit/public/js/policy-edit.js @@ -179,52 +179,47 @@ skipStep["policy-platform"] = function (policyPayloadObj) { $("#policy-profile-page-wizard-title").text("EDIT " + policy["platform"] + " POLICY - " + policy["name"]); var deviceType = policy["platform"]; - var policyOperationsTemplateSrc = context + '/public/cdmf.unit.device.type.' + deviceType + - '.policy-edit/templates/' + deviceType + '-policy-edit.hbs'; - var policyOperationsScriptSrc = context + '/public/cdmf.unit.device.type.' + deviceType + - '.policy-edit/js/' + deviceType + '-policy-edit.js'; - var policyOperationsStylesSrc = context + '/public/cdmf.unit.device.type.' + deviceType + - '.policy-edit/css/' + deviceType + '-policy-edit.css'; - var policyOperationsTemplateCacheKey = deviceType + '-policy-operations'; - - $.isResourceExists(policyOperationsTemplateSrc, function (status) { - if (status) { - $.template(policyOperationsTemplateCacheKey, policyOperationsTemplateSrc, function (template) { - var content = template(); - $("#device-type-policy-operations").html(content).removeClass("hidden"); - $(".policy-platform").addClass("hidden"); - $.isResourceExists(policyOperationsScriptSrc, function (status) { - if (status) { - hasPolicyProfileScript = true; - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.src = policyOperationsScriptSrc; - $(".wr-advance-operations").prepend(script); - /* - This method should be implemented in the relevant plugin side and should include the logic to - populate the policy profile in the plugin specific UI. - */ - polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]); - } - }); - }); - - $.isResourceExists(policyOperationsStylesSrc, function (status) { - if (status) { - var style = document.createElement('link'); - style.type = 'text/css'; - style.rel = 'stylesheet'; - style.href = policyOperationsStylesSrc; - $(".wr-advance-operations").prepend(style); - } - }); + var policyOperations = $("#policy-operations"); + var policyEditTemplateSrc = $(policyOperations).data("template"); + var policyEditScriptSrc = $(policyOperations).data("script"); + var policyEditStylesSrc = $(policyOperations).data("style"); + var policyEditTemplateCacheKey = deviceType + '-policy-edit'; + + if (policyEditTemplateSrc) { + if (policyEditScriptSrc) { + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = context + policyEditScriptSrc; + $(".wr-advance-operations").prepend(script); + hasPolicyProfileScript = true; } else { - $("#generic-policy-operations").removeClass("hidden"); + hasPolicyProfileScript = false; } - $(".wr-advance-operations-init").addClass("hidden"); - }); + $.template(policyEditTemplateCacheKey, context + policyEditTemplateSrc, function (template) { + var content = template(); + $("#device-type-policy-operations").html(content).removeClass("hidden"); + $(".policy-platform").addClass("hidden"); + if (hasPolicyProfileScript) { + /* + This method should be implemented in the relevant plugin side and should include the logic to + populate the policy profile in the plugin specific UI. + */ + polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]); + } + }); + } else { + $("#generic-policy-operations").removeClass("hidden"); + } + if (policyEditStylesSrc) { + var style = document.createElement('link'); + style.type = 'text/css'; + style.rel = 'stylesheet'; + style.href = context + policyEditStylesSrc; + $(".wr-advance-operations").prepend(style); + } + $(".wr-advance-operations-init").addClass("hidden"); - if(!hasPolicyProfileScript) { + if (!hasPolicyProfileScript) { populateGenericProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]); } }; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/public/js/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/public/js/view.js index 552aba52c3..8ff991b1ef 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/public/js/view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/public/js/view.js @@ -32,7 +32,7 @@ var displayPolicy = function (policyPayloadObj) { if (policyPayloadObj["active"] == true && policyPayloadObj["updated"] == true) { policyStatus = ' Active/Updated'; } else if (policyPayloadObj["active"] == true && policyPayloadObj["updated"] == false) { - policyStatus = ' Active'; + policyStatus = ' Active'; } else if (policyPayloadObj["active"] == false && policyPayloadObj["updated"] == true) { policyStatus = ' Inactive/Updated'; } else if (policyPayloadObj["active"] == false && policyPayloadObj["updated"] == false) { @@ -67,52 +67,47 @@ var displayPolicy = function (policyPayloadObj) { } var deviceType = policy["platform"]; - var policyOperationsTemplateSrc = context + '/public/cdmf.unit.device.type.' + deviceType + - '.policy-view/templates/' + deviceType + '-policy-view.hbs'; - var policyOperationsScriptSrc = context + '/public/cdmf.unit.device.type.' + deviceType + - '.policy-view/js/' + deviceType + '-policy-view.js'; - var policyOperationsStylesSrc = context + '/public/cdmf.unit.device.type.' + deviceType + - '.policy-view/css/' + deviceType + '-policy-view.css'; - var policyOperationsTemplateCacheKey = deviceType + '-policy-operations'; + var policyOperations = $("#policy-operations"); + var policyViewTemplateSrc = $(policyOperations).data("template"); + var policyViewScriptSrc = $(policyOperations).data("script"); + var policyViewStylesSrc = $(policyOperations).data("style"); + var policyViewTemplateCacheKey = deviceType + '-policy-view'; - $.isResourceExists(policyOperationsTemplateSrc, function (status) { - if (status) { - $.template(policyOperationsTemplateCacheKey, policyOperationsTemplateSrc, function (template) { - var content = template(); - $("#device-type-policy-operations").html(content).removeClass("hidden"); - $(".policy-platform").addClass("hidden"); - $.isResourceExists(policyOperationsScriptSrc, function (status) { - if (status) { - hasPolicyProfileScript = true; - var script = document.createElement('script'); - script.type = 'text/javascript'; - script.src = policyOperationsScriptSrc; - $(".wr-advance-operations").prepend(script); - /* - This method should be implemented in the relevant plugin side and should include the logic to - populate the policy profile in the plugin specific UI. - */ - polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]); - } - }); - }); - - $.isResourceExists(policyOperationsStylesSrc, function (status) { - if (status) { - var style = document.createElement('link'); - style.type = 'text/css'; - style.rel = 'stylesheet'; - style.href = policyOperationsStylesSrc; - $(".wr-advance-operations").prepend(style); - } - }); + if (policyViewTemplateSrc) { + if (policyViewScriptSrc) { + var script = document.createElement('script'); + script.type = 'text/javascript'; + script.src = context + policyViewScriptSrc; + $(".wr-advance-operations").prepend(script); + hasPolicyProfileScript = true; } else { - $("#generic-policy-operations").removeClass("hidden"); + hasPolicyProfileScript = false; } - $(".wr-advance-operations-init").addClass("hidden"); - }); + $.template(policyViewTemplateCacheKey, context + policyViewTemplateSrc, function (template) { + var content = template(); + $("#device-type-policy-operations").html(content).removeClass("hidden"); + $(".policy-platform").addClass("hidden"); + if (hasPolicyProfileScript) { + /* + This method should be implemented in the relevant plugin side and should include the logic to + populate the policy profile in the plugin specific UI. + */ + polulateProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]); + } + }); + } else { + $("#generic-policy-operations").removeClass("hidden"); + } + if (policyViewStylesSrc) { + var style = document.createElement('link'); + style.type = 'text/css'; + style.rel = 'stylesheet'; + style.href = context + policyViewStylesSrc; + $(".wr-advance-operations").prepend(style); + } + $(".wr-advance-operations-init").addClass("hidden"); - if(!hasPolicyProfileScript) { + if (!hasPolicyProfileScript) { populateGenericProfileOperations(policyPayloadObj["profile"]["profileFeaturesList"]); } }; diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs index 2b0af7b23d..ca5b9d3969 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.hbs @@ -8,7 +8,8 @@
{{/defineZone}} - +
diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.js b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.js index e8247821b6..af53c46116 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.js +++ b/components/device-mgt/org.wso2.carbon.device.mgt.ui/src/main/resources/jaggeryapps/devicemgt/app/units/cdmf.unit.policy.view/view.js @@ -17,10 +17,27 @@ */ function onRequest(context) { -// var log = new Log("policy-view-edit-unit backend js"); - -// var userModule = require("/app/modules/business-controllers/user.js")["userModule"]; -// context.roles = userModule.getRoles(); - context.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/view"); - return context; + var utility = require("/app/modules/utility.js").utility; + var page = {}; + var deviceType = request.getParameter("deviceType"); + var policyViewSrc = "/app/units/" + utility.getTenantedDeviceUnitName(deviceType, "policy-view"); + if (new File(policyViewSrc).isExists()) { + var policyOperationsTemplateSrc = policyViewSrc + "/public/templates/" + deviceType + "-policy-view.hbs"; + if (new File(policyOperationsTemplateSrc).isExists()) { + page.template = "/public/cdmf.unit.device.type." + deviceType + ".policy-view/templates/" + deviceType + + "-policy-view.hbs"; + } + var policyOperationsScriptSrc = policyViewSrc + "/public/js/" + deviceType + "-policy-view.js"; + if (new File(policyOperationsScriptSrc).isExists()) { + page.script = "/public/cdmf.unit.device.type." + deviceType + ".policy-view/js/" + deviceType + + "-policy-view.js"; + } + var policyOperationsStylesSrc = policyViewSrc + "/public/css/" + deviceType + "-policy-view.css"; + if (new File(policyOperationsStylesSrc).isExists()) { + page.style = "/public/cdmf.unit.device.type." + deviceType + ".policy-view/css/" + deviceType + + "-policy-view.css"; + } + } + page.isAuthorized = userModule.isAuthorized("/permission/admin/device-mgt/policies/view"); + return page; } \ No newline at end of file diff --git a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml index 83c552cb52..57321f6320 100644 --- a/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml +++ b/components/device-mgt/org.wso2.carbon.device.mgt.url.printer/pom.xml @@ -23,7 +23,7 @@ device-mgt org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml @@ -59,7 +59,7 @@ ${project.artifactId} ${carbon.device.mgt.version} IoT Server Impl Bundle - org.wso2.carbon.device.mgt.iot.url.printer.internal + org.wso2.carbon.device.mgt.url.printer.internal org.osgi.framework, org.osgi.service.component, @@ -69,8 +69,8 @@ org.wso2.carbon.utils.*, - !org.wso2.carbon.device.mgt.iot.url.printer.internal, - org.wso2.carbon.device.mgt.iot.url.printer.*;version="${project.version}" + !org.wso2.carbon.device.mgt.url.printer.internal, + org.wso2.carbon.device.mgt.url.printer.*;version="${project.version}" diff --git a/components/device-mgt/pom.xml b/components/device-mgt/pom.xml index fdb4d4fbad..b201d65ef5 100644 --- a/components/device-mgt/pom.xml +++ b/components/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml diff --git a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml index f6bbf47f07..643ee3cdcb 100644 --- a/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml +++ b/components/email-sender/org.wso2.carbon.email.sender.core/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt email-sender - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/email-sender/pom.xml b/components/email-sender/pom.xml index fc743d96c2..972e651847 100644 --- a/components/email-sender/pom.xml +++ b/components/email-sender/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml index 23d8f7b3f5..bbbc23454a 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web-proxy/pom.xml @@ -21,7 +21,7 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml index 0113694c2f..6dc589a7ba 100644 --- a/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/dynamic-client-web/pom.xml @@ -21,7 +21,7 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml index 58d9bf059c..077be5b61a 100644 --- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration/pom.xml @@ -21,13 +21,13 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.dynamic.client.registration - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - Dynamic client registration service WSO2 Carbon - Dynamic Client Registration Service diff --git a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml index 05ab159fe9..36059554fe 100644 --- a/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/org.wso2.carbon.dynamic.client.web.app.registration/pom.xml @@ -21,13 +21,13 @@ dynamic-client-registration org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.dynamic.client.web.app.registration - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - Dynamic client web app registration WSO2 Carbon - Dynamic Client Web-app Registration Service diff --git a/components/identity-extensions/dynamic-client-registration/pom.xml b/components/identity-extensions/dynamic-client-registration/pom.xml index 58aef32920..2b469a5452 100644 --- a/components/identity-extensions/dynamic-client-registration/pom.xml +++ b/components/identity-extensions/dynamic-client-registration/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt identity-extensions - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt dynamic-client-registration - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Dynamic client registration http://wso2.org diff --git a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml index b4d7a023bb..dc80a4ff55 100644 --- a/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.device.mgt.oauth.extensions/pom.xml @@ -22,13 +22,13 @@ org.wso2.carbon.devicemgt identity-extensions - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - OAuth Extensions http://wso2.org diff --git a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml index 7c56e3b5a1..1de87ce72c 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.authenticator.backend.oauth/pom.xml @@ -21,7 +21,7 @@ identity-extensions org.wso2.carbon.devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT 4.0.0 diff --git a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml index 58b3a933a6..b39b20638d 100644 --- a/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml +++ b/components/identity-extensions/org.wso2.carbon.identity.jwt.client.extension/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt identity-extensions - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/components/identity-extensions/pom.xml b/components/identity-extensions/pom.xml index e26b2c7580..054e15003c 100644 --- a/components/identity-extensions/pom.xml +++ b/components/identity-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml diff --git a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml index 79ba6d653c..ffec259e80 100644 --- a/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.complex.policy.decision.point/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.complex.policy.decision.point - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml index c5918d2e05..e78de783ed 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.decision.point/pom.xml @@ -3,14 +3,14 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.decision.point - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - Policy Decision Point WSO2 Carbon - Policy Decision Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml index d696a6e229..e82a2784fb 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.information.point/pom.xml @@ -3,7 +3,7 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml @@ -11,7 +11,7 @@ 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.information.point - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - Policy Information Point WSO2 Carbon - Policy Information Point diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml index da24980da3..4fbc1ed772 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.common/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.common - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - Policy Management Common WSO2 Carbon - Policy Management Common diff --git a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml index 645fd271b9..1e21f197fd 100644 --- a/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml +++ b/components/policy-mgt/org.wso2.carbon.policy.mgt.core/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt policy-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.policy.mgt.core - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - Policy Management Core WSO2 Carbon - Policy Management Core diff --git a/components/policy-mgt/pom.xml b/components/policy-mgt/pom.xml index 387697b8fa..48e1dbf9d0 100644 --- a/components/policy-mgt/pom.xml +++ b/components/policy-mgt/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 policy-mgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Policy Management Component http://wso2.org diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml index fb3c86bc70..342360206a 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.devicemgt org.wso2.carbon.webapp.authenticator.framework - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT bundle WSO2 Carbon - Web Application Authenticator Framework Bundle WSO2 Carbon - Web Application Authenticator Framework Bundle diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/Utils/Utils.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/Utils/Utils.java index ac0130a39f..b139fa9e89 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/Utils/Utils.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/Utils/Utils.java @@ -35,6 +35,8 @@ import org.wso2.carbon.utils.multitenancy.MultitenantUtils; import org.wso2.carbon.webapp.authenticator.framework.AuthenticationException; import java.util.Properties; +import java.util.regex.Matcher; +import java.util.regex.Pattern; public class Utils { @@ -86,4 +88,18 @@ public class Utils { } } + public static String replaceSystemProperty(String urlWithPlaceholders) { + String regex = "\\$\\{(.*?)\\}"; + Pattern pattern = Pattern.compile(regex); + Matcher matchPattern = pattern.matcher(urlWithPlaceholders); + while (matchPattern.find()) { + String sysPropertyName = matchPattern.group(1); + String sysPropertyValue = System.getProperty(sysPropertyName); + if (sysPropertyValue != null && !sysPropertyName.isEmpty()) { + urlWithPlaceholders = urlWithPlaceholders.replaceAll("\\$\\{(" + sysPropertyName + ")\\}", sysPropertyValue); + } + } + return urlWithPlaceholders; + } + } diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java index 36d1da87cb..5a357a3ab5 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/WebappAuthenticationValve.java @@ -41,7 +41,7 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { @Override public void invoke(Request request, Response response, CompositeValve compositeValve) { - if (this.isContextSkipped(request) || (!this.isAdminService(request) && this.skipAuthentication(request))) { + if (this.isContextSkipped(request) || this.skipAuthentication(request)) { this.getNext().invoke(request, response, compositeValve); return; } @@ -74,11 +74,6 @@ public class WebappAuthenticationValve extends CarbonTomcatValve { } } - private boolean isAdminService(Request request) { - String param = request.getContext().findParameter("isAdminService"); - return (param != null && Boolean.parseBoolean(param)); - } - private boolean skipAuthentication(Request request) { String param = request.getContext().findParameter("doAuthentication"); return (param == null || !Boolean.parseBoolean(param) || isNonSecuredEndPoint(request)); diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BSTAuthenticator.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BSTAuthenticator.java index 51e92a139b..ceb78d8a34 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BSTAuthenticator.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/BSTAuthenticator.java @@ -66,7 +66,7 @@ public class BSTAuthenticator implements WebappAuthenticator { "are not provided"); } - String url = this.properties.getProperty("TokenValidationEndpointUrl"); + String url = Utils.replaceSystemProperty(this.properties.getProperty("TokenValidationEndpointUrl")); if ((url == null) || (url.isEmpty())) { throw new IllegalArgumentException("OAuth token validation endpoint url is not provided"); } diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/JWTAuthenticator.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/JWTAuthenticator.java index b269f7c285..81f885cd36 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/JWTAuthenticator.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/JWTAuthenticator.java @@ -62,7 +62,7 @@ public class JWTAuthenticator implements WebappAuthenticator { private static final String DEFAULT_TRUST_STORE_LOCATION = "Security.TrustStore.Location"; private static final String DEFAULT_TRUST_STORE_PASSWORD = "Security.TrustStore.Password"; - private static final Map publicKeyHolder = new HashMap<>(); + private static final Map publicKeyHolder = new HashMap<>(); private Properties properties; private static void loadTenantRegistry(int tenantId) throws RegistryException { @@ -106,46 +106,37 @@ public class JWTAuthenticator implements WebappAuthenticator { String username = jwsObject.getJWTClaimsSet().getStringClaim(SIGNED_JWT_AUTH_USERNAME); String tenantDomain = MultitenantUtils.getTenantDomain(username); int tenantId = Integer.parseInt(jwsObject.getJWTClaimsSet().getStringClaim(SIGNED_JWT_AUTH_TENANT_ID)); + String issuer = jwsObject.getJWTClaimsSet().getIssuer(); PrivilegedCarbonContext.startTenantFlow(); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantDomain(tenantDomain); PrivilegedCarbonContext.getThreadLocalCarbonContext().setTenantId(tenantId); - PublicKey publicKey = publicKeyHolder.get(tenantDomain); + IssuerAlias issuerAlias = new IssuerAlias(issuer, tenantDomain); + PublicKey publicKey = publicKeyHolder.get(issuerAlias); if (publicKey == null) { loadTenantRegistry(tenantId); KeyStoreManager keyStoreManager = KeyStoreManager.getInstance(tenantId); if (MultitenantConstants.SUPER_TENANT_DOMAIN_NAME.equals(tenantDomain)) { - String defaultPublicKey = properties.getProperty("DefaultPublicKey"); - if (defaultPublicKey != null && !defaultPublicKey.isEmpty()) { - boolean isDefaultPublicKey = Boolean.parseBoolean(defaultPublicKey); - if (isDefaultPublicKey) { - publicKey = keyStoreManager.getDefaultPublicKey(); - } else { - String alias = properties.getProperty("KeyAlias"); - if (alias != null && !alias.isEmpty()) { - ServerConfiguration serverConfig = CarbonUtils.getServerConfiguration(); - KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); - String trustStorePath = serverConfig.getFirstProperty(DEFAULT_TRUST_STORE_LOCATION); - String trustStorePassword = serverConfig.getFirstProperty( - DEFAULT_TRUST_STORE_PASSWORD); - keyStore.load(new FileInputStream(trustStorePath), trustStorePassword.toCharArray()); - publicKey = keyStore.getCertificate(alias).getPublicKey(); - } else { - authenticationInfo.setStatus(Status.FAILURE); - return authenticationInfo; - } - } - + String alias = properties.getProperty(issuer); + if (alias != null && !alias.isEmpty()) { + ServerConfiguration serverConfig = CarbonUtils.getServerConfiguration(); + KeyStore keyStore = KeyStore.getInstance(KeyStore.getDefaultType()); + String trustStorePath = serverConfig.getFirstProperty(DEFAULT_TRUST_STORE_LOCATION); + String trustStorePassword = serverConfig.getFirstProperty( + DEFAULT_TRUST_STORE_PASSWORD); + keyStore.load(new FileInputStream(trustStorePath), trustStorePassword.toCharArray()); + publicKey = keyStore.getCertificate(alias).getPublicKey(); } else { - publicKey = keyStoreManager.getDefaultPublicKey(); + authenticationInfo.setStatus(Status.FAILURE); + return authenticationInfo; } - } else { String ksName = tenantDomain.trim().replace('.', '-'); String jksName = ksName + ".jks"; publicKey = keyStoreManager.getKeyStore(jksName).getCertificate(tenantDomain).getPublicKey(); } if (publicKey != null) { - publicKeyHolder.put(tenantDomain, publicKey); + issuerAlias = new IssuerAlias(tenantDomain); + publicKeyHolder.put(issuerAlias, publicKey); } } @@ -205,4 +196,34 @@ public class JWTAuthenticator implements WebappAuthenticator { } return this.properties.getProperty(name); } + + private class IssuerAlias { + + private String issuer; + private String tenantDomain; + private final String DEFAULT_ISSUER = "default"; + + public IssuerAlias(String tenantDomain) { + this.issuer = DEFAULT_ISSUER; + this.tenantDomain = tenantDomain; + } + + public IssuerAlias(String issuer, String tenantDomain) { + this.issuer = issuer; + this.tenantDomain = tenantDomain; + } + + @Override + public int hashCode() { + int result = this.issuer.hashCode(); + result = 31 * result + ("@" + this.tenantDomain).hashCode(); + return result; + } + + @Override + public boolean equals(Object obj) { + return (obj instanceof IssuerAlias) && issuer.equals( + ((IssuerAlias) obj).issuer) && tenantDomain == ((IssuerAlias) obj).tenantDomain; + } + } } diff --git a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/OAuthAuthenticator.java b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/OAuthAuthenticator.java index 797a4f5afd..0033e54dd8 100644 --- a/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/OAuthAuthenticator.java +++ b/components/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework/src/main/java/org/wso2/carbon/webapp/authenticator/framework/authenticator/OAuthAuthenticator.java @@ -55,7 +55,7 @@ public class OAuthAuthenticator implements WebappAuthenticator { "are not provided"); } - String url = this.properties.getProperty("TokenValidationEndpointUrl"); + String url = Utils.replaceSystemProperty(this.properties.getProperty("TokenValidationEndpointUrl")); if ((url == null) || (url.isEmpty())) { throw new IllegalArgumentException("OAuth token validation endpoint url is not provided"); } diff --git a/components/webapp-authenticator-framework/pom.xml b/components/webapp-authenticator-framework/pom.xml index 84dbee75fa..01b5561c11 100644 --- a/components/webapp-authenticator-framework/pom.xml +++ b/components/webapp-authenticator-framework/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework http://wso2.org diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml index 489bacc2fd..18945c70c8 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.application.extension.feature/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.application.extension.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - API Management Application Extension Feature http://wso2.org This feature contains an implementation of a api application registration, which takes care of subscription diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml index 5380c31999..f92c584e74 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.handler.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.handler.server.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Device Management - APIM handler Server Feature http://wso2.org This feature contains the handler for the api authentications diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml index 8c8d0665d6..f3804727bb 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/pom.xml @@ -21,14 +21,14 @@ org.wso2.carbon.devicemgt apimgt-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.apimgt.webapp.publisher.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - API Management Webapp Publisher Feature http://wso2.org This feature contains an implementation of a Tomcat lifecycle listener, which takes care of publishing diff --git a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml index 214e5aa38d..067a6af7f8 100644 --- a/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml +++ b/features/apimgt-extensions/org.wso2.carbon.apimgt.webapp.publisher.feature/src/main/resources/conf/webapp-publisher-config.xml @@ -24,7 +24,7 @@ - https://localhost:${carbon.https.port} + https://${iot.core.host}:${iot.core.https.port} true diff --git a/features/apimgt-extensions/pom.xml b/features/apimgt-extensions/pom.xml index 51efa1550b..5575d0e811 100644 --- a/features/apimgt-extensions/pom.xml +++ b/features/apimgt-extensions/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt apimgt-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - API Management Extensions Feature http://wso2.org diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml index 8dd575de20..80cc570890 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml index 13bb9cb452..7f00407bc0 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.cert.admin.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml index aafde9de63..394e4aad74 100644 --- a/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml +++ b/features/certificate-mgt/org.wso2.carbon.certificate.mgt.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt certificate-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.certificate.mgt.server.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Certificate Management Server Feature http://wso2.org This feature contains the core bundles required for back-end Certificate Management functionality diff --git a/features/certificate-mgt/pom.xml b/features/certificate-mgt/pom.xml index b3c7ba4b80..fc0e07812c 100644 --- a/features/certificate-mgt/pom.xml +++ b/features/certificate-mgt/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt certificate-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Certificate Management Feature http://wso2.org diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml index dbe5b35f59..29d842b35c 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.device.type.deployer.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Device Type Deployer Feature http://wso2.org WSO2 Carbon - Device Type Deployer Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml index 8a44fa463b..9086f27962 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.gcm.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - GCM Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml index 4bd768b686..9048cbf3eb 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.mqtt.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - MQTT Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - MQTT Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml index 52976cea41..162d1cb422 100644 --- a/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml +++ b/features/device-mgt-extensions/org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.push.notification.provider.xmpp.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - XMPP Based Push Notification Provider Feature http://wso2.org WSO2 Carbon - XMPP Based Push Notification Provider Feature diff --git a/features/device-mgt-extensions/pom.xml b/features/device-mgt-extensions/pom.xml index 0db4d04d52..d6eb96d1fb 100644 --- a/features/device-mgt-extensions/pom.xml +++ b/features/device-mgt-extensions/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml index f2dca661e2..3be09130e7 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.dashboard.feature/pom.xml @@ -3,13 +3,13 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.analytics.dashboard.feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Device Management Dashboard Analytics Feature WSO2 Carbon - Device Management Dashboard Analytics Feature diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml index 52fd3b446f..a508fda113 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.analytics.data.publisher.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.analytics.data.publisher.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains bundles related to device analytics data publisher diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml index b263a9ba86..aa2b025d34 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.api.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml index 0e55a7d75c..ef4704f83e 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.extensions.feature/pom.xml @@ -4,14 +4,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.extensions.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Device Management Extensions Feature http://wso2.org This feature contains common extensions used by key device management functionalities diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml index ee5fa7b255..3efb84cb00 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml index ba37ab67c8..adbac41ef1 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.server.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Device Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality @@ -122,6 +122,9 @@ org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.common:${carbon.device.mgt.version} + + org.wso2.carbon.devicemgt:org.wso2.carbon.device.mgt.url.printer:${carbon.device.mgt.version} + diff --git a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml index 9d9a5d4ec0..c54de4ae34 100644 --- a/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml +++ b/features/device-mgt/org.wso2.carbon.device.mgt.ui.feature/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt device-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml diff --git a/features/device-mgt/pom.xml b/features/device-mgt/pom.xml index 208d2233fb..dccc4511b9 100644 --- a/features/device-mgt/pom.xml +++ b/features/device-mgt/pom.xml @@ -22,7 +22,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml diff --git a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml index f22704046d..608d5bc48a 100644 --- a/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml +++ b/features/dynamic-client-registration/org.wso2.carbon.dynamic.client.registration.server.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt dynamic-client-registration-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.dynamic.client.registration.server.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Dynamic Client Registration Server Feature http://wso2.org This feature contains dynamic client registration features diff --git a/features/dynamic-client-registration/pom.xml b/features/dynamic-client-registration/pom.xml index b666224d1e..9672c97218 100644 --- a/features/dynamic-client-registration/pom.xml +++ b/features/dynamic-client-registration/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt dynamic-client-registration-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Dynamic Client Registration Feature http://wso2.org diff --git a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml index 95f81b3ae8..17362024fe 100644 --- a/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml +++ b/features/email-sender/org.wso2.carbon.email.sender.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt email-sender-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.email.sender.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Email Sender Feature http://wso2.org This feature contains the core bundles required for email sender related functionality diff --git a/features/email-sender/pom.xml b/features/email-sender/pom.xml index 77e24557ba..e430e1bca0 100644 --- a/features/email-sender/pom.xml +++ b/features/email-sender/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt email-sender-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Email Sender Feature http://wso2.org diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml index f65bd61439..6e1271a0d8 100644 --- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml +++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt jwt-client-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.identity.jwt.client.extension.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - JWT Client Feature http://wso2.org This feature contains jwt client implementation from which we can get a access token using the jwt diff --git a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties index 9e4021a913..3c38465581 100644 --- a/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties +++ b/features/jwt-client/org.wso2.carbon.identity.jwt.client.extension.feature/src/main/resources/jwt.properties @@ -17,13 +17,13 @@ # #issuer of the JWT -iss=iot_default +iss=wso2.org/products/iot -TokenEndpoint=https://localhost:${carbon.https.port}/oauth2/token +TokenEndpoint=https://${iot.keymanager.host}:${iot.keymanager.https.port}/oauth2/token #audience of JWT claim #comma seperated values -aud=wso2.org/products/iot +aud=devicemgt #expiration time of JWT (number of minutes from the current time) exp=1000 diff --git a/features/jwt-client/pom.xml b/features/jwt-client/pom.xml index 67ab40e27c..ceff73aec8 100644 --- a/features/jwt-client/pom.xml +++ b/features/jwt-client/pom.xml @@ -23,13 +23,13 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 jwt-client-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Dynamic Client Registration Feature http://wso2.org diff --git a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml index 910267f1f3..6995155cea 100644 --- a/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml +++ b/features/oauth-extensions/org.wso2.carbon.device.mgt.oauth.extensions.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt oauth-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.device.mgt.oauth.extensions.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Device Mgt OAuth Extensions Feature http://wso2.org This feature contains devicemgt related OAuth extensions diff --git a/features/oauth-extensions/pom.xml b/features/oauth-extensions/pom.xml index cfce762238..f11a41f6b8 100644 --- a/features/oauth-extensions/pom.xml +++ b/features/oauth-extensions/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt oauth-extensions-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Device Management OAuth Extensions Feature http://wso2.org diff --git a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml index b06d902695..e98613903b 100644 --- a/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml +++ b/features/policy-mgt/org.wso2.carbon.policy.mgt.server.feature/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt policy-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.policy.mgt.server.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Policy Management Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/policy-mgt/pom.xml b/features/policy-mgt/pom.xml index 94c9dc45b2..40f3d81f14 100644 --- a/features/policy-mgt/pom.xml +++ b/features/policy-mgt/pom.xml @@ -23,14 +23,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt policy-mgt-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Policy Management Feature http://wso2.org diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml index c450cb7e0b..e84bbd11ad 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../pom.xml 4.0.0 org.wso2.carbon.webapp.authenticator.framework.server.feature pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Webapp Authenticator Framework Server Feature http://wso2.org This feature contains the core bundles required for Back-end Device Management functionality diff --git a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml index 115442d9df..b3a4f47c17 100644 --- a/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml +++ b/features/webapp-authenticator-framework/org.wso2.carbon.webapp.authenticator.framework.server.feature/src/main/resources/conf/webapp-authenticator-config.xml @@ -5,7 +5,7 @@ org.wso2.carbon.webapp.authenticator.framework.authenticator.OAuthAuthenticator false - https://localhost:9443 + https://${iot.keymanager.host}:${iot.keymanager.https.port} admin admin 100 @@ -20,9 +20,10 @@ JWT org.wso2.carbon.webapp.authenticator.framework.authenticator.JWTAuthenticator - true - - + + wso2carbon + wso2carbon + wso2carbon @@ -34,7 +35,7 @@ org.wso2.carbon.webapp.authenticator.framework.authenticator.BSTAuthenticator false - https://localhost:9443 + https://${iot.keymanager.host}:${iot.keymanager.https.port} admin admin 100 diff --git a/features/webapp-authenticator-framework/pom.xml b/features/webapp-authenticator-framework/pom.xml index 243d23c60f..7e2c1764e0 100644 --- a/features/webapp-authenticator-framework/pom.xml +++ b/features/webapp-authenticator-framework/pom.xml @@ -22,14 +22,14 @@ org.wso2.carbon.devicemgt carbon-devicemgt - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT ../../pom.xml 4.0.0 org.wso2.carbon.devicemgt webapp-authenticator-framework-feature - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT pom WSO2 Carbon - Webapp Authenticator Framework Feature http://wso2.org diff --git a/pom.xml b/pom.xml index dfe9e5c8da..e9b56eb1de 100644 --- a/pom.xml +++ b/pom.xml @@ -23,7 +23,7 @@ org.wso2.carbon.devicemgt carbon-devicemgt pom - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT WSO2 Carbon - Device Management - Parent http://wso2.org WSO2 Connected Device Manager Components @@ -1957,7 +1957,7 @@ 1.2.11.wso2v10 - 2.0.7-SNAPSHOT + 2.0.8-SNAPSHOT 4.4.8