Merge remote-tracking branch 'upstream/IoTS-1.0.0' into IoTS-1.0.0

merge-requests/1/head
charitha 8 years ago
commit 7562734282

@ -216,7 +216,7 @@
<include>**/api-manager.xml</include>
<include>**/sso-idp-config.xml</include>
<include>**/application-authentication.xml</include>
<include>**/broker.xml</include>
<!--include>**/broker.xml</include-->
<include>**/log4j.properties</include>
<include>**/nhttp.properties</include>
<include>**/passthru-http.properties</include>
@ -573,7 +573,7 @@
<fileMode>644</fileMode>
</fileSet>
<fileSet>
<!--fileSet>
<directory>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/dbscripts/mb-store
</directory>
<outputDirectory>${pom.artifactId}-${pom.version}/dbscripts/mb-store</outputDirectory>
@ -581,10 +581,10 @@
<include>**/*.*</include>
</includes>
<fileMode>644</fileMode>
</fileSet>
</fileSet-->
<!-- messaging related configs -->
<fileSet>
<!--fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/
</directory>
@ -594,10 +594,10 @@
<include>**/broker.xml</include>
</includes>
<fileMode>644</fileMode>
</fileSet>
</fileSet-->
<!--QPID related configurations-->
<fileSet>
<!--fileSet>
<directory>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/advanced/
</directory>
@ -608,7 +608,7 @@
<include>**/qpid-jmxremote.access</include>
</includes>
<fileMode>644</fileMode>
</fileSet>
</fileSet-->
<!-- Dashboard portal Jaggery app. Should be copied to <DAS_HOME>/repository/deployment/server/jaggeryapps -->
<fileSet>
@ -873,12 +873,12 @@
<fileMode>644</fileMode>
</file>
<!-- Copying event-broker.xml -->
<file>
<!--file>
<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/messaging-event-broker.xml</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf</outputDirectory>
<filtered>true</filtered>
<fileMode>644</fileMode>
</file>
</file-->
<!-- Copying application-authentication.xml -->
<file>
<source>
@ -954,11 +954,11 @@
<fileMode>644</fileMode>
</file>
<!-- Copying broker.xml -->
<file>
<!--file>
<source>src/repository/conf/broker.xml</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/conf</outputDirectory>
<fileMode>644</fileMode>
</file>
</file-->
<file>
<source>
../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/conf/tomcat/webapp-classloading.xml
@ -1011,11 +1011,11 @@
<outputDirectory>${pom.artifactId}-${pom.version}/repository/database/</outputDirectory>
<fileMode>644</fileMode>
</file>
<file>
<!--file>
<source>../p2-profile-gen/target/wso2carbon-core-${carbon.kernel.version}/repository/database/WSO2MB_DB.h2.db</source>
<outputDirectory>${pom.artifactId}-${pom.version}/repository/database/</outputDirectory>
<fileMode>644</fileMode>
</file>
</file-->
<!-- nTask Component -->
<file>
<source>

@ -45,6 +45,7 @@
<dependency>
<groupId>org.wso2.andes.wso2</groupId>
<artifactId>andes</artifactId>
<version>3.1.2</version>
</dependency>
<dependency>
<groupId>org.wso2.carbon</groupId>

@ -53,15 +53,19 @@ public class DeviceAccessBasedMQTTAuthorizer implements IAuthorizer {
@Override
public boolean isAuthorizedForTopic(MQTTAuthorizationSubject authorizationSubject, String topic,
MQTTAuthoriztionPermissionLevel permissionLevel) {
if (isUserAuthorized(authorizationSubject, ADMIN_PERMISSION, UI_EXECUTE)) {
System.out.println("isAuthorizedForTopic - user is auth success !");
return true;
}
String topics[] = topic.split("/");
if (topics.length < 3) {
System.out.println("isAuthorizedForTopic topic name invalid");
return false;
}
String tenantIdFromTopic = topics[0];
if (!tenantIdFromTopic.equals(authorizationSubject.getTenantDomain())) {
System.out.println("isAuthorizedForTopic tenantID invalid");
return false;
}
String deviceType = topics[1];
@ -78,10 +82,12 @@ public class DeviceAccessBasedMQTTAuthorizer implements IAuthorizer {
+ permissionScope;
for (String scope : scopes) {
if (requiredScope.equals(scope)) {
System.out.println("isAuthorizedForTopic - Pass");
return true;
}
}
}
System.out.println("isAuthorizedForTopic - Failed");
return false;
}
@ -113,10 +119,12 @@ public class DeviceAccessBasedMQTTAuthorizer implements IAuthorizer {
if (userRealm != null && userRealm.getAuthorizationManager() != null) {
return userRealm.getAuthorizationManager().isUserAuthorized(username, permission, action);
}
System.out.println("isUserAuthorized failse");
return false;
} catch (UserStoreException e) {
String errorMsg = String.format("Unable to authorize the user : %s", username);
logger.error(errorMsg, e);
System.out.println("isUserAuthorized failed");
return false;
} finally {
PrivilegedCarbonContext.endTenantFlow();

@ -598,9 +598,6 @@
<!-- *************** End of DAS Client *************** -->
<!-- MB Features -->
<featureArtifactDef>
org.wso2.carbon.messaging:org.wso2.carbon.andes.server.feature:${carbon.messaging.version}
</featureArtifactDef>
<featureArtifactDef>
org.wso2.carbon.metrics:org.wso2.carbon.metrics.feature:${carbon.metrics.version}
</featureArtifactDef>
@ -734,10 +731,6 @@
<id>org.wso2.iot.styles.feature.group</id>
<version>${carbon.iot.device.mgt.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature.group</id>
<version>${carbon.iot.device.mgt.version}</version>
</feature>
<!-- End of IoTServer Features -->
<!-- Device Management Features -->
@ -1318,10 +1311,6 @@
<!-- ************** END - EVENT PROCESSING FEATURES ************ -->
<feature>
<id>org.wso2.carbon.andes.server.feature.group</id>
<version>${carbon.messaging.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.metrics.feature.group</id>
<version>${carbon.metrics.version}</version>
@ -1364,23 +1353,11 @@
<id>org.wso2.iot.styles.feature.group</id>
<version>${carbon.iot.device.mgt.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature.group</id>
<version>${carbon.iot.device.mgt.version}</version>
</feature>
<!-- End of IoTServer Features -->
<feature>
<id>org.wso2.carbon.logging.mgt.feature.group</id>
<version>${carbon.commons.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.andes.extensions.device.mgt.mqtt.authorization.feature.group</id>
<version>${carbon.iot.device.mgt.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.andes.server.feature.group</id>
<version>${carbon.messaging.version}</version>
</feature>
<feature>
<id>org.wso2.carbon.metrics.feature.group</id>
<version>${carbon.metrics.version}</version>

@ -1015,11 +1015,6 @@
<artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>${eclipse.paho.version}</version>
</dependency>
<dependency>
<groupId>org.wso2.andes.wso2</groupId>
<artifactId>andes</artifactId>
<version>${carbon.messaging.version}</version>
</dependency>
</dependencies>
</dependencyManagement>
@ -1110,7 +1105,7 @@
<carbon.mediation.version>4.6.6</carbon.mediation.version>
<!-- Carbon Analytics Common (DAS) -->
<carbon.analytics.common.version>5.1.5-SNAPSHOT</carbon.analytics.common.version>
<carbon.analytics.common.version>5.1.4</carbon.analytics.common.version>
<carbon.analytics.version>1.2.9-SNAPSHOT</carbon.analytics.version>
<!-- Tomcat -->

Loading…
Cancel
Save