+kafkawize.org.name=MyOrganization
+kafkawize.version=4.4
+kafkawize.invalidkey.msg=Invalid License !! Please request from https://kafkawize.com for a license key.
# Spring JPA properties
spring.datasource.url=jdbc:mysql://localhost:3306/kafkametadb?autoReconnect=true&useUnicode=true&useJDBCCompliantTimezoneShift=true&useLegacyDatetimeCode=false&serverTimezone=UTC
@@ -46,4 +56,5 @@ spring.jpa.properties.hibernate.dialect=org.hibernate.dialect.MySQL5InnoDBDialec
spring.datasource.platform=mysql
spring.jpa.hibernate.naming-strategy=org.hibernate.cfg.ImprovedNamingStrategy
+
#logging.level.root=debug
diff --git a/src/main/resources/scripts/base/cassandra/insertdata.sql b/src/main/resources/scripts/base/cassandra/insertdata.sql
index 7b7b8af..e58c20a 100644
--- a/src/main/resources/scripts/base/cassandra/insertdata.sql
+++ b/src/main/resources/scripts/base/cassandra/insertdata.sql
@@ -1,18 +1,18 @@
-/* Insert Users */
+/* Insert Users, pwd - base64 encoded */
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User1','Team1','uiuser1','USER','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User1','Team1','uiuser1','USER','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User2','Team2','uiuser2','USER','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User2','Team2','uiuser2','USER','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User3','Team3','uiuser3','USER','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User3','Team3','uiuser3','USER','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User4','Team1','uiuser4','ADMIN','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User4','Team1','uiuser4','ADMIN','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User5','Team2','uiuser5','ADMIN','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User5','Team2','uiuser5','ADMIN','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User6','Team3','uiuser6','ADMIN','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User6','Team3','uiuser6','ADMIN','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('SuperUser','Team2','superuser','SUPERUSER','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('SuperUser','Team2','superuser','SUPERUSER','dXNlcg==');
/* Insert Teams */
@@ -36,4 +36,4 @@ Insert into kafkamanagementapi.env(name,host,port,protocol,type) values ('DEV_SC
/* Insert product and version */
-Insert into kafkamanagementapi.productdetails(name,version,licensekey) values ('KafkaWize','5.0','');
+Insert into kafkamanagementapi.productdetails(name,version,licensekey) values ('KafkaWize','4.4','');
diff --git a/src/main/resources/scripts/base/rdbms/insertdata.sql b/src/main/resources/scripts/base/rdbms/insertdata.sql
index 6c253be..ecce485 100644
--- a/src/main/resources/scripts/base/rdbms/insertdata.sql
+++ b/src/main/resources/scripts/base/rdbms/insertdata.sql
@@ -1,18 +1,18 @@
-/* Insert Users */
+/* Insert Users , pwd: base64 encoded*/
-Insert into users(fullname,team,userid,roleid,pwd) values('User1','Team1','uiuser1','USER','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User1','Team1','uiuser1','USER','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User2','Team2','uiuser2','USER','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User2','Team2','uiuser2','USER','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User3','Team3','uiuser3','USER','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User3','Team3','uiuser3','USER','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User4','Team1','uiuser4','ADMIN','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User4','Team1','uiuser4','ADMIN','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User5','Team2','uiuser5','ADMIN','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User5','Team2','uiuser5','ADMIN','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User6','Team3','uiuser6','ADMIN','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User6','Team3','uiuser6','ADMIN','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('SuperUser','Team2','superuser','SUPERUSER','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('SuperUser','Team2','superuser','SUPERUSER','dXNlcg==');
/* Insert Teams */
@@ -36,6 +36,6 @@ Insert into env(name,host,port,protocol,type) values ('DEV_SCH','localhost','808
/* Insert product and version */
-Insert into productdetails(name,version) values ('KafkaWize','4.0');
+Insert into productdetails(name,version) values ('KafkaWize','4.4');
commit;
\ No newline at end of file
diff --git a/src/main/resources/static/assets/css/colors/default.css b/src/main/resources/static/assets/css/colors/default.css
index 9aa5d1e..d09881b 100644
--- a/src/main/resources/static/assets/css/colors/default.css
+++ b/src/main/resources/static/assets/css/colors/default.css
@@ -235,16 +235,16 @@ a.link:hover, a.link:focus {
color: #99abb4; }
.sidebar-nav > ul > li.active > a, .sidebar-nav > ul > li.active:hover > a {
color: #fff;
- background: #607d8b; }
+ background: #26c6da; }
.sidebar-nav > ul > li.active > a i, .sidebar-nav > ul > li.active:hover > a i {
color: #fff; }
.sidebar-nav > ul > li.active > a:after, .sidebar-nav > ul > li.active:hover > a:after {
border-color: #fff; }
.sidebar-nav > ul > li > a.active i, .sidebar-nav > ul > li > a:hover i {
- color: #607d8b; }
+ color: #26c6da; }
.sidebar-nav > ul > li > a i {
color: #99abb4; }
.sidebar-nav > ul > li > a.active {
font-weight: 400;
background: #fff;
- color: #607d8b; }
+ color: #009efb; }
diff --git a/src/main/resources/static/assets/images/background/login-register.jpg b/src/main/resources/static/assets/images/background/login-register.jpg
index 4ceb32e..bbade52 100644
Binary files a/src/main/resources/static/assets/images/background/login-register.jpg and b/src/main/resources/static/assets/images/background/login-register.jpg differ
diff --git a/src/main/resources/static/assets/images/favicon.png b/src/main/resources/static/assets/images/favicon.png
index 874eac8..89fc838 100644
Binary files a/src/main/resources/static/assets/images/favicon.png and b/src/main/resources/static/assets/images/favicon.png differ
diff --git a/src/main/resources/static/assets/images/logo-dark.png b/src/main/resources/static/assets/images/logo-dark.png
deleted file mode 100644
index 0af29ee..0000000
Binary files a/src/main/resources/static/assets/images/logo-dark.png and /dev/null differ
diff --git a/src/main/resources/static/assets/images/logo-icon.png b/src/main/resources/static/assets/images/logo-icon.png
deleted file mode 100644
index 4ff1122..0000000
Binary files a/src/main/resources/static/assets/images/logo-icon.png and /dev/null differ
diff --git a/src/main/resources/static/assets/images/logo-light.png b/src/main/resources/static/assets/images/logo-light.png
deleted file mode 100644
index eda52a9..0000000
Binary files a/src/main/resources/static/assets/images/logo-light.png and /dev/null differ
diff --git a/src/main/resources/static/assets/images/logo-si_oldgnin.png b/src/main/resources/static/assets/images/logo-si_oldgnin.png
deleted file mode 100644
index b1dd775..0000000
Binary files a/src/main/resources/static/assets/images/logo-si_oldgnin.png and /dev/null differ
diff --git a/src/main/resources/static/assets/images/logo-signin.png b/src/main/resources/static/assets/images/logo-signin.png
index ca433cc..b85e69a 100644
Binary files a/src/main/resources/static/assets/images/logo-signin.png and b/src/main/resources/static/assets/images/logo-signin.png differ
diff --git a/src/main/resources/static/assets/images/logo-signin1.png b/src/main/resources/static/assets/images/logo-signin1.png
deleted file mode 100644
index e95fc2f..0000000
Binary files a/src/main/resources/static/assets/images/logo-signin1.png and /dev/null differ
diff --git a/src/main/resources/static/assets/images/logo-text.png b/src/main/resources/static/assets/images/logo-text.png
deleted file mode 100644
index 83b3c09..0000000
Binary files a/src/main/resources/static/assets/images/logo-text.png and /dev/null differ
diff --git a/src/main/resources/static/assets/images/logo_kw.png b/src/main/resources/static/assets/images/logo_kw.png
index 7e96633..20782f6 100644
Binary files a/src/main/resources/static/assets/images/logo_kw.png and b/src/main/resources/static/assets/images/logo_kw.png differ
diff --git a/src/main/resources/static/assets/images/logo_kw1.png b/src/main/resources/static/assets/images/logo_kw1.png
deleted file mode 100644
index 024c154..0000000
Binary files a/src/main/resources/static/assets/images/logo_kw1.png and /dev/null differ
diff --git a/src/main/resources/static/assets/images/logo_kw_old.png b/src/main/resources/static/assets/images/logo_kw_old.png
deleted file mode 100644
index 6667a08..0000000
Binary files a/src/main/resources/static/assets/images/logo_kw_old.png and /dev/null differ
diff --git a/src/main/resources/static/assets/images/screenshots/ActivityLog.JPG b/src/main/resources/static/assets/images/screenshots/ActivityLog.JPG
index 5f05c9b..722b367 100644
Binary files a/src/main/resources/static/assets/images/screenshots/ActivityLog.JPG and b/src/main/resources/static/assets/images/screenshots/ActivityLog.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/AddCluster.JPG b/src/main/resources/static/assets/images/screenshots/AddCluster.JPG
index 2888837..91ee204 100644
Binary files a/src/main/resources/static/assets/images/screenshots/AddCluster.JPG and b/src/main/resources/static/assets/images/screenshots/AddCluster.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/AddTeam.JPG b/src/main/resources/static/assets/images/screenshots/AddTeam.JPG
index 5a39e15..c74787b 100644
Binary files a/src/main/resources/static/assets/images/screenshots/AddTeam.JPG and b/src/main/resources/static/assets/images/screenshots/AddTeam.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/AddUser.JPG b/src/main/resources/static/assets/images/screenshots/AddUser.JPG
index 19ecdce..5ffd8ae 100644
Binary files a/src/main/resources/static/assets/images/screenshots/AddUser.JPG and b/src/main/resources/static/assets/images/screenshots/AddUser.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/ApproveACL.JPG b/src/main/resources/static/assets/images/screenshots/ApproveACL.JPG
index a1bc004..71581a9 100644
Binary files a/src/main/resources/static/assets/images/screenshots/ApproveACL.JPG and b/src/main/resources/static/assets/images/screenshots/ApproveACL.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/ApproveTopics.JPG b/src/main/resources/static/assets/images/screenshots/ApproveTopics.JPG
index dff192f..aefd374 100644
Binary files a/src/main/resources/static/assets/images/screenshots/ApproveTopics.JPG and b/src/main/resources/static/assets/images/screenshots/ApproveTopics.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/BrowseTopics.JPG b/src/main/resources/static/assets/images/screenshots/BrowseTopics.JPG
index 4ecf43b..6f4f30b 100644
Binary files a/src/main/resources/static/assets/images/screenshots/BrowseTopics.JPG and b/src/main/resources/static/assets/images/screenshots/BrowseTopics.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/Dashboard.JPG b/src/main/resources/static/assets/images/screenshots/Dashboard.JPG
index 20df24d..27a8fe9 100644
Binary files a/src/main/resources/static/assets/images/screenshots/Dashboard.JPG and b/src/main/resources/static/assets/images/screenshots/Dashboard.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/Environments.JPG b/src/main/resources/static/assets/images/screenshots/Environments.JPG
index 7821141..c6b4b5d 100644
Binary files a/src/main/resources/static/assets/images/screenshots/Environments.JPG and b/src/main/resources/static/assets/images/screenshots/Environments.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/Logout.JPG b/src/main/resources/static/assets/images/screenshots/Logout.JPG
index 80cd323..e47f598 100644
Binary files a/src/main/resources/static/assets/images/screenshots/Logout.JPG and b/src/main/resources/static/assets/images/screenshots/Logout.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/MyAclRequests.JPG b/src/main/resources/static/assets/images/screenshots/MyAclRequests.JPG
index b0860bc..3832219 100644
Binary files a/src/main/resources/static/assets/images/screenshots/MyAclRequests.JPG and b/src/main/resources/static/assets/images/screenshots/MyAclRequests.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/MyTopicRequests.JPG b/src/main/resources/static/assets/images/screenshots/MyTopicRequests.JPG
index d4e7d79..d1dd6d3 100644
Binary files a/src/main/resources/static/assets/images/screenshots/MyTopicRequests.JPG and b/src/main/resources/static/assets/images/screenshots/MyTopicRequests.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/RequestACL.JPG b/src/main/resources/static/assets/images/screenshots/RequestACL.JPG
index 95a5959..6449cbd 100644
Binary files a/src/main/resources/static/assets/images/screenshots/RequestACL.JPG and b/src/main/resources/static/assets/images/screenshots/RequestACL.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/RequestSchema.JPG b/src/main/resources/static/assets/images/screenshots/RequestSchema.JPG
index 7d064b6..675f296 100644
Binary files a/src/main/resources/static/assets/images/screenshots/RequestSchema.JPG and b/src/main/resources/static/assets/images/screenshots/RequestSchema.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/RequestTopic.JPG b/src/main/resources/static/assets/images/screenshots/RequestTopic.JPG
index 536ea56..df846b9 100644
Binary files a/src/main/resources/static/assets/images/screenshots/RequestTopic.JPG and b/src/main/resources/static/assets/images/screenshots/RequestTopic.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/ServerConfig.JPG b/src/main/resources/static/assets/images/screenshots/ServerConfig.JPG
index 4e5de99..a202bd2 100644
Binary files a/src/main/resources/static/assets/images/screenshots/ServerConfig.JPG and b/src/main/resources/static/assets/images/screenshots/ServerConfig.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/SynchronizeAcls.JPG b/src/main/resources/static/assets/images/screenshots/SynchronizeAcls.JPG
index 3f5e989..dcea231 100644
Binary files a/src/main/resources/static/assets/images/screenshots/SynchronizeAcls.JPG and b/src/main/resources/static/assets/images/screenshots/SynchronizeAcls.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/SynchronizeTopics.JPG b/src/main/resources/static/assets/images/screenshots/SynchronizeTopics.JPG
index 3f1f056..59add57 100644
Binary files a/src/main/resources/static/assets/images/screenshots/SynchronizeTopics.JPG and b/src/main/resources/static/assets/images/screenshots/SynchronizeTopics.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/ViewAcls.JPG b/src/main/resources/static/assets/images/screenshots/ViewAcls.JPG
index 24350af..e87a9b8 100644
Binary files a/src/main/resources/static/assets/images/screenshots/ViewAcls.JPG and b/src/main/resources/static/assets/images/screenshots/ViewAcls.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/ViewTeams.JPG b/src/main/resources/static/assets/images/screenshots/ViewTeams.JPG
index c7b27b1..ae98658 100644
Binary files a/src/main/resources/static/assets/images/screenshots/ViewTeams.JPG and b/src/main/resources/static/assets/images/screenshots/ViewTeams.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/ViewUsers.JPG b/src/main/resources/static/assets/images/screenshots/ViewUsers.JPG
index b7f305c..2e9c673 100644
Binary files a/src/main/resources/static/assets/images/screenshots/ViewUsers.JPG and b/src/main/resources/static/assets/images/screenshots/ViewUsers.JPG differ
diff --git a/src/main/resources/static/assets/images/screenshots/arch.png b/src/main/resources/static/assets/images/screenshots/arch.png
index 2f67fb5..dcfafc8 100644
Binary files a/src/main/resources/static/assets/images/screenshots/arch.png and b/src/main/resources/static/assets/images/screenshots/arch.png differ
diff --git a/src/main/resources/static/assets/images/screenshots/login.JPG b/src/main/resources/static/assets/images/screenshots/login.JPG
index ee947fb..1244187 100644
Binary files a/src/main/resources/static/assets/images/screenshots/login.JPG and b/src/main/resources/static/assets/images/screenshots/login.JPG differ
diff --git a/src/main/resources/static/index.html b/src/main/resources/static/index.html
index 2fd08f4..7c5bc0d 100644
--- a/src/main/resources/static/index.html
+++ b/src/main/resources/static/index.html
@@ -21,7 +21,7 @@
-
+
@@ -56,23 +56,7 @@
-
+
@@ -82,12 +66,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
+
diff --git a/src/main/resources/static/js/browseAcls.js b/src/main/resources/static/js/browseAcls.js
index 794d5dc..fed4cc2 100644
--- a/src/main/resources/static/js/browseAcls.js
+++ b/src/main/resources/static/js/browseAcls.js
@@ -58,6 +58,7 @@ app.controller("browseAclsCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
@@ -158,5 +159,6 @@ app.controller("browseAclsCtrl", function($scope, $http, $location, $window) {
};
+
}
);
\ No newline at end of file
diff --git a/src/main/resources/static/js/browseTopics.js b/src/main/resources/static/js/browseTopics.js
index da89fe8..57d58b6 100644
--- a/src/main/resources/static/js/browseTopics.js
+++ b/src/main/resources/static/js/browseTopics.js
@@ -61,6 +61,7 @@ app.controller("browseTopicsCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/envs.js b/src/main/resources/static/js/envs.js
index c0fe784..ffc54ae 100644
--- a/src/main/resources/static/js/envs.js
+++ b/src/main/resources/static/js/envs.js
@@ -48,6 +48,22 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
);
};
+ $scope.getOtherEnvs = function() {
+
+ $http({
+ method: "GET",
+ url: "getOtherEnvs",
+ headers : { 'Content-Type' : 'application/json' }
+ }).success(function(output) {
+ $scope.allotherenvs = output;
+ }).error(
+ function(error)
+ {
+ $scope.alert = error;
+ }
+ );
+ };
+
$scope.deleteEnv = function(idval) {
if (!window.confirm("Are you sure, you would like to delete the cluster : "
@@ -80,48 +96,48 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
if($scope.addNewEnv.defparts.length<=0 || $scope.addNewEnv.defparts<=0)
{
$scope.alertnote = "Default partitions should not be empty and should be greater than 0";
- $scope.showAlertToast();
+ // $scope.showAlertToast();
return;
}
if($scope.addNewEnv.defmaxparts.length<=0 || $scope.addNewEnv.defmaxparts<=0)
{
$scope.alertnote = "Maximum partitions should not be empty and should be greater than 0";
- $scope.showAlertToast();
+ // $scope.showAlertToast();
return;
}
if($scope.addNewEnv.defrepfctr.length<=0 || $scope.addNewEnv.defrepfctr<=0)
{
$scope.alertnote = "Default replication factor should not be empty and should be greater than 0";
- $scope.showAlertToast();
+ // $scope.showAlertToast();
return;
}
if($scope.addNewEnv.type == undefined)
{
$scope.alertnote = "Please select the cluster type";
- $scope.showAlertToast();
+ // $scope.showAlertToast();
return;
}
if($scope.addNewEnv.host == undefined)
{
$scope.alertnote = "Please fill in host";
- $scope.showAlertToast();
+ // $scope.showAlertToast();
return;
}
if($scope.addNewEnv.envname == undefined)
{
$scope.alertnote = "Please fill in a name for cluster";
- $scope.showAlertToast();
+ // $scope.showAlertToast();
return;
}
if($scope.addNewEnv.envname.length > 3)
{
$scope.alertnote = "Cluster name cannot be more than 3 characters.";
- $scope.showAlertToast();
+ // $scope.showAlertToast();
return;
}
@@ -144,13 +160,13 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
data: serviceInput
}).success(function(output) {
$scope.alert = "New cluster added: "+output.result;
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
$scope.alert = error;
$scope.alertnote = error;
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
@@ -185,6 +201,7 @@ app.controller("envsCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/execAcls.js b/src/main/resources/static/js/execAcls.js
index 6814724..cc966fc 100644
--- a/src/main/resources/static/js/execAcls.js
+++ b/src/main/resources/static/js/execAcls.js
@@ -57,6 +57,7 @@ app.controller("execAclsCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
@@ -145,14 +146,14 @@ app.controller("execAclsCtrl", function($scope, $http, $location, $window) {
$scope.alert = "Acl Approve Request : "+output.result;
$scope.getMyAclRequests();
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
$scope.alert = error;
$scope.alertnote = error;
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
}
@@ -171,14 +172,14 @@ app.controller("execAclsCtrl", function($scope, $http, $location, $window) {
$scope.alert = "Acl Decline Request : "+output.result;
$scope.getMyAclRequests();
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
$scope.alert = error;
$scope.alertnote = error;
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
}
diff --git a/src/main/resources/static/js/execSchemas.js b/src/main/resources/static/js/execSchemas.js
index 08f3ebc..543c440 100644
--- a/src/main/resources/static/js/execSchemas.js
+++ b/src/main/resources/static/js/execSchemas.js
@@ -57,14 +57,14 @@ app.controller("execSchemasCtrl", function($scope, $http, $location, $window) {
$scope.alert = "Schema Approve Request : "+output.result;
$scope.getMySchemaRequests();
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
$scope.alert = error;
$scope.alertnote = error;
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
}
@@ -82,14 +82,14 @@ app.controller("execSchemasCtrl", function($scope, $http, $location, $window) {
$scope.alert = "Schema Decline Request : "+output.result;
$scope.getMySchemaRequests();
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
$scope.alert = error;
$scope.alertnote = error;
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
}
@@ -125,6 +125,7 @@ app.controller("execSchemasCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/execTopics.js b/src/main/resources/static/js/execTopics.js
index e8ffb33..0a4a932 100644
--- a/src/main/resources/static/js/execTopics.js
+++ b/src/main/resources/static/js/execTopics.js
@@ -60,14 +60,14 @@ app.controller("execTopicsCtrl", function($scope, $http, $location, $window) {
$scope.alert = "Topic Approve Request : "+output.result;
$scope.getMyTopicRequests();
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
$scope.alert = error;
$scope.alertnote = error;
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
}
@@ -85,14 +85,14 @@ app.controller("execTopicsCtrl", function($scope, $http, $location, $window) {
$scope.alert = "Topic Approve Request : "+output.result;
$scope.getMyTopicRequests();
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
$scope.alert = error;
$scope.alertnote = error;
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
}
@@ -128,6 +128,7 @@ app.controller("execTopicsCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/index.js b/src/main/resources/static/js/index.js
index 9845b80..3c7ae85 100644
--- a/src/main/resources/static/js/index.js
+++ b/src/main/resources/static/js/index.js
@@ -92,6 +92,7 @@ app.controller("dashboardCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.myteamtopics = output.myteamtopics;
$scope.kafkawizeversion = output.kafkawizeversion;
$scope.notifications = output.notifications;
diff --git a/src/main/resources/static/js/indexapp.js b/src/main/resources/static/js/indexapp.js
index 464eb51..ed2086f 100644
--- a/src/main/resources/static/js/indexapp.js
+++ b/src/main/resources/static/js/indexapp.js
@@ -30,6 +30,7 @@ app.controller("indexCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.myteamtopics = output.myteamtopics;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
diff --git a/src/main/resources/static/js/manageUsers.js b/src/main/resources/static/js/manageUsers.js
index 7479bc2..0977b30 100644
--- a/src/main/resources/static/js/manageUsers.js
+++ b/src/main/resources/static/js/manageUsers.js
@@ -101,7 +101,7 @@ app.controller("manageUsersCtrl", function($scope, $http, $location, $window) {
data: {'changePwd' : serviceInput}
}).success(function(output) {
$scope.alert = "Password changed : "+output.result;
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
@@ -131,7 +131,7 @@ app.controller("manageUsersCtrl", function($scope, $http, $location, $window) {
}).success(function(output) {
$scope.alert = "Delete Team Request : "+output.result;
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
$scope.loadTeamsSU();
}).error(
function(error)
@@ -160,7 +160,7 @@ app.controller("manageUsersCtrl", function($scope, $http, $location, $window) {
}).success(function(output) {
$scope.alert = "Delete User Request : "+output.result;
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
$scope.showUsers();
}).error(
function(error)
@@ -190,24 +190,6 @@ app.controller("manageUsersCtrl", function($scope, $http, $location, $window) {
return;
}
- if(!$scope.addNewUser.emailid)
- {
- $scope.alertnote = "Email id is mandatory.";
- $scope.showAlertToast();
- return;
- }
- else if($scope.addNewUser.emailid.length < 7)
- {
- $scope.alertnote = "Please enter a valid email id.";
- $scope.showAlertToast();
- return;
- }
- else if(!$scope.addNewUser.emailid.includes("@"))
- {
- $scope.alertnote = "Please enter a valid email id.";
- $scope.showAlertToast();
- return;
- }
if(!$scope.addNewUser.role.value)
{
@@ -221,7 +203,7 @@ app.controller("manageUsersCtrl", function($scope, $http, $location, $window) {
serviceInput['pwd'] = $scope.addNewUser.pwd;
serviceInput['team'] = $scope.addNewUser.team.teamname;
serviceInput['role'] = $scope.addNewUser.role.value;
- serviceInput['mailid'] = $scope.addNewUser.emailid;
+ serviceInput['mailid'] = '';
if (!window.confirm("Are you sure, you would like to add user : "
+ $scope.addNewUser.username + ": " +
@@ -240,7 +222,7 @@ app.controller("manageUsersCtrl", function($scope, $http, $location, $window) {
data: serviceInput
}).success(function(output) {
$scope.alert = "New User Request : "+output.result;
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
@@ -252,6 +234,7 @@ app.controller("manageUsersCtrl", function($scope, $http, $location, $window) {
};
+
$scope.cancelRequest = function() {
$window.location.href = $window.location.origin + "/kafkawize/teams";
}
@@ -302,7 +285,7 @@ app.controller("manageUsersCtrl", function($scope, $http, $location, $window) {
data: serviceInput
}).success(function(output) {
$scope.alert = "New User Team : "+output.result;
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
@@ -360,6 +343,7 @@ app.controller("manageUsersCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/myRequests.js b/src/main/resources/static/js/myRequests.js
index 2bd9e5c..2b8220a 100644
--- a/src/main/resources/static/js/myRequests.js
+++ b/src/main/resources/static/js/myRequests.js
@@ -30,6 +30,7 @@ app.controller("myRequestsCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/requestAcls.js b/src/main/resources/static/js/requestAcls.js
index a4ec876..ae4150b 100644
--- a/src/main/resources/static/js/requestAcls.js
+++ b/src/main/resources/static/js/requestAcls.js
@@ -36,6 +36,7 @@ app.controller("requestAclsCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
@@ -195,7 +196,7 @@ app.controller("requestAclsCtrl", function($scope, $http, $location, $window) {
if($scope.addAcl.topicreqtype.value == 'Consumer' && !$scope.addAcl.consumergroup)
{
$scope.alertnote = "Consumer group is not filled."
- $scope.showAlertToast();
+ $scope.showAlertToast();
return;
}
@@ -213,7 +214,7 @@ app.controller("requestAclsCtrl", function($scope, $http, $location, $window) {
{
//alert("This topic is not owned by any team. Synchronize the metadata.");
$scope.alertnote = "This topic is not owned by any team. Synchronize the metadata.";
- $scope.showAlertToast();
+ $scope.showAlertToast();
return false;
}
@@ -222,7 +223,7 @@ app.controller("requestAclsCtrl", function($scope, $http, $location, $window) {
else
{
$scope.alertnote = "Please fill in a valid IP address or SSL-CN Name of the Producer/Consumer client";
- $scope.showAlertToast();
+ $scope.showAlertToast();
return;
}
@@ -235,13 +236,13 @@ app.controller("requestAclsCtrl", function($scope, $http, $location, $window) {
data: serviceInput
}).success(function(output) {
$scope.alert = "Acl Request : "+output.result;
- $scope.showSuccessToast();
+ $scope.showSuccessToast();
}).error(
function(error)
{
$scope.alert = error;
$scope.alertnote = error;
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
diff --git a/src/main/resources/static/js/requestAvroSchemaUpload.js b/src/main/resources/static/js/requestAvroSchemaUpload.js
index af4c43c..aa74198 100644
--- a/src/main/resources/static/js/requestAvroSchemaUpload.js
+++ b/src/main/resources/static/js/requestAvroSchemaUpload.js
@@ -122,14 +122,14 @@ app.controller("requestSchemaCtrl", function($scope, $http, $location, $window)
data: serviceInput
}).success(function(output) {
$scope.alert = "Schema Upload Request : "+output.result;
- $scope.showSuccessToast();
+ // $scope.showSuccessToast();
}).error(
function(error)
{
$scope.alert = error;
//alert("Error : "+error.value);
$scope.alertnote = error;
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
@@ -164,6 +164,7 @@ app.controller("requestSchemaCtrl", function($scope, $http, $location, $window)
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/requestTopics.js b/src/main/resources/static/js/requestTopics.js
index 0e51b88..14cd1cf 100644
--- a/src/main/resources/static/js/requestTopics.js
+++ b/src/main/resources/static/js/requestTopics.js
@@ -54,7 +54,7 @@ app.controller("requestTopicsCtrl", function($scope, $http, $location, $window)
if(!$scope.addTopic.topicpartitions || $scope.addTopic.topicpartitions == 'selected'){
//alert("Please fill in topic partitions");
$scope.alertnote = "Please select topic partitions.";
- $scope.showAlertToast();
+ $scope.showAlertToast();
return;
}
@@ -81,7 +81,7 @@ app.controller("requestTopicsCtrl", function($scope, $http, $location, $window)
$scope.alert = error;
$scope.alertnote = error;
// alert("Error : "+error.value);
- $scope.showAlertToast();
+ // $scope.showAlertToast();
}
);
@@ -137,6 +137,7 @@ app.controller("requestTopicsCtrl", function($scope, $http, $location, $window)
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/serverConfig.js b/src/main/resources/static/js/serverConfig.js
index 3ac08a5..421abd7 100644
--- a/src/main/resources/static/js/serverConfig.js
+++ b/src/main/resources/static/js/serverConfig.js
@@ -64,6 +64,7 @@ app.controller("serverConfigCtrl", function($scope, $http, $location, $window) {
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/showActivityLog.js b/src/main/resources/static/js/showActivityLog.js
index d1a11e6..46054c0 100644
--- a/src/main/resources/static/js/showActivityLog.js
+++ b/src/main/resources/static/js/showActivityLog.js
@@ -46,6 +46,7 @@ app.controller("showActivityLogCtrl", function($scope, $http, $location, $window
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
diff --git a/src/main/resources/static/js/synchronizeAcls.js b/src/main/resources/static/js/synchronizeAcls.js
index a90f4f0..3925c9a 100644
--- a/src/main/resources/static/js/synchronizeAcls.js
+++ b/src/main/resources/static/js/synchronizeAcls.js
@@ -49,6 +49,7 @@ app.controller("synchronizeAclsCtrl", function($scope, $http, $location, $window
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
@@ -89,87 +90,7 @@ app.controller("synchronizeAclsCtrl", function($scope, $http, $location, $window
);
}
- $scope.updatedSyncArray = [];
- $scope.getDetails = function(sequence, req_no, teamselected, topic, consumergroup, acl_ip, acl_ssl, acltype) {
- var serviceInput = {};
-
- serviceInput['sequence'] = sequence;
- serviceInput['req_no'] = req_no;
- serviceInput['topicName'] = topic;
- serviceInput['teamSelected'] = teamselected;
- serviceInput['consumerGroup'] = consumergroup;
- serviceInput['aclIp'] = acl_ip;
- serviceInput['aclSsl'] = acl_ssl;
- serviceInput['aclType'] = acltype;
- serviceInput['envSelected'] = $scope.getAcls.envName.name.key;
-
- $scope.updatedSyncArray.push(serviceInput);
- }
-
- $scope.synchAcls = function() {
-
- var serviceInput = {};
-
- if(!$scope.getAcls.envName)
- return;
-
- if (!window.confirm("Are you sure, you would like to Synchronize this info on "+$scope.getAcls.envName.name.key+ " ?")) {
- $scope.updatedSyncArray = [];
- return;
- }
-
- $http({
- method: "POST",
- url: "updateSyncAcls",
- headers : { 'Content-Type' : 'application/json' },
- params: {'syncAclUpdates' : $scope.updatedSyncArray },
- data: $scope.updatedSyncArray
- }).success(function(output) {
- $scope.alert = "Acl Sync Request : "+output.result;
- $scope.updatedSyncArray = [];
- $scope.showSuccessToast();
- $scope.getAcls(1);
- }).error(
- function(error)
- {
- $scope.alert = error;
- $scope.alertnote = error;
- $scope.showAlertToast();
- }
- );
-
- };
-
- // We add the "time" query parameter to prevent IE
- // from caching ajax results
-
- $scope.getAcls = function(pageNoSelected) {
-
- var serviceInput = {};
- serviceInput['env'] = $scope.getAcls.envName.name.key;
-
- $http({
- method: "GET",
- url: "getSyncAcls",
- headers : { 'Content-Type' : 'application/json' },
- params: {'env' : $scope.getAcls.envName.name.key, 'topicnamesearch' : $scope.getAcls.topicnamesearch,
- 'pageNo' : pageNoSelected }
- }).success(function(output) {
- $scope.resultBrowse = output;
- if(output!=null){
- $scope.resultPages = output[0].allPageNos;
- $scope.resultPageSelected = pageNoSelected;
- }
- }).error(
- function(error)
- {
- $scope.resultBrowse = [];
- $scope.alert = error;
- }
- );
-
- };
$scope.getExecAuth = function() {
//alert("onload");
diff --git a/src/main/resources/static/js/synchronizeTopics.js b/src/main/resources/static/js/synchronizeTopics.js
index be44dbf..3859f67 100644
--- a/src/main/resources/static/js/synchronizeTopics.js
+++ b/src/main/resources/static/js/synchronizeTopics.js
@@ -58,6 +58,7 @@ app.controller("synchronizeTopicsCtrl", function($scope, $http, $location, $wind
$scope.statusauth = output.status;
$scope.userlogged = output.username;
$scope.teamname = output.teamname;
+ $scope.userrole = output.userrole;
$scope.notifications = output.notifications;
$scope.notificationsAcls = output.notificationsAcls;
$scope.notificationsSchemas = output.notificationsSchemas;
@@ -98,83 +99,6 @@ app.controller("synchronizeTopicsCtrl", function($scope, $http, $location, $wind
);
}
- $scope.updatedSyncArray = [];
- $scope.updateTopicDetails = function(sequence, teamselected,topic, partitions, replicationFactor) {
- var serviceInput = {};
- serviceInput['sequence'] = sequence;
- serviceInput['topicName'] = topic;
- serviceInput['partitions'] = partitions;
- serviceInput['replicationFactor'] = replicationFactor;
- serviceInput['teamSelected'] = teamselected;
- serviceInput['envSelected'] = $scope.getTopics.envName.name.key;
-
- $scope.updatedSyncArray.push(serviceInput);
- }
-
- $scope.synchTopics = function() {
-
- var serviceInput = {};
-
- if(!$scope.getTopics.envName)
- return;
-
- if (!window.confirm("Are you sure, you would like to Synchronize this info ? "+$scope.getTopics.envName.name.key)) {
- $scope.updatedSyncArray = [];
- return;
- }
-
- $http({
- method: "POST",
- url: "updateSyncTopics",
- headers : { 'Content-Type' : 'application/json' },
- params: {'updatedSyncTopics' : $scope.updatedSyncArray},
- data: $scope.updatedSyncArray
- }).success(function(output) {
- $scope.alert = "Topic Sync Request : "+output.result;
- $scope.updatedSyncArray = [];
- $scope.showSuccessToast();
- }).error(
- function(error)
- {
- $scope.alert = error;
- $scope.alertnote = error;
- $scope.showAlertToast();
- }
- );
-
- };
-
- // We add the "time" query parameter to prevent IE
- // from caching ajax results
-
- $scope.getTopics = function(pageNoSelected) {
-
- var serviceInput = {};
- serviceInput['env'] = $scope.getTopics.envName.name.key;
-
- $http({
- method: "GET",
- url: "getSyncTopics",
- headers : { 'Content-Type' : 'application/json' },
- params: {'env' : $scope.getTopics.envName.name.key, 'topicnamesearch' : $scope.getTopics.topicnamesearch,
- 'pageNo' : pageNoSelected }
- }).success(function(output) {
- $scope.resultBrowse = output;
- if(output!=null && output.length !=0){
- $scope.resultPages = output[0].allPageNos;
- $scope.resultPageSelected = pageNoSelected;
- }
- $scope.alert = "";
- }).error(
- function(error)
- {
- $scope.resultBrowse = [];
- $scope.alert = error;
- }
- );
-
- };
-
$scope.getExecAuth = function() {
//alert("onload");
$http({
diff --git a/src/main/resources/templates/activityLog.html b/src/main/resources/templates/activityLog.html
index afb04c1..aa6cd10 100644
--- a/src/main/resources/templates/activityLog.html
+++ b/src/main/resources/templates/activityLog.html
@@ -19,7 +19,7 @@
-
+
@@ -59,23 +59,7 @@
-
+
@@ -85,12 +69,7 @@
- -
- -
+
@@ -166,8 +145,8 @@ Schema Requests
-
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
diff --git a/src/main/resources/templates/addEnv.html b/src/main/resources/templates/addEnv.html
index 2778cfd..b6d6536 100644
--- a/src/main/resources/templates/addEnv.html
+++ b/src/main/resources/templates/addEnv.html
@@ -19,7 +19,7 @@
-
+
@@ -55,23 +55,7 @@
-
+
@@ -81,12 +65,7 @@
- -
- -
+
@@ -198,8 +177,8 @@ Schema Requests
-
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -372,7 +377,7 @@ {{userlogged}}
-
+
@@ -401,7 +406,12 @@
{{userlogged}}
@@ -424,10 +434,11 @@
{{userlogged}}
@@ -452,13 +463,7 @@
{{userlogged}}
-
-
-
-
-
-
+
@@ -469,6 +474,15 @@
{{userlogged}}
+
+
+
+
+
+
+
diff --git a/src/main/resources/templates/addTeam.html b/src/main/resources/templates/addTeam.html
index ec5f83e..a51b623 100644
--- a/src/main/resources/templates/addTeam.html
+++ b/src/main/resources/templates/addTeam.html
@@ -19,7 +19,7 @@
-
+
@@ -55,23 +55,7 @@
-
+
@@ -81,12 +65,7 @@
- -
- -
+
@@ -185,7 +164,6 @@ Schema Requests
-
@@ -197,8 +175,8 @@
Schema Requests
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
diff --git a/src/main/resources/templates/addUser.html b/src/main/resources/templates/addUser.html
index f26cdf2..1d30093 100644
--- a/src/main/resources/templates/addUser.html
+++ b/src/main/resources/templates/addUser.html
@@ -19,7 +19,7 @@
-
+
@@ -55,23 +55,7 @@
-
+
@@ -81,12 +65,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -432,18 +436,6 @@ {{userlogged}}
-
diff --git a/src/main/resources/templates/browseAcls.html b/src/main/resources/templates/browseAcls.html
index 7c38905..d6fdeb9 100644
--- a/src/main/resources/templates/browseAcls.html
+++ b/src/main/resources/templates/browseAcls.html
@@ -19,7 +19,7 @@
-
+
@@ -55,23 +55,7 @@
-
+
@@ -81,17 +65,11 @@
- -
- -
+
-
@@ -146,7 +124,6 @@
Schema Requests
-
@@ -161,8 +138,8 @@
Schema Requests
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -433,7 +436,6 @@ {{userlogged}}
{{ resultB.acl_ip}} |
{{ resultB.acl_ssl}} |
-
diff --git a/src/main/resources/templates/browseTopics.html b/src/main/resources/templates/browseTopics.html
index cbdce7e..12f8aa8 100644
--- a/src/main/resources/templates/browseTopics.html
+++ b/src/main/resources/templates/browseTopics.html
@@ -19,7 +19,7 @@
-
+
@@ -83,23 +83,7 @@
-
+
@@ -109,12 +93,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -515,8 +520,8 @@ Clusters
-
+
diff --git a/src/main/resources/templates/envs.html b/src/main/resources/templates/envs.html
index c445b66..1f5649d 100644
--- a/src/main/resources/templates/envs.html
+++ b/src/main/resources/templates/envs.html
@@ -19,7 +19,7 @@
-
+
@@ -59,23 +59,7 @@
-
+
@@ -85,12 +69,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -407,16 +412,14 @@ {{userlogged}}
{{ allenv.host }} |
{{ allenv.port }} |
-
- PLAIN |
+
+ PLAINTEXT |
-
- {{ allenv.protocol}} |
{{ allenv.type }} |
{{ allenv.otherParams }} |
|
@@ -463,15 +466,13 @@ {{userlogged}}
{{ allenv.host }} |
{{ allenv.port }} |
-
- PLAIN |
+
+ PLAINTEXT |
-
- {{ allenv.protocol}} |
{{ allenv.type }} |
|
diff --git a/src/main/resources/templates/execAcls.html b/src/main/resources/templates/execAcls.html
index 3a74056..8656b9a 100644
--- a/src/main/resources/templates/execAcls.html
+++ b/src/main/resources/templates/execAcls.html
@@ -19,7 +19,7 @@
-
+
@@ -56,23 +56,7 @@
-
+
@@ -82,17 +66,11 @@
- -
- -
+
-
@@ -143,7 +121,6 @@ Schema Requests
-
@@ -158,8 +135,8 @@ Schema Requests
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -385,7 +388,7 @@ Consumer Group
{{ aclRequest[0].consumergroup }}
IP Address
{{ aclRequest[0].acl_ip }}
-
SSL
{{ aclRequest[0].acl_ssl }}
+ Principle
{{ aclRequest[0].acl_ssl }}
Requestor
{{ aclRequest[0].username }}
diff --git a/src/main/resources/templates/execSchemas.html b/src/main/resources/templates/execSchemas.html
index 523d303..e8bdb69 100644
--- a/src/main/resources/templates/execSchemas.html
+++ b/src/main/resources/templates/execSchemas.html
@@ -19,7 +19,7 @@
-
+
@@ -56,23 +56,7 @@
-
+
@@ -82,12 +66,7 @@
- -
- -
+
@@ -184,7 +163,6 @@ Schema Requests
-
@@ -199,8 +177,8 @@ Schema Requests
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
diff --git a/src/main/resources/templates/execTopics.html b/src/main/resources/templates/execTopics.html
index 4281f12..61f03d7 100644
--- a/src/main/resources/templates/execTopics.html
+++ b/src/main/resources/templates/execTopics.html
@@ -19,7 +19,7 @@
-
+
@@ -56,23 +56,7 @@
-
+
@@ -82,12 +66,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html
index 2fd08f4..9b51bf4 100644
--- a/src/main/resources/templates/index.html
+++ b/src/main/resources/templates/index.html
@@ -21,7 +21,7 @@
-
+
@@ -56,23 +56,7 @@
-
+
@@ -82,12 +66,7 @@
- -
- -
+
@@ -100,6 +79,7 @@
+
+
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
diff --git a/src/main/resources/templates/login.html b/src/main/resources/templates/login.html
index 6a45774..502154b 100644
--- a/src/main/resources/templates/login.html
+++ b/src/main/resources/templates/login.html
@@ -16,7 +16,7 @@
-
+
@@ -45,78 +45,85 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
-
-
-
+
@@ -168,6 +175,7 @@
You have been logged out.
+
diff --git a/src/main/resources/templates/myAclRequests.html b/src/main/resources/templates/myAclRequests.html
index a723a5c..d8b4fe2 100644
--- a/src/main/resources/templates/myAclRequests.html
+++ b/src/main/resources/templates/myAclRequests.html
@@ -19,7 +19,7 @@
-
+
@@ -59,23 +59,7 @@
-
+
@@ -85,12 +69,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -396,7 +400,7 @@ Acl Requests
Cluster |
Requestor |
IP Address |
- SSL |
+ Principle |
Status |
Requested Time |
@@ -427,7 +431,7 @@ Acl Requests
{{ aclRequest.aclType }} |
|
diff --git a/src/main/resources/templates/myProfile.html b/src/main/resources/templates/myProfile.html
index a053547..7d1dc55 100644
--- a/src/main/resources/templates/myProfile.html
+++ b/src/main/resources/templates/myProfile.html
@@ -19,7 +19,7 @@
-
+
@@ -59,23 +59,7 @@
-
+
@@ -85,12 +69,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -434,17 +438,7 @@ {{userlogged}}
-
diff --git a/src/main/resources/templates/myTopicRequests.html b/src/main/resources/templates/myTopicRequests.html
index e9f2006..e19c1f4 100644
--- a/src/main/resources/templates/myTopicRequests.html
+++ b/src/main/resources/templates/myTopicRequests.html
@@ -19,7 +19,7 @@
-
+
@@ -59,23 +59,7 @@
-
+
@@ -85,58 +69,12 @@
- -
- -
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -191,7 +129,6 @@ Schema Requests
-
@@ -206,8 +143,8 @@ Schema Requests
-
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -428,7 +391,7 @@ My Topic Requests
{{ topicRequest.environment }}
- {{ topicRequest.username }} |
+ {{ topicRequest.requestor }} |
@@ -446,7 +409,7 @@ My Topic Requests
{{ topicRequest.requesttimestring }} |
|
diff --git a/src/main/resources/templates/requestAcls.html b/src/main/resources/templates/requestAcls.html
index d24d1e7..67f0291 100644
--- a/src/main/resources/templates/requestAcls.html
+++ b/src/main/resources/templates/requestAcls.html
@@ -19,7 +19,7 @@
-
+
@@ -55,23 +55,7 @@
-
+
@@ -81,12 +65,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -454,7 +458,7 @@ {{userlogged}}
-
+
@@ -474,7 +478,7 @@ {{userlogged}}
diff --git a/src/main/resources/templates/requestTopics.html b/src/main/resources/templates/requestTopics.html
index ee03494..027a20c 100644
--- a/src/main/resources/templates/requestTopics.html
+++ b/src/main/resources/templates/requestTopics.html
@@ -19,7 +19,7 @@
-
+
@@ -55,23 +55,7 @@
-
+
@@ -81,12 +65,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -414,6 +418,7 @@ {{userlogged}}
+ Ex: mortgagetopic
@@ -431,9 +436,6 @@ {{userlogged}}
-
-
-
diff --git a/src/main/resources/templates/serverConfig.html b/src/main/resources/templates/serverConfig.html
index 8af5bb5..715ea2c 100644
--- a/src/main/resources/templates/serverConfig.html
+++ b/src/main/resources/templates/serverConfig.html
@@ -19,7 +19,7 @@
-
+
@@ -59,23 +59,7 @@
-
+
@@ -85,12 +69,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
diff --git a/src/main/resources/templates/showTeams.html b/src/main/resources/templates/showTeams.html
index 3df1877..5549947 100644
--- a/src/main/resources/templates/showTeams.html
+++ b/src/main/resources/templates/showTeams.html
@@ -19,7 +19,7 @@
-
+
@@ -59,23 +59,7 @@
-
+
@@ -85,12 +69,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -407,7 +411,7 @@ {{userlogged}}
{{ teamDetails.contactperson }} |
|
diff --git a/src/main/resources/templates/showUsers.html b/src/main/resources/templates/showUsers.html
index 921a11e..9ff649d 100644
--- a/src/main/resources/templates/showUsers.html
+++ b/src/main/resources/templates/showUsers.html
@@ -19,7 +19,7 @@
-
+
@@ -59,23 +59,7 @@
-
+
@@ -85,12 +69,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -381,7 +385,7 @@ {{userlogged}}
-
+
@@ -413,7 +417,7 @@ {{userlogged}}
|
|
diff --git a/src/main/resources/templates/synchronizeAcls.html b/src/main/resources/templates/synchronizeAcls.html
index 42da233..a9a8a68 100644
--- a/src/main/resources/templates/synchronizeAcls.html
+++ b/src/main/resources/templates/synchronizeAcls.html
@@ -19,7 +19,7 @@
-
+
@@ -84,23 +84,7 @@
-
+
@@ -110,12 +94,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -357,158 +361,24 @@ {{userlogged}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Notification
-
No topics found !! Please check kafka connectivity or if you have selected the right cluster/topics.
-
-
-
-
-
-
-
Notification
-
{{ alerttop }}
-
-
-
-
-
-
-
-
-
Notification
-
{{ alert }}
-
-
-
-
-
-
-
Notification
-
{{ errorMessage }}
-
-
-
-
-
+
Notification
-
You are not authorized to access this page !!
+
Sorry, this feature is removed.
-
-
-
-
-
-
-
- Synchronize Acls - Owners |
-
-
-
-
-
-
-
- Team |
- TopicName |
- ConsumerGroup |
- Hosts |
- Principle |
- AclType |
-
-
-
-
-
-
-
-
- |
- {{ resultBrowset.topicname}} |
- {{ resultBrowset.consumergroup}} |
- {{ resultBrowset.acl_ip}} |
- {{ resultBrowset.acl_ssl}} |
-
-
- {{ resultBrowset.topictype}} |
-
-
- {{ resultBrowset.topictype}} |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ alert }}
-
{{ alertnote }}
-
-
diff --git a/src/main/resources/templates/synchronizeTopics.html b/src/main/resources/templates/synchronizeTopics.html
index 211dd53..647d6ef 100644
--- a/src/main/resources/templates/synchronizeTopics.html
+++ b/src/main/resources/templates/synchronizeTopics.html
@@ -19,7 +19,7 @@
-
+
@@ -84,23 +84,7 @@
-
+
@@ -110,12 +94,7 @@
+
+
+
+
+ -
+
+
+ |
+
+
+
+
+ -
+
+
+
+ |
+
+
+
+
+
@@ -357,148 +362,15 @@ {{userlogged}}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
Notification
-
No topics found !! Please check kafka connectivity or if you have selected the right cluster/topics.
-
-
-
-
-
-
-
-
-
-
Notification
-
{{ alerttop }}
-
-
-
-
-
-
-
-
-
-
Notification
-
{{ alert }}
-
-
-
-
-
-
-
-
-
-
Notification
-
{{ errorMessage }}
-
-
-
-
-
+
Notification
-
You are not authorized to access this page !!
+
Sorry, this feature is removed.
-
-
-
-
-
- Synchronize Topics - Owners |
-
-
-
-
-
-
-
- TopicName |
- Partitions |
- Replication Factor |
- Team |
-
-
-
-
-
- {{ resultBrowset.topicname}} |
- {{ resultBrowset.topicpartitions}} |
- {{ resultBrowset.replicationfactor}} |
-
-
- |
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
{{ alert }}
-
{{ alertnote }}
-
-
-
diff --git a/src/test/java/com/kafkamgt/integrationtests/cassandra/TopicAclControllerIT.java b/src/test/java/com/kafkamgt/integrationtests/cassandra/TopicAclControllerIT.java
index 788f4c1..ab3943e 100644
--- a/src/test/java/com/kafkamgt/integrationtests/cassandra/TopicAclControllerIT.java
+++ b/src/test/java/com/kafkamgt/integrationtests/cassandra/TopicAclControllerIT.java
@@ -35,8 +35,7 @@
import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.when;
import static org.springframework.security.test.web.servlet.request.SecurityMockMvcRequestPostProcessors.user;
import static org.springframework.security.test.web.servlet.setup.SecurityMockMvcConfigurers.springSecurity;
@@ -190,24 +189,6 @@ public void test006() throws Exception {
assertThat(res, CoreMatchers.containsString("Team1"));
}
- // Update team of a topic
- @Test
- public void test007() throws Exception {
- List
syncTopicUpdates = utilMethods.getSyncTopicUpdates();
- String jsonReq = new ObjectMapper().writer().writeValueAsString(syncTopicUpdates);
-
- login("superuser","user", "SUPERUSER");
- String response = mvc.perform(MockMvcRequestBuilders
- .post("/updateSyncTopics").with(user("superuser").password("user").roles("SUPERUSER"))
- .content(jsonReq)
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- assertThat(response, CoreMatchers.containsString("success"));
- }
-
// delete a topic request of his own
@Test
public void test008() throws Exception {
@@ -239,7 +220,8 @@ public void test008() throws Exception {
// get topics from cluster
@Test
public void test009() throws Exception {
- when(clusterApiService.getAllTopics(anyString())).thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
+ when(clusterApiService.getAllTopics(anyString(), eq("PLAINTEXT")))
+ .thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
String res = mvc.perform(MockMvcRequestBuilders
.get("/getTopics").with(user("uiuser1").password("user"))
@@ -259,7 +241,8 @@ public void test009() throws Exception {
//get only topic names
@Test
public void test010() throws Exception {
- when(clusterApiService.getAllTopics(anyString())).thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
+ when(clusterApiService.getAllTopics(anyString(), eq("PLAINTEXT")))
+ .thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
String res = mvc.perform(MockMvcRequestBuilders
.get("/getTopicsOnly").with(user("uiuser1").password("user"))
@@ -273,25 +256,6 @@ public void test010() throws Exception {
assertEquals(1, response.size());
}
- // get all topics which can be updated with new team ids
- @Test
- public void test011() throws Exception {
- when(clusterApiService.getAllTopics(anyString())).thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
-
- String res = mvc.perform(MockMvcRequestBuilders
- .get("/getSyncTopics").with(user("uiuser1").password("user"))
- .param("env","DEV")
- .param("pageNo","1")
- .param("topicnamesearch","testtopic")
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- List response = new ObjectMapper().readValue(res, List.class);
- assertEquals(10, response.size());
- }
-
// Get Acl requests before creating one
@Test
@@ -390,7 +354,7 @@ public void test05() throws Exception {
// Request for a acl
@Test
public void test06() throws Exception {
- AclRequests addAclRequest = utilMethods.getAclRequest("testtopic1");
+ AclRequests addAclRequest = utilMethods.getAclRequest("testtopic");
String jsonReq = new ObjectMapper().writer().writeValueAsString(addAclRequest);
String response = mvc.perform(MockMvcRequestBuilders
@@ -458,34 +422,13 @@ public void test08() throws Exception {
assertThat(responseNew, CoreMatchers.containsString("success"));
}
- // update acls with team - sync
- @Test
- public void test09() throws Exception {
-
- List syncUpdates = utilMethods.getSyncAclsUpdates();
-
- String jsonReq = new ObjectMapper().writer().writeValueAsString(syncUpdates);
-
- login("superuser","user", "SUPERUSER");
-
- String response = mvc.perform(MockMvcRequestBuilders
- .post("/updateSyncAcls").with(user("superuser").password("user").roles("SUPERUSER"))
- .content(jsonReq)
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- assertThat(response, CoreMatchers.containsString("success"));
- }
-
// getacls with topic search filter
@Test
public void test11() throws Exception {
List> aclInfo = new ArrayList<>(utilMethods.getClusterAcls2());
- when(clusterApiService.getAcls(anyString()))
+ when(clusterApiService.getAcls(anyString(), eq("PLAINTEXT")))
.thenReturn(aclInfo);
String res = mvc.perform(get("/getAcls").with(user("uiuser1").password("user"))
@@ -499,25 +442,6 @@ public void test11() throws Exception {
assertEquals(1, response.getAclInfoList().size());
}
- // get acls to be synced - retrieve from Source of truth
- @Test
- public void test13() throws Exception {
- List> aclInfo = utilMethods.getClusterAcls();
-
- when(clusterApiService.getAcls(anyString()))
- .thenReturn(aclInfo);
-
- String res = mvc.perform(get("/getSyncAcls").with(user("superuser").password("user").roles("SUPERUSER"))
- .param("env","DEV")
- .param("pageNo","1")
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- List response = new ObjectMapper().readValue(res, List.class);
- assertEquals(1, response.size());
- }
private void login(String user, String pwd, String role) throws Exception {
mvc.perform(get("/login").with(user(user).password(pwd).roles(role))
diff --git a/src/test/java/com/kafkamgt/integrationtests/rdbms/TopicAclControllerIT.java b/src/test/java/com/kafkamgt/integrationtests/rdbms/TopicAclControllerIT.java
index a920b39..3f759be 100644
--- a/src/test/java/com/kafkamgt/integrationtests/rdbms/TopicAclControllerIT.java
+++ b/src/test/java/com/kafkamgt/integrationtests/rdbms/TopicAclControllerIT.java
@@ -186,24 +186,6 @@ public void test006() throws Exception {
assertThat(res, CoreMatchers.containsString("Team1"));
}
- // Update team of a topic
- @Test
- public void test007() throws Exception {
- List syncTopicUpdates = utilMethods.getSyncTopicUpdates();
- String jsonReq = new ObjectMapper().writer().writeValueAsString(syncTopicUpdates);
-
- login("superuser","user", "SUPERUSER");
- String response = mvc.perform(MockMvcRequestBuilders
- .post("/updateSyncTopics").with(user("superuser").password("user").roles("SUPERUSER"))
- .content(jsonReq)
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- assertThat(response, CoreMatchers.containsString("success"));
- }
-
// delete a topic request of his own
@Test
public void test008() throws Exception {
@@ -235,7 +217,8 @@ public void test008() throws Exception {
// get topics from cluster
@Test
public void test009() throws Exception {
- when(clusterApiService.getAllTopics(anyString())).thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
+ when(clusterApiService.getAllTopics(anyString(), eq("PLAINTEXT")))
+ .thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
String res = mvc.perform(MockMvcRequestBuilders
.get("/getTopics").with(user("uiuser1").password("user"))
@@ -255,7 +238,8 @@ public void test009() throws Exception {
//get only topic names
@Test
public void test010() throws Exception {
- when(clusterApiService.getAllTopics(anyString())).thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
+ when(clusterApiService.getAllTopics(anyString(), eq("PLAINTEXT")))
+ .thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
String res = mvc.perform(MockMvcRequestBuilders
.get("/getTopicsOnly").with(user("uiuser1").password("user"))
@@ -269,25 +253,6 @@ public void test010() throws Exception {
assertEquals(1, response.size());
}
- // get all topics which can be updated with new team ids
- @Test
- public void test011() throws Exception {
- when(clusterApiService.getAllTopics(anyString())).thenReturn(utilMethods.getClusterApiTopics("testtopic",10));
-
- String res = mvc.perform(MockMvcRequestBuilders
- .get("/getSyncTopics").with(user("uiuser1").password("user"))
- .param("env","DEV")
- .param("pageNo","1")
- .param("topicnamesearch","testtopic")
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- List response = new ObjectMapper().readValue(res, List.class);
- assertEquals(10, response.size());
- }
-
// Get Acl requests before creating one
@Test
@@ -386,7 +351,7 @@ public void test05() throws Exception {
// Request for a acl
@Test
public void test06() throws Exception {
- AclRequests addAclRequest = utilMethods.getAclRequest("testtopic1");
+ AclRequests addAclRequest = utilMethods.getAclRequest("testtopic");
String jsonReq = new ObjectMapper().writer().writeValueAsString(addAclRequest);
String response = mvc.perform(MockMvcRequestBuilders
@@ -454,34 +419,13 @@ public void test08() throws Exception {
assertThat(responseNew, CoreMatchers.containsString("success"));
}
- // update acls with team - sync
- @Test
- public void test09() throws Exception {
-
- List syncUpdates = utilMethods.getSyncAclsUpdates();
-
- String jsonReq = new ObjectMapper().writer().writeValueAsString(syncUpdates);
-
- login("superuser","user", "SUPERUSER");
-
- String response = mvc.perform(MockMvcRequestBuilders
- .post("/updateSyncAcls").with(user("superuser").password("user").roles("SUPERUSER"))
- .content(jsonReq)
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- assertThat(response, CoreMatchers.containsString("success"));
- }
-
// getacls with topic search filter
@Test
public void test11() throws Exception {
List> aclInfo = new ArrayList<>(utilMethods.getClusterAcls2());
- when(clusterApiService.getAcls(anyString()))
+ when(clusterApiService.getAcls(anyString(), eq("PLAINTEXT")))
.thenReturn(aclInfo);
String res = mvc.perform(get("/getAcls").with(user("uiuser1").password("user"))
@@ -495,26 +439,6 @@ public void test11() throws Exception {
assertEquals(1, response.getAclInfoList().size());
}
- // get acls to be synced - retrieve from Source of truth
- @Test
- public void test13() throws Exception {
- List> aclInfo = utilMethods.getClusterAcls();
-
- when(clusterApiService.getAcls(anyString()))
- .thenReturn(aclInfo);
-
- String res = mvc.perform(get("/getSyncAcls").with(user("superuser").password("user").roles("SUPERUSER"))
- .param("env","DEV")
- .param("pageNo","1")
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- List response = new ObjectMapper().readValue(res, List.class);
- assertEquals(1, response.size());
- }
-
private void login(String user, String pwd, String role) throws Exception {
mvc.perform(get("/login").with(user(user).password(pwd).roles(role))
.contentType(MediaType.APPLICATION_JSON)
diff --git a/src/test/java/com/kafkamgt/uiapi/UtilMethods.java b/src/test/java/com/kafkamgt/uiapi/UtilMethods.java
index b9ebf5b..23c70c3 100644
--- a/src/test/java/com/kafkamgt/uiapi/UtilMethods.java
+++ b/src/test/java/com/kafkamgt/uiapi/UtilMethods.java
@@ -69,6 +69,17 @@ public List getUserInfoList(String username, String role){
return userInfoList;
}
+ public List getUserInfoListModel(String username, String role){
+ List userInfoList = new ArrayList<>();
+ UserInfoModel userInfo = new UserInfoModel();
+ userInfo.setTeam("Team1");
+ userInfo.setUsername(username);
+ userInfo.setRole(role);
+ userInfoList.add(userInfo);
+
+ return userInfoList;
+ }
+
public List getLogs(){
List activityLogs = new ArrayList<>();
ActivityLog activityLog = new ActivityLog();
@@ -103,6 +114,7 @@ public List getTopics() {
topicRequest.setTopicPK(topicPK);
topicRequest.setTeamname("Team1");
+ topicRequest.setEnvironment("DEV");
allTopicReqs.add(topicRequest);
return allTopicReqs;
}
diff --git a/src/test/java/com/kafkamgt/uiapi/controller/AclControllerTest.java b/src/test/java/com/kafkamgt/uiapi/controller/AclControllerTest.java
index 5546faf..bbbd857 100644
--- a/src/test/java/com/kafkamgt/uiapi/controller/AclControllerTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/controller/AclControllerTest.java
@@ -70,27 +70,7 @@ public void createAcl() throws Exception {
assertEquals("success", response);
}
- @Test
- public void updateSyncAcls() throws Exception {
- List syncUpdates = utilMethods.getSyncAclsUpdates();
-
- String jsonReq = new ObjectMapper().writer().writeValueAsString(syncUpdates);
- HashMap result = new HashMap<>();
- result.put("result","success");
- when(aclControllerService.updateSyncAcls(any())).thenReturn(result);
- String response = mvc.perform(MockMvcRequestBuilders
- .post("/updateSyncAcls")
- .content(jsonReq)
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- HashMap actualResult = new ObjectMapper().readValue(response, new TypeReference>(){});
-
- assertEquals("success", actualResult.get("result"));
- }
@Test
public void getAclRequests() throws Exception {
@@ -208,23 +188,5 @@ public void getAcls2() throws Exception {
.andReturn().getResponse().getContentAsString();
}
- @Test
- public void getSyncAcls() throws Exception {
- List aclInfo = utilMethods.getAclInfoList();
-
- when(aclControllerService.getSyncAcls(anyString(), anyString(), any()))
- .thenReturn(aclInfo);
- String res = mvc.perform(MockMvcRequestBuilders
- .get("/getSyncAcls")
- .param("env","DEV")
- .param("pageNo","1")
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- List response = new ObjectMapper().readValue(res, List.class);
- assertEquals(1, response.size());
- }
}
\ No newline at end of file
diff --git a/src/test/java/com/kafkamgt/uiapi/controller/TopicControllerTest.java b/src/test/java/com/kafkamgt/uiapi/controller/TopicControllerTest.java
index f1cc51e..e102a32 100644
--- a/src/test/java/com/kafkamgt/uiapi/controller/TopicControllerTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/controller/TopicControllerTest.java
@@ -68,26 +68,7 @@ public void createTopics() throws Exception {
assertEquals("success", response);
}
- @Test
- public void updateSyncTopics() throws Exception {
- List syncTopicUpdates = utilMethods.getSyncTopicUpdates();
- String jsonReq = new ObjectMapper().writer().writeValueAsString(syncTopicUpdates);
- HashMap resultMap = new HashMap<>();
- resultMap.put("result","success");
- when(topicControllerService.updateSyncTopics(any())).thenReturn(resultMap);
- String response = mvc.perform(MockMvcRequestBuilders
- .post("/updateSyncTopics")
- .content(jsonReq)
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- HashMap actualResult = new ObjectMapper().readValue(response, new TypeReference>(){});
-
- assertEquals("success", actualResult.get("result"));
- }
@Test
public void getTopicRequests() throws Exception {
@@ -223,23 +204,5 @@ public void getTopicsOnly() throws Exception {
assertEquals(2, response.size());
}
- @Test
- public void getSyncTopics() throws Exception {
- List topicRequests = utilMethods.getTopicRequests();
-
- when(topicControllerService.getSyncTopics(anyString(), anyString(), anyString())).thenReturn(topicRequests);
- String res = mvc.perform(MockMvcRequestBuilders
- .get("/getSyncTopics")
- .param("env","DEV")
- .param("pageNo","1")
- .param("topicnamesearch","testtopic")
- .contentType(MediaType.APPLICATION_JSON)
- .accept(MediaType.APPLICATION_JSON))
- .andExpect(status().isOk())
- .andReturn().getResponse().getContentAsString();
-
- List response = new ObjectMapper().readValue(res, List.class);
- assertEquals(1, response.size());
- }
}
\ No newline at end of file
diff --git a/src/test/java/com/kafkamgt/uiapi/controller/UiConfigControllerTest.java b/src/test/java/com/kafkamgt/uiapi/controller/UiConfigControllerTest.java
index e91d492..b05e110 100644
--- a/src/test/java/com/kafkamgt/uiapi/controller/UiConfigControllerTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/controller/UiConfigControllerTest.java
@@ -3,6 +3,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import com.kafkamgt.uiapi.UtilMethods;
import com.kafkamgt.uiapi.dao.*;
+import com.kafkamgt.uiapi.model.UserInfoModel;
import com.kafkamgt.uiapi.service.UiConfigControllerService;
import org.hamcrest.CoreMatchers;
import org.junit.Before;
@@ -325,7 +326,7 @@ public void changePwd() throws Exception {
@Test
public void showUsers() throws Exception {
- List userList = utilMethods.getUserInfoList("uiuser","ADMIN");
+ List userList = utilMethods.getUserInfoListModel("uiuser","ADMIN");
when(uiConfigControllerService.showUsers()).thenReturn(userList);
String res = mvc.perform(MockMvcRequestBuilders
diff --git a/src/test/java/com/kafkamgt/uiapi/controller/UiControllerLoginTest.java b/src/test/java/com/kafkamgt/uiapi/controller/UiControllerLoginTest.java
index 1722aa4..6213d86 100644
--- a/src/test/java/com/kafkamgt/uiapi/controller/UiControllerLoginTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/controller/UiControllerLoginTest.java
@@ -1,5 +1,8 @@
package com.kafkamgt.uiapi.controller;
+import com.kafkamgt.uiapi.config.ManageDatabase;
+import com.kafkamgt.uiapi.dao.UserInfo;
+import com.kafkamgt.uiapi.helpers.HandleDbRequests;
import com.kafkamgt.uiapi.service.UtilService;
import org.hamcrest.CoreMatchers;
import org.junit.Before;
@@ -38,6 +41,18 @@ public class UiControllerLoginTest {
private
UserDetails userDetails;
+ @Mock
+ private
+ HandleDbRequests handleDbRequests;
+
+ @Mock
+ private
+ ManageDatabase manageDatabase;
+
+ @Mock
+ private
+ UserInfo userInfo;
+
private MockMvc mvc;
@Before
@@ -47,6 +62,7 @@ public void setUp() throws Exception {
.standaloneSetup(uiControllerLogin)
.dispatchOptions(true)
.build();
+ ReflectionTestUtils.setField(uiControllerLogin, "manageDatabase", manageDatabase);
}
private void mvcPerformAndAssert(String uri, String fwdedUrl) throws Exception {
@@ -65,6 +81,8 @@ private void loginMock(){
SecurityContext securityContext = Mockito.mock(SecurityContext.class);
when(securityContext.getAuthentication()).thenReturn(authentication);
when(authentication.getPrincipal()).thenReturn(userDetails);
+ when(manageDatabase.getHandleDbRequests()).thenReturn(handleDbRequests);
+ when(handleDbRequests.getUsersInfo(userDetails.getUsername())).thenReturn(userInfo);
SecurityContextHolder.setContext(securityContext);
}
@@ -80,6 +98,8 @@ public void login2() throws Exception {
SecurityContext securityContext = Mockito.mock(SecurityContext.class);
when(securityContext.getAuthentication()).thenReturn(authentication);
when(authentication.getPrincipal()).thenReturn(userDetails);
+ when(manageDatabase.getHandleDbRequests()).thenReturn(handleDbRequests);
+ when(handleDbRequests.getUsersInfo(userDetails.getUsername())).thenReturn(userInfo);
SecurityContextHolder.setContext(securityContext);
mvcPerformAndAssert("/login", "index");
diff --git a/src/test/java/com/kafkamgt/uiapi/helpers/db/rdbms/DeleteDataJdbcTest.java b/src/test/java/com/kafkamgt/uiapi/helpers/db/rdbms/DeleteDataJdbcTest.java
index c713eb0..f7facee 100644
--- a/src/test/java/com/kafkamgt/uiapi/helpers/db/rdbms/DeleteDataJdbcTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/helpers/db/rdbms/DeleteDataJdbcTest.java
@@ -90,7 +90,7 @@ public void deleteTeamRequest() {
@Test
public void deletePrevAclRecs() {
List acls = utilMethods.getAclsForDelete();
- when(aclRepo.findAll()).thenReturn(utilMethods.getAllAcls());
+ //when(aclRepo.findAll()).thenReturn(utilMethods.getAllAcls());
String result = deleteDataJdbc.deletePrevAclRecs(acls);
assertEquals("success", result);
diff --git a/src/test/java/com/kafkamgt/uiapi/helpers/db/rdbms/UpdateDataJdbcTest.java b/src/test/java/com/kafkamgt/uiapi/helpers/db/rdbms/UpdateDataJdbcTest.java
index a09b8da..881f28c 100644
--- a/src/test/java/com/kafkamgt/uiapi/helpers/db/rdbms/UpdateDataJdbcTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/helpers/db/rdbms/UpdateDataJdbcTest.java
@@ -4,6 +4,7 @@
import com.kafkamgt.uiapi.dao.AclRequests;
import com.kafkamgt.uiapi.dao.SchemaRequest;
import com.kafkamgt.uiapi.dao.TopicRequest;
+import com.kafkamgt.uiapi.dao.UserInfo;
import com.kafkamgt.uiapi.repository.AclRequestsRepo;
import com.kafkamgt.uiapi.repository.SchemaRequestRepo;
import com.kafkamgt.uiapi.repository.TopicRequestsRepo;
@@ -15,6 +16,8 @@
import org.mockito.junit.MockitoJUnitRunner;
import org.springframework.test.util.ReflectionTestUtils;
+import java.util.Optional;
+
import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
import static org.mockito.ArgumentMatchers.eq;
@@ -45,6 +48,9 @@ public class UpdateDataJdbcTest {
private UtilMethods utilMethods;
+ @Mock
+ UserInfo userInfo;
+
@Before
public void setUp() throws Exception {
updateData = new UpdateDataJdbc(topicRequestsRepo, aclRequestsRepo,
@@ -98,7 +104,9 @@ public void declineAclRequest() {
@Test
public void updatePassword() {
- String result = updateData.updatePassword("uiuser1", "pwd");
+ String user = "uiuser1";
+ when(userInfoRepo.findById(user)).thenReturn(Optional.of(userInfo));
+ String result = updateData.updatePassword(user, "pwd");
assertEquals("success", result);
}
diff --git a/src/test/java/com/kafkamgt/uiapi/service/AclControllerServiceTest.java b/src/test/java/com/kafkamgt/uiapi/service/AclControllerServiceTest.java
index bfb0733..0ab9ffa 100644
--- a/src/test/java/com/kafkamgt/uiapi/service/AclControllerServiceTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/service/AclControllerServiceTest.java
@@ -2,10 +2,7 @@
import com.kafkamgt.uiapi.UtilMethods;
import com.kafkamgt.uiapi.config.ManageDatabase;
-import com.kafkamgt.uiapi.dao.Acl;
-import com.kafkamgt.uiapi.dao.AclRequests;
-import com.kafkamgt.uiapi.dao.Env;
-import com.kafkamgt.uiapi.dao.Team;
+import com.kafkamgt.uiapi.dao.*;
import com.kafkamgt.uiapi.error.KafkawizeException;
import com.kafkamgt.uiapi.helpers.HandleDbRequests;
import com.kafkamgt.uiapi.model.AclInfo;
@@ -15,7 +12,6 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
@@ -31,9 +27,7 @@
import java.util.*;
import static org.junit.Assert.*;
-import static org.mockito.ArgumentMatchers.any;
-import static org.mockito.ArgumentMatchers.anyList;
-import static org.mockito.ArgumentMatchers.anyString;
+import static org.mockito.ArgumentMatchers.*;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
@@ -73,6 +67,7 @@ public void setUp() throws Exception {
env.setHost("101.10.11.11");
env.setPort("9092");
env.setName("DEV");
+ env.setProtocol("PLAINTEXT");
ReflectionTestUtils.setField(aclControllerService, "manageDatabase", manageDatabase);
when(manageDatabase.getHandleDbRequests()).thenReturn(handleDbRequests);
loginMock();
@@ -93,55 +88,16 @@ private void loginMock(){
@Test
public void createAcl() {
AclRequests aclRequests = getAclRequest();
+ List topicList = utilMethods.getTopics();
+
+ when(handleDbRequests.getTopics(any())).thenReturn(topicList);
when(handleDbRequests.requestForAcl(aclRequests)).thenReturn("success");
String result = aclControllerService.createAcl(aclRequests);
assertEquals("{\"result\":\"success\"}",result);
}
- @Test
- public void updateSyncAcls() {
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(true);
- when(handleDbRequests.addToSyncacls(anyList())).thenReturn("success");
-
- HashMap result = aclControllerService.updateSyncAcls(utilMethods.getSyncAclsUpdates());
- assertEquals("success",result.get("result"));
- }
-
- @Test
- public void updateSyncAclsFailure1() {
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(false);
-
- HashMap result = aclControllerService.updateSyncAcls(utilMethods.getSyncAclsUpdates());
- assertEquals("Not Authorized.",result.get("result"));
- }
-
- @Test
- public void updateSyncAclsFailure2() {
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(true);
- when(handleDbRequests.addToSyncacls(anyList())).thenThrow(new RuntimeException("Error"));
- HashMap result = aclControllerService.updateSyncAcls(utilMethods.getSyncAclsUpdates());
- assertThat(result.get("result"), CoreMatchers.containsString("Failure"));
- }
-
- @Test
- public void updateSyncAclsFailure3() {
- List updates = new ArrayList<>();
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(true);
-
- HashMap result = aclControllerService.updateSyncAcls(updates);
- assertEquals("No record updated.",result.get("result"));
- }
-
- @Test
- public void updateSyncAclsFailure4() {
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(true);
- when(handleDbRequests.addToSyncacls(anyList())).thenThrow(new RuntimeException("Error"));
-
- HashMap result = aclControllerService.updateSyncAcls(utilMethods.getSyncAclsUpdates());
- assertThat(result.get("result"), CoreMatchers.containsString("Failure"));
- }
@Test
public void getAclRequests() {
@@ -294,47 +250,7 @@ public void getAclsSyncFalse2() throws KafkawizeException {
assertEquals("2.1.2.1", aclList.get(0).getAcl_ip());
}
- @Test
- public void getAclsSyncTrue1() throws KafkawizeException {
- String envSelected = "DEV", pageNo = "1", topicNameSearch = "testtopic1";
- boolean isSyncAcls = true;
-
- when(userDetails.getUsername()).thenReturn("uiuser1");
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(true);
- when(handleDbRequests.selectEnvDetails(envSelected)).thenReturn(this.env);
- when(clusterApiService.getAcls(any()))
- .thenReturn(utilMethods.getClusterAcls());
- when(handleDbRequests.selectAllTeamsOfUsers(any())).thenReturn(getAvailableTeams());
- when(handleDbRequests.getSyncAcls(envSelected)).thenReturn(getAclsSOT0());
-
- List aclList = aclControllerService.getSyncAcls(envSelected, pageNo, topicNameSearch);
-
- assertEquals(1, aclList.size());
- assertEquals("testtopic1",aclList.get(0).getTopicname());
- assertEquals("mygrp1",aclList.get(0).getConsumergroup());
- assertEquals("2.1.2.1", aclList.get(0).getAcl_ip());
- }
- @Test
- public void getAclsSyncTrue2() throws KafkawizeException {
- String envSelected = "DEV", pageNo = "1", topicNameSearch = "test";
- boolean isSyncAcls = true;
-
- when(userDetails.getUsername()).thenReturn("uiuser1");
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(true);
- when(handleDbRequests.selectEnvDetails(envSelected)).thenReturn(this.env);
- when(clusterApiService.getAcls(any()))
- .thenReturn(utilMethods.getClusterAcls());
- when(handleDbRequests.selectAllTeamsOfUsers(any())).thenReturn(getAvailableTeams());
- when(handleDbRequests.getSyncAcls(envSelected)).thenReturn(getAclsSOT0());
-
- List aclList = aclControllerService.getSyncAcls(envSelected, pageNo, topicNameSearch);
-
- assertEquals(1, aclList.size());
- assertEquals("testtopic1",aclList.get(0).getTopicname());
- assertEquals("mygrp1",aclList.get(0).getConsumergroup());
- assertEquals("2.1.2.1", aclList.get(0).getAcl_ip());
- }
private List getAvailableTeams(){
@@ -397,6 +313,7 @@ private AclRequests getAclRequest(){
aclReq.setTopictype("producer");
aclReq.setRequestingteam("Team1");
aclReq.setReq_no("112");
+ aclReq.setEnvironment("DEV");
return aclReq;
}
diff --git a/src/test/java/com/kafkamgt/uiapi/service/ClusterApiServiceTest.java b/src/test/java/com/kafkamgt/uiapi/service/ClusterApiServiceTest.java
index ed60d98..637d4dc 100644
--- a/src/test/java/com/kafkamgt/uiapi/service/ClusterApiServiceTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/service/ClusterApiServiceTest.java
@@ -12,7 +12,6 @@
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
@@ -83,7 +82,7 @@ public void getStatusSuccess() {
result = clusterApiService.getSchemaClusterStatus("");
assertEquals("success",result);
- result = clusterApiService.getKafkaClusterStatus("");
+ result = clusterApiService.getKafkaClusterStatus("", "PLAINTEXT");
assertEquals("success",result);
}
@@ -103,7 +102,7 @@ public void getStatusFailure() {
result = clusterApiService.getSchemaClusterStatus("");
assertEquals("OFFLINE",result);
- result = clusterApiService.getKafkaClusterStatus("");
+ result = clusterApiService.getKafkaClusterStatus("", "PLAINTEXT");
assertEquals("NOT_KNOWN",result);
}
@@ -119,7 +118,7 @@ public void getAclsSuccess() throws KafkawizeException {
eq(Set.class)))
.thenReturn(response);
- List> result = clusterApiService.getAcls("");
+ List> result = clusterApiService.getAcls("", "PLAINTEXT");
assertEquals(result, new ArrayList<>(aclListOriginal));
}
@@ -132,7 +131,7 @@ public void getAclsFailure() throws KafkawizeException {
eq(Set.class)))
.thenThrow(new RuntimeException("error"));
- clusterApiService.getAcls("");
+ clusterApiService.getAcls("", "PLAINTEXT");
}
@Test
@@ -146,7 +145,7 @@ public void getAllTopicsSuccess() throws Exception {
eq(Set.class)))
.thenReturn(response);
- List> result = clusterApiService.getAllTopics("");
+ List> result = clusterApiService.getAllTopics("", "PLAINTEXT");
assertEquals(result, new ArrayList<>(topicsList));
}
@@ -159,7 +158,7 @@ public void getAllTopicsFailure() throws Exception {
eq(Set.class)))
.thenThrow(new RuntimeException("error"));
- clusterApiService.getAllTopics("");
+ clusterApiService.getAllTopics("", "PLAINTEXT");
}
@Test
diff --git a/src/test/java/com/kafkamgt/uiapi/service/TopicControllerServiceTest.java b/src/test/java/com/kafkamgt/uiapi/service/TopicControllerServiceTest.java
index fe55a70..88c92d7 100644
--- a/src/test/java/com/kafkamgt/uiapi/service/TopicControllerServiceTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/service/TopicControllerServiceTest.java
@@ -70,6 +70,7 @@ public void setUp() throws Exception {
this.env = new Env();
env.setHost("101.10.11.11");
env.setPort("9092");
+ env.setProtocol("PLAINTEXT");
env.setName("DEV");
ReflectionTestUtils.setField(topicControllerService, "manageDatabase", manageDatabase);
ReflectionTestUtils.setField(topicControllerService, "syncCluster", "DEV");
@@ -159,39 +160,7 @@ public void createTopicsFailure3() throws KafkawizeException {
assertEquals("{\"result\":\"failure\"}",result);
}
- @Test
- public void updateSyncTopicsSuccess() {
- String teamSelected = "Team1";
- HashMap resultMap = new HashMap<>();
- resultMap.put("result","success");
-
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(true);
- when(handleDbRequests.addToSynctopics(any())).thenReturn("success");
-
- HashMap result = topicControllerService.updateSyncTopics(utilMethods.getSyncTopicUpdates());
-
- assertEquals("success",result.get("result"));
- }
-
- @Test
- public void updateSyncTopicsNoUpdate() {
- List topicUpdates = new ArrayList<>();
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(true);
-
- HashMap result = topicControllerService.updateSyncTopics(topicUpdates);
-
- assertEquals("No record updated.",result.get("result"));
- }
-
- @Test
- public void updateSyncTopicsNotAuthorized() {
- String teamSelected = "Team1";
- when(utilService.checkAuthorizedSU(userDetails)).thenReturn(false);
- HashMap result = topicControllerService.updateSyncTopics(utilMethods.getSyncTopicUpdates());
-
- assertEquals("Not Authorized.",result.get("result"));
- }
@Test
public void getCreatedTopicRequests1() {
@@ -314,18 +283,7 @@ public void getTopicsSearchFailure() throws Exception {
assertNull(topicsList);
}
- @Test
- public void getSyncTopics() throws Exception {
- String envSel = "DEV", pageNo = "1", topicNameSearch = "top";
- when(handleDbRequests.selectEnvDetails(envSel)).thenReturn(this.env);
- when(clusterApiService.getAllTopics(this.env.getHost()+":"+this.env.getPort()))
- .thenReturn(utilMethods.getClusterApiTopics("topic",10));
- when(handleDbRequests.selectAllTeamsOfUsers(any())).thenReturn(getAvailableTeams());
-
- List topicRequests = topicControllerService.getSyncTopics(envSel, pageNo, topicNameSearch);
- assertEquals(topicRequests.size(),10);
- }
@Test
public void declineTopicRequests() throws KafkawizeException {
diff --git a/src/test/java/com/kafkamgt/uiapi/service/UiConfigControllerServiceTest.java b/src/test/java/com/kafkamgt/uiapi/service/UiConfigControllerServiceTest.java
index 5ec08a6..e804408 100644
--- a/src/test/java/com/kafkamgt/uiapi/service/UiConfigControllerServiceTest.java
+++ b/src/test/java/com/kafkamgt/uiapi/service/UiConfigControllerServiceTest.java
@@ -7,12 +7,12 @@
import com.kafkamgt.uiapi.dao.UserInfo;
import com.kafkamgt.uiapi.error.KafkawizeException;
import com.kafkamgt.uiapi.helpers.HandleDbRequests;
+import com.kafkamgt.uiapi.model.UserInfoModel;
import org.hamcrest.CoreMatchers;
import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
-import org.mockito.InjectMocks;
import org.mockito.Mock;
import org.mockito.Mockito;
import org.mockito.junit.MockitoJUnitRunner;
@@ -20,7 +20,6 @@
import org.springframework.security.core.context.SecurityContext;
import org.springframework.security.core.context.SecurityContextHolder;
import org.springframework.security.core.userdetails.UserDetails;
-import org.springframework.security.crypto.password.PasswordEncoder;
import org.springframework.security.provisioning.InMemoryUserDetailsManager;
import org.springframework.test.util.ReflectionTestUtils;
@@ -30,6 +29,7 @@
import static org.junit.Assert.*;
import static org.mockito.ArgumentMatchers.any;
+import static org.mockito.ArgumentMatchers.eq;
import static org.mockito.Mockito.when;
@RunWith(MockitoJUnitRunner.class)
@@ -117,30 +117,30 @@ public void getEnvs1() {
when(handleDbRequests.selectAllKafkaEnvs()).thenReturn(getAllEnvs());
List envsList = uiConfigControllerService.getEnvs(true);
- assertEquals(3, envsList.size());
+ assertEquals(2, envsList.size());
assertEquals(null, envsList.get(0).getEnvStatus());
}
@Test
public void getEnvs2() throws KafkawizeException {
when(handleDbRequests.selectAllKafkaEnvs()).thenReturn(getAllEnvs());
- when(clusterApiService.getKafkaClusterStatus(any())).thenReturn("ONLINE");
+ when(clusterApiService.getKafkaClusterStatus(any(), eq("PLAINTEXT"))).thenReturn("ONLINE");
List envsList = uiConfigControllerService.getEnvs(false);
- assertEquals(3, envsList.size());
+ assertEquals(2, envsList.size());
assertEquals("ONLINE", envsList.get(0).getEnvStatus());
- assertEquals("NOT_KNOWN", envsList.get(2).getEnvStatus());
+ assertEquals("ONLINE", envsList.get(1).getEnvStatus());
}
@Test
public void getEnvs3() throws KafkawizeException {
when(handleDbRequests.selectAllKafkaEnvs()).thenReturn(getAllEnvs());
- when(clusterApiService.getKafkaClusterStatus(any())).thenReturn("OFFLINE");
+ when(clusterApiService.getKafkaClusterStatus(any(), eq("PLAINTEXT"))).thenReturn("OFFLINE");
List envsList = uiConfigControllerService.getEnvs(false);
- assertEquals(3, envsList.size());
+ assertEquals(2, envsList.size());
assertEquals("OFFLINE", envsList.get(0).getEnvStatus());
- assertEquals("NOT_KNOWN", envsList.get(2).getEnvStatus());
+ assertEquals("OFFLINE", envsList.get(1).getEnvStatus());
}
@Test
@@ -148,7 +148,7 @@ public void getSchemaRegEnvs() {
when(handleDbRequests.selectAllSchemaRegEnvs()).thenReturn(getAllSchemaEnvs());
List envsList = uiConfigControllerService.getSchemaRegEnvs();
- assertEquals(2, envsList.size());
+ assertEquals(1, envsList.size());
assertEquals(null, envsList.get(0).getEnvStatus());
}
@@ -158,7 +158,7 @@ public void getSchemaRegEnvsStatus1() {
when(clusterApiService.getSchemaClusterStatus(any())).thenReturn("ONLINE");
List envsList = uiConfigControllerService.getSchemaRegEnvsStatus();
- assertEquals(2, envsList.size());
+ assertEquals(1, envsList.size());
assertEquals("ONLINE", envsList.get(0).getEnvStatus());
}
@@ -168,8 +168,8 @@ public void getSchemaRegEnvsStatus2() {
when(clusterApiService.getSchemaClusterStatus(any())).thenReturn("OFFLINE");
List envsList = uiConfigControllerService.getSchemaRegEnvsStatus();
- assertEquals(2, envsList.size());
- assertEquals("NOT_KNOWN", envsList.get(1).getEnvStatus());
+ assertEquals(1, envsList.size());
+ assertEquals("OFFLINE", envsList.get(0).getEnvStatus());
}
@Test
@@ -404,7 +404,8 @@ public void addNewTeam3() {
public void changePwd1() {
String pwdUpdate = "{\"pwd\":\"newpasswd\",\"repeatpwd\":\"newpasswd\"}";
- when(handleDbRequests.updatePassword(this.userDetails.getUsername(), "newpasswd")).thenReturn("success");
+ when(userDetails.getUsername()).thenReturn("uiuser1");
+ when(handleDbRequests.updatePassword(eq("uiuser1"), any())).thenReturn("success");
String result = uiConfigControllerService.changePwd(pwdUpdate);
@@ -415,7 +416,9 @@ public void changePwd1() {
public void changePwd2() {
String pwdUpdate = "{\"pwd\":\"newpasswd\",\"repeatpwd\":\"newpasswd\"}";
- when(handleDbRequests.updatePassword(this.userDetails.getUsername(), "newpasswd")).thenThrow(new RuntimeException("Error"));
+ when(userDetails.getUsername()).thenReturn("uiuser1");
+ when(handleDbRequests.updatePassword(eq("uiuser1"), any())).
+ thenThrow(new RuntimeException("Error"));
String result = uiConfigControllerService.changePwd(pwdUpdate);
@@ -425,7 +428,7 @@ public void changePwd2() {
@Test
public void showUsers() {
when(handleDbRequests.selectAllUsersInfo()).thenReturn(getUsernfoList());
- List userInfoList = uiConfigControllerService.showUsers();
+ List userInfoList = uiConfigControllerService.showUsers();
assertEquals(1,userInfoList.size());
}
@@ -533,14 +536,7 @@ private List getAllSchemaEnvs(){
env.setHost("localhost");
env.setPort("8081");
env.setName("DEV");
- env.setProtocol("plain");
- listEnvs.add(env);
-
- env = new Env();
- env.setHost("localhost");
- env.setPort("8081");
- env.setName("TST");
- env.setProtocol("ssl");
+ env.setProtocol("PLAINTEXT");
listEnvs.add(env);
return listEnvs;
@@ -553,21 +549,14 @@ private List getAllEnvs(){
env.setHost("localhost");
env.setPort("9092");
env.setName("DEV");
- env.setProtocol("plain");
+ env.setProtocol("PLAINTEXT");
listEnvs.add(env);
env = new Env();
env.setHost("10.22.34.121");
env.setPort("9092");
env.setName("TST");
- env.setProtocol("plain");
- listEnvs.add(env);
-
- env = new Env();
- env.setHost("10.23.34.121");
- env.setPort("9093");
- env.setName("ACC");
- env.setProtocol("ssl");
+ env.setProtocol("PLAINTEXT");
listEnvs.add(env);
return listEnvs;
diff --git a/src/test/resources/scripts/base/cassandra/insertdata.sql b/src/test/resources/scripts/base/cassandra/insertdata.sql
index b8dde6e..e58c20a 100644
--- a/src/test/resources/scripts/base/cassandra/insertdata.sql
+++ b/src/test/resources/scripts/base/cassandra/insertdata.sql
@@ -1,18 +1,18 @@
-/* Insert Users */
+/* Insert Users, pwd - base64 encoded */
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User1','Team1','uiuser1','USER','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User1','Team1','uiuser1','USER','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User2','Team2','uiuser2','USER','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User2','Team2','uiuser2','USER','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User3','Team3','uiuser3','USER','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User3','Team3','uiuser3','USER','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User4','Team1','uiuser4','ADMIN','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User4','Team1','uiuser4','ADMIN','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User5','Team2','uiuser5','ADMIN','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User5','Team2','uiuser5','ADMIN','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User6','Team3','uiuser6','ADMIN','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('User6','Team3','uiuser6','ADMIN','dXNlcg==');
-Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('SuperUser','Team2','superuser','SUPERUSER','user');
+Insert into kafkamanagementapi.users(fullname,team,userid,roleid,pwd) values('SuperUser','Team2','superuser','SUPERUSER','dXNlcg==');
/* Insert Teams */
@@ -36,4 +36,4 @@ Insert into kafkamanagementapi.env(name,host,port,protocol,type) values ('DEV_SC
/* Insert product and version */
-Insert into kafkamanagementapi.productdetails(name,version,licensekey) values ('KafkaWize','4.3','');
+Insert into kafkamanagementapi.productdetails(name,version,licensekey) values ('KafkaWize','4.4','');
diff --git a/src/test/resources/scripts/base/rdbms/insertdata.sql b/src/test/resources/scripts/base/rdbms/insertdata.sql
index 67ab6e8..ecce485 100644
--- a/src/test/resources/scripts/base/rdbms/insertdata.sql
+++ b/src/test/resources/scripts/base/rdbms/insertdata.sql
@@ -1,18 +1,18 @@
-/* Insert Users */
+/* Insert Users , pwd: base64 encoded*/
-Insert into users(fullname,team,userid,roleid,pwd) values('User1','Team1','uiuser1','USER','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User1','Team1','uiuser1','USER','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User2','Team2','uiuser2','USER','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User2','Team2','uiuser2','USER','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User3','Team3','uiuser3','USER','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User3','Team3','uiuser3','USER','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User4','Team1','uiuser4','ADMIN','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User4','Team1','uiuser4','ADMIN','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User5','Team2','uiuser5','ADMIN','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User5','Team2','uiuser5','ADMIN','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('User6','Team3','uiuser6','ADMIN','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('User6','Team3','uiuser6','ADMIN','dXNlcg==');
-Insert into users(fullname,team,userid,roleid,pwd) values('SuperUser','Team2','superuser','SUPERUSER','user');
+Insert into users(fullname,team,userid,roleid,pwd) values('SuperUser','Team2','superuser','SUPERUSER','dXNlcg==');
/* Insert Teams */
@@ -36,6 +36,6 @@ Insert into env(name,host,port,protocol,type) values ('DEV_SCH','localhost','808
/* Insert product and version */
-Insert into productdetails(name,version) values ('KafkaWize','4.3');
+Insert into productdetails(name,version) values ('KafkaWize','4.4');
commit;
\ No newline at end of file
diff --git a/src/test/resources/test-application-cassandra.properties b/src/test/resources/test-application-cassandra.properties
index 2db9840..56dd5bc 100644
--- a/src/test/resources/test-application-cassandra.properties
+++ b/src/test/resources/test-application-cassandra.properties
@@ -2,35 +2,45 @@ server.port:9097
server.servlet.context-path=/kafkawize
-# custom.db.storetype should be "cassandra" or "rdbms"
-custom.db.storetype=cassandra
+server.ssl.key-store=C:/Software/confluent-oss-4.1.1-2.11/dev/etc/certs/new/server.keystore.jks
+server.ssl.trust-store=C:/Software/confluent-oss-4.1.1-2.11/dev/etc/certs/new/server.truststore.jks
+server.ssl.key-store-password=kafkawize
+server.ssl.key-password=kafkawize
+server.ssl.trust-store-password=kafkawize
+server.ssl.key-store-type=JKS
-# cluster api properties
-custom.clusterapi.url:http://localhost:9343
-custom.clusterapi.username:user1
-custom.clusterapi.password:pwd
+# kafkawize.db.storetype should be "cassandra" or "rdbms"
+kafkawize.db.storetype=cassandra
-custom.api.username:uiuser4
-custom.api.password:user
+# cluster api properties
+kafkawize.clusterapi.url:http://localhost:9343
+kafkawize.clusterapi.username:user1
+kafkawize.clusterapi.password:pwd
-# db store cassandra properties, to be filled in if custom.db.storetype is cassandra
-custom.cassandradb.keyspace:kafkamanagementapi
-custom.cassandradb.url:localhost
-custom.cassandradb.port:9142
+# db store cassandra properties, to be filled in if kafkawize.db.storetype is cassandra
+kafkawize.cassandradb.keyspace:kafkamanagementapi
+kafkawize.cassandradb.url:localhost
+kafkawize.cassandradb.port:9142
-# db scripts execution auto or manual. If set to manual, user has to execute the scripts from resources dir manually
-custom.dbscripts.execution=auto
-custom.dbscripts.dropall_recreate=false
+# db scripts execution 'auto' or 'manual'. If set to manual, user has to execute the scripts from resources dir manually
+kafkawize.dbscripts.execution=auto
+# drop all tables and recreate. Be careful with this property.
+kafkawize.dbscripts.dropall_recreate=true
# default cluster to synchronize data
-custom.syncdata.cluster=DEV
+kafkawize.syncdata.cluster=DEV
+
+# order of envs
+kafkawize.envs.order=DEV,TST,ACC,PRD
-custom.envs.order=DEV,TST,ACC,PRD
-custom.request.topics.envs=DEV,TST,ACC,PRD
+#request topics in below envs. Promote topics will be in higher envs
+kafkawize.request.topics.envs=DEV,TST
# licensing info
-custom.license.key=
-custom.org.name=
+kafkawize.license.key=Ee1T4E+EjHfGPlrSSgHc2A==:oiyf5yu0B7yiSkwo1zqDF4o7IC2GfeC56exeNtTrJwiUX2/SgFYuLoq5yUbeNbuU6Sn8ot6vC1qPlNtG3uuB8rOOgH1A4WrYEtPtWm+OKlnt/V+GhmJF3RD4+5sq32PqVFhsUGNtZGhibWw2WVhScGIyNHRTMkZtYTJGM2FYcGxUR2xqWlc1elpVVjRjR2x5ZVVSaGRHRTZNakF5TVMwd01pMHdNUT5ee
+kafkawize.org.name=MyOrganization
+kafkawize.version=4.4
+kafkawize.invalidkey.msg=Invalid License !! Please request from https://kafkawize.com for a license key.
# Spring JPA properties
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
@@ -47,3 +57,4 @@ spring.jpa.generate-ddl=true
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
+#logging.level.root=debug
\ No newline at end of file
diff --git a/src/test/resources/test-application-rdbms.properties b/src/test/resources/test-application-rdbms.properties
index 0a19795..c609335 100644
--- a/src/test/resources/test-application-rdbms.properties
+++ b/src/test/resources/test-application-rdbms.properties
@@ -2,31 +2,45 @@ server.port:9097
server.servlet.context-path=/kafkawize
-# custom.db.storetype should be "cassandra" or "rdbms"
-custom.db.storetype=rdbms
+server.ssl.key-store=C:/Software/confluent-oss-4.1.1-2.11/dev/etc/certs/new/server.keystore.jks
+server.ssl.trust-store=C:/Software/confluent-oss-4.1.1-2.11/dev/etc/certs/new/server.truststore.jks
+server.ssl.key-store-password=kafkawize
+server.ssl.key-password=kafkawize
+server.ssl.trust-store-password=kafkawize
+server.ssl.key-store-type=JKS
+
+# kafkawize.db.storetype should be "cassandra" or "rdbms"
+kafkawize.db.storetype=rdbms
# cluster api properties
-custom.clusterapi.url:http://localhost:9343
-custom.clusterapi.username:user1
-custom.clusterapi.password:pwd
+kafkawize.clusterapi.url:http://localhost:9343
+kafkawize.clusterapi.username:user1
+kafkawize.clusterapi.password:pwd
-# db store cassandra properties, to be filled in if custom.db.storetype is cassandra
-custom.cassandradb.keyspace:kafkamanagementapi
-custom.cassandradb.url:localhost
-custom.cassandradb.port:9142
+# db store cassandra properties, to be filled in if kafkawize.db.storetype is cassandra
+kafkawize.cassandradb.keyspace:kafkamanagementapi
+kafkawize.cassandradb.url:localhost
+kafkawize.cassandradb.port:9042
-# db scripts execution auto or manual. If set to manual, user has to execute the scripts from resources dir manually
-custom.dbscripts.execution=auto
-custom.dbscripts.dropall_recreate=false
+# db scripts execution 'auto' or 'manual'. If set to manual, user has to execute the scripts from resources dir manually
+kafkawize.dbscripts.execution=auto
+# drop all tables and recreate. Be careful with this property.
+kafkawize.dbscripts.dropall_recreate=true
# default cluster to synchronize data
-custom.syncdata.cluster=DEV
-custom.envs.order=DEV,TST,ACC,PRD
-custom.request.topics.envs=DEV,TST,ACC,PRD
+kafkawize.syncdata.cluster=DEV
+
+# order of envs
+kafkawize.envs.order=DEV,TST,ACC,PRD
+
+#request topics in below envs. Promote topics will be in higher envs
+kafkawize.request.topics.envs=DEV,TST
# licensing info
-custom.license.key=
-custom.org.name=
+kafkawize.license.key=Ee1T4E+EjHfGPlrSSgHc2A==:oiyf5yu0B7yiSkwo1zqDF4o7IC2GfeC56exeNtTrJwiUX2/SgFYuLoq5yUbeNbuU6Sn8ot6vC1qPlNtG3uuB8rOOgH1A4WrYEtPtWm+OKlnt/V+GhmJF3RD4+5sq32PqVFhsUGNtZGhibWw2WVhScGIyNHRTMkZtYTJGM2FYcGxUR2xqWlc1elpVVjRjR2x5ZVVSaGRHRTZNakF5TVMwd01pMHdNUT5ee
+kafkawize.org.name=MyOrganization
+kafkawize.version=4.4
+kafkawize.invalidkey.msg=Invalid License !! Please request from https://kafkawize.com for a license key.
# Spring JPA properties
spring.datasource.url=jdbc:h2:mem:testdb;DB_CLOSE_DELAY=-1
@@ -43,3 +57,4 @@ spring.jpa.generate-ddl=true
spring.jpa.show-sql=true
spring.jpa.hibernate.ddl-auto=create
+#logging.level.root=debug