Merge branch 'removeMBReferences' of https://github.com/hastef88/product-iots into IoTS-1.0.0-fresh

merge-requests/1/head
sinthuja 8 years ago
commit 7424caa74f

@ -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>
@ -562,7 +562,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>
@ -570,10 +570,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>
@ -583,10 +583,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>
@ -597,7 +597,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>
@ -844,12 +844,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>
@ -925,11 +925,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
@ -982,11 +982,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();

@ -595,9 +595,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>
@ -731,10 +728,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 -->
@ -1311,10 +1304,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>
@ -1357,23 +1346,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>

Loading…
Cancel
Save