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

application-manager-new
sinthuja 8 years ago
commit 7424caa74f

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

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

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

@ -595,9 +595,6 @@
<!-- *************** End of DAS Client *************** --> <!-- *************** End of DAS Client *************** -->
<!-- MB Features --> <!-- MB Features -->
<featureArtifactDef>
org.wso2.carbon.messaging:org.wso2.carbon.andes.server.feature:${carbon.messaging.version}
</featureArtifactDef>
<featureArtifactDef> <featureArtifactDef>
org.wso2.carbon.metrics:org.wso2.carbon.metrics.feature:${carbon.metrics.version} org.wso2.carbon.metrics:org.wso2.carbon.metrics.feature:${carbon.metrics.version}
</featureArtifactDef> </featureArtifactDef>
@ -731,10 +728,6 @@
<id>org.wso2.iot.styles.feature.group</id> <id>org.wso2.iot.styles.feature.group</id>
<version>${carbon.iot.device.mgt.version}</version> <version>${carbon.iot.device.mgt.version}</version>
</feature> </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 --> <!-- End of IoTServer Features -->
<!-- Device Management Features --> <!-- Device Management Features -->
@ -1311,10 +1304,6 @@
<!-- ************** END - EVENT PROCESSING FEATURES ************ --> <!-- ************** END - EVENT PROCESSING FEATURES ************ -->
<feature>
<id>org.wso2.carbon.andes.server.feature.group</id>
<version>${carbon.messaging.version}</version>
</feature>
<feature> <feature>
<id>org.wso2.carbon.metrics.feature.group</id> <id>org.wso2.carbon.metrics.feature.group</id>
<version>${carbon.metrics.version}</version> <version>${carbon.metrics.version}</version>
@ -1357,23 +1346,11 @@
<id>org.wso2.iot.styles.feature.group</id> <id>org.wso2.iot.styles.feature.group</id>
<version>${carbon.iot.device.mgt.version}</version> <version>${carbon.iot.device.mgt.version}</version>
</feature> </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 --> <!-- End of IoTServer Features -->
<feature> <feature>
<id>org.wso2.carbon.logging.mgt.feature.group</id> <id>org.wso2.carbon.logging.mgt.feature.group</id>
<version>${carbon.commons.version}</version> <version>${carbon.commons.version}</version>
</feature> </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> <feature>
<id>org.wso2.carbon.metrics.feature.group</id> <id>org.wso2.carbon.metrics.feature.group</id>
<version>${carbon.metrics.version}</version> <version>${carbon.metrics.version}</version>

@ -1015,11 +1015,6 @@
<artifactId>org.eclipse.paho.client.mqttv3</artifactId> <artifactId>org.eclipse.paho.client.mqttv3</artifactId>
<version>${eclipse.paho.version}</version> <version>${eclipse.paho.version}</version>
</dependency> </dependency>
<dependency>
<groupId>org.wso2.andes.wso2</groupId>
<artifactId>andes</artifactId>
<version>${carbon.messaging.version}</version>
</dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>

Loading…
Cancel
Save