ranger-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mad...@apache.org
Subject [2/2] git commit: ARGUS-146: removed unused/referenced files
Date Fri, 31 Oct 2014 23:04:15 GMT
ARGUS-146: removed unused/referenced files

Project: http://git-wip-us.apache.org/repos/asf/incubator-argus/repo
Commit: http://git-wip-us.apache.org/repos/asf/incubator-argus/commit/5e483675
Tree: http://git-wip-us.apache.org/repos/asf/incubator-argus/tree/5e483675
Diff: http://git-wip-us.apache.org/repos/asf/incubator-argus/diff/5e483675

Branch: refs/heads/master
Commit: 5e48367506feeb330722711eda907b01bd92cab9
Parents: a28f5f6
Author: Madhan Neethiraj <madhan@apache.org>
Authored: Fri Oct 31 15:02:46 2014 -0700
Committer: Madhan Neethiraj <madhan@apache.org>
Committed: Fri Oct 31 15:02:46 2014 -0700

----------------------------------------------------------------------
 security-admin/db/create_repo_hbase.sql |   87 -
 security-admin/db/create_repo_hdfs.sql  |   79 -
 security-admin/db/create_repo_hive.sql  |   90 -
 security-admin/db/create_repo_knox.sql  |  260 --
 security-admin/db/xa_demo_db.sql        | 4329 --------------------------
 5 files changed, 4845 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/5e483675/security-admin/db/create_repo_hbase.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/create_repo_hbase.sql b/security-admin/db/create_repo_hbase.sql
deleted file mode 100644
index f2f047d..0000000
--- a/security-admin/db/create_repo_hbase.sql
+++ /dev/null
@@ -1,87 +0,0 @@
--- Licensed to the Apache Software Foundation (ASF) under one or more
--- contributor license agreements.  See the NOTICE file distributed with
--- this work for additional information regarding copyright ownership.
--- The ASF licenses this file to You under the Apache License, Version 2.0
--- (the "License"); you may not use this file except in compliance with
--- the License.  You may obtain a copy of the License at
---
---     http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-
-# Replace the following:
-#  %REPOSITORY_NAME%
-#  %REPOSITORY_DESC%
-#  %USERNAME%
-#  %PASSWORD%
-#  %FS_DEFAULT_NAME%
-#  %HADOOP_SECURITY_AUTHORIZATION%
-#  %HADOOP_SECURITY_AUTHENTICATION%
-#  %HADOOP_SECURITY_AUTH_TO_LOCAL%
-#  %DFS_DATANODE_KERBEROS_PRINCIPAL%
-#  %DFS_NAMENODE_KERBEROS_PRINCIPAL%
-#  %DFS_SECONDARY_NAMENODE_KERBEROS_PRINCIPAL%
-#  %HBASE_MASTER_KERBEROS_PRINCIPAL%
-#  %HBASE_RPC_ENGINE%
-#  %HBASE_RPC_PROTECTION%
-#  %HBASE_SECURITY_AUTHENTICATION%
-#  %HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT%
-#  %HBASE_ZOOKEEPER_QUORUM%
-#  %ZOOKEEPER_ZNODE_PARENT%
-#  %COMMON_NAME_FOR_CERTIFICATE%
-#
-# Example:
-#  INSERT INTO x_asset (asset_name, descr, act_status, asset_type, config, create_time, update_time,
added_by_id, upd_by_id)
-#   VALUES ('hbasetest', 'hbase test repository', 1, 2, '{\"username\":\"policymgr\",\"password\":\"policymgr\",\"fs.default.name\":\"hdfs://sandbox.hortonworks.com:8020\",\"hadoop.security.authorization\":\"true\",\"hadoop.security.authentication\":\"simple\",\"hadoop.security.auth_to_local\":\"\",\"dfs.datanode.kerberos.principal\":\"\",\"dfs.namenode.kerberos.principal\":\"\",\"dfs.secondary.namenode.kerberos.principal\":\"\",\"hbase.master.kerberos.principal\":\"\",\"hbase.rpc.engine\":\"org.apache.hadoop.hbase.ipc.SecureRpcEngine%\",\"hbase.rpc.protection\":\"PRIVACY\",\"hbase.security.authentication\":\"simple\",\"hbase.zookeeper.property.clientPort\":\"2181\",\"hbase.zookeeper.quorum\":\"sandbox.hortonworks.com\",\"zookeeper.znode.parent\":\"/hbase-unsecure\",\"commonNameForCertificate\":\"\"}',
now(), now(), 1, 1);
-#
-
-# create the repository
-INSERT INTO x_asset (asset_name, descr, act_status, asset_type, config, create_time, update_time,
added_by_id, upd_by_id)
- VALUES ('%REPOSITORY_NAME%', '%REPOSITORY_DESC%', 1, 2, '{\"username\":\"%USERNAME%\",\"password\":\"%PASSWORD%\",\"fs.default.name\":\"%FS_DEFAULT_NAME%\",\"hadoop.security.authorization\":\"%HADOOP_SECURITY_AUTHORIZATION%\",\"hadoop.security.authentication\":\"%HADOOP_SECURITY_AUTHENTICATION%\",\"hadoop.security.auth_to_local\":\"%HADOOP_SECURITY_AUTH_TO_LOCAL%\",\"dfs.datanode.kerberos.principal\":\"%DFS_DATANODE_KERBEROS_PRINCIPAL%\",\"dfs.namenode.kerberos.principal\":\"%DFS_NAMENODE_KERBEROS_PRINCIPAL%\",\"dfs.secondary.namenode.kerberos.principal\":\"%DFS_SECONDARY_NAMENODE_KERBEROS_PRINCIPAL%\",\"hbase.master.kerberos.principal\":\"%HBASE_MASTER_KERBEROS_PRINCIPAL%\",\"hbase.rpc.engine\":\"%HBASE_RPC_ENGINE%\",\"hbase.rpc.protection\":\"%HBASE_RPC_PROTECTION%\",\"hbase.security.authentication\":\"%HBASE_SECURITY_AUTHENTICATION%\",\"hbase.zookeeper.property.clientPort\":\"%HBASE_ZOOKEEPER_PROPERTY_CLIENTPORT%\",\"hbase.zookeeper.quorum\":\"%HBASE_ZOOKEEPER_QUORUM%\",\"zookee
 per.znode.parent\":\"%ZOOKEEPER_ZNODE_PARENT%\",\"commonNameForCertificate\":\"%COMMON_NAME_FOR_CERTIFICATE%\"}',
now(), now(), 1, 1);
-SELECT @asset_id := id FROM x_asset WHERE asset_name='%REPOSITORY_NAME%' and act_status =
1;
-
-# create default policy to allow access to public
-INSERT INTO x_resource (policy_name, res_name, descr, res_type, asset_id, is_encrypt, is_recursive,
res_tables, res_col_fams, res_cols, res_status, table_type, col_type, create_time, update_time,
added_by_id, upd_by_id) 
- VALUES ('default-hbase', '/*/*/*', 'Default policy', 1, @asset_id, 2, 0, '*', '*', '*',
1, 0, 0, now(), now(), 1, 1);
-SELECT @resource_id := id FROM x_resource WHERE policy_name='default-hbase';
-
-DELIMITER //
-DROP PROCEDURE IF EXISTS CreateXAGroup;
-CREATE PROCEDURE CreateXAGroup(in groupName varchar(1024))
-BEGIN
-  DECLARE groupId bigint(20);
-
-  SELECT g.id INTO groupId FROM x_group g WHERE g.group_name = groupName;
-
-  IF groupId IS NULL THEN
-	SELECT CONCAT('Creating group ', groupName);
-    INSERT INTO x_group (group_name, descr, status, group_type, create_time, update_time,
added_by_id, upd_by_id) VALUES (groupName, groupName, 0, 1, now(), now(), 1, 1);
-  ELSE
-    SELECT CONCAT('Group ', groupName, ' already exists');
-  END IF;
-END //
-DELIMITER ;
-CALL CreateXAGroup('public');
-DROP PROCEDURE IF EXISTS CreateXAGroup;
-
-SELECT @group_public := id FROM x_group WHERE group_name='public';
-
-SELECT @perm_read   := 2;
-SELECT @perm_write  := 3;
-SELECT @perm_create := 4;
-SELECT @perm_admin  := 6;
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_read, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_write, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_create, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_admin, now(), 0, 1, 1, now(), now(), 1, 1);
-
-# Enable auditing
-INSERT INTO x_audit_map (res_id, audit_type, create_time, update_time, added_by_id, upd_by_id)
VALUES (@resource_id, 1, now(), now(), 1, 1);

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/5e483675/security-admin/db/create_repo_hdfs.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/create_repo_hdfs.sql b/security-admin/db/create_repo_hdfs.sql
deleted file mode 100644
index 6c5af09..0000000
--- a/security-admin/db/create_repo_hdfs.sql
+++ /dev/null
@@ -1,79 +0,0 @@
--- Licensed to the Apache Software Foundation (ASF) under one or more
--- contributor license agreements.  See the NOTICE file distributed with
--- this work for additional information regarding copyright ownership.
--- The ASF licenses this file to You under the Apache License, Version 2.0
--- (the "License"); you may not use this file except in compliance with
--- the License.  You may obtain a copy of the License at
---
---     http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-
-# Replace the following:
-#  %REPOSITORY_NAME%
-#  %REPOSITORY_DESC%
-#  %USERNAME%
-#  %PASSWORD%
-#  %FS_DEFAULT_NAME%
-#  %HADOOP_SECURITY_AUTHORIZATION%
-#  %HADOOP_SECURITY_AUTHENTICATION%
-#  %HADOOP_SECURITY_AUTH_TO_LOCAL%
-#  %DFS_DATANODE_KERBEROS_PRINCIPAL%
-#  %DFS_NAMENODE_KERBEROS_PRINCIPAL%
-#  %DFS_SECONDARY_NAMENODE_KERBEROS_PRINCIPAL%
-#  %COMMON_NAME_FOR_CERTIFICATE%
-#
-# Example:
-#  INSERT INTO `x_asset` (asset_name, descr, act_status, asset_type, config, create_time,
update_time, added_by_id, upd_by_id)
-#   VALUES ('hdfstest', 'hdfs test repository', 1, 1, '{\"username\":\"policymgr\",\"password\":\"policymgr\",\"fs.default.name\":\"hdfs://sandbox.hortonworks.com:8020\",\"hadoop.security.authorization\":\"true\",\"hadoop.security.authentication\":\"simple\",\"hadoop.security.auth_to_local\":\"\",\"dfs.datanode.kerberos.principal\":\"\",\"dfs.namenode.kerberos.principal\":\"\",\"dfs.secondary.namenode.kerberos.principal\":\"\",\"commonNameForCertificate\":\"\"}',
now(), now(), 1, 1);
-#
-
-INSERT INTO `x_asset` (asset_name, descr, act_status, asset_type, config, create_time, update_time,
added_by_id, upd_by_id)
-  VALUES ('%REPOSITORY_NAME%', '%REPOSITORY_DESC%', 1 ,1, '{\"username\":\"%USERNAME%\",\"password\":\"%PASSWORD%\",\"fs.default.name\":\"%FS_DEFAULT_NAME%\",\"hadoop.security.authorization\":\"%HADOOP_SECURITY_AUTHORIZATION%\",\"hadoop.security.authentication\":\"%HADOOP_SECURITY_AUTHENTICATION%\",\"hadoop.security.auth_to_local\":\"%HADOOP_SECURITY_AUTH_TO_LOCAL%\",\"dfs.datanode.kerberos.principal\":\"%DFS_DATANODE_KERBEROS_PRINCIPAL%\",\"dfs.namenode.kerberos.principal\":\"%DFS_NAMENODE_KERBEROS_PRINCIPAL%\",\"dfs.secondary.namenode.kerberos.principal\":\"%DFS_SECONDARY_NAMENODE_KERBEROS_PRINCIPAL%\",\"commonNameForCertificate\":\"%COMMON_NAME_FOR_CERTIFICATE%\"}',
now(), now(), 1, 1);
-SELECT @asset_id := id FROM x_asset WHERE asset_name='%REPOSITORY_NAME%' and act_status =
1;
-
-# create default policy to allow access to public
-INSERT INTO x_resource (policy_name, res_name, descr, res_type, asset_id, is_encrypt, is_recursive,
res_status, table_type, col_type, create_time, update_time, added_by_id, upd_by_id) 
- VALUES ('default-hdfs', '/', 'Default policy', 1, @asset_id, 2, 1, 1, 0, 0, now(), now(),
1, 1);
-SELECT @resource_id := id FROM x_resource WHERE policy_name='default-hdfs';
-
-DELIMITER //
-DROP PROCEDURE IF EXISTS CreateXAGroup;
-CREATE PROCEDURE CreateXAGroup(in groupName varchar(1024))
-BEGIN
-  DECLARE groupId bigint(20);
-
-  SELECT g.id INTO groupId FROM x_group g WHERE g.group_name = groupName;
-
-  IF groupId IS NULL THEN
-	SELECT CONCAT('Creating group ', groupName);
-    INSERT INTO x_group (group_name, descr, status, group_type, create_time, update_time,
added_by_id, upd_by_id) VALUES (groupName, groupName, 0, 1, now(), now(), 1, 1);
-  ELSE
-    SELECT CONCAT('Group ', groupName, ' already exists');
-  END IF;
-END //
-DELIMITER ;
-CALL CreateXAGroup('public');
-DROP PROCEDURE IF EXISTS CreateXAGroup;
-
-SELECT @group_public := id FROM x_group WHERE group_name='public';
-
-SELECT @perm_read    := 2;
-SELECT @perm_write   := 3;
-SELECT @perm_execute := 9;
-SELECT @perm_admin   := 6;
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_read, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_write, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_execute, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_admin, now(), 0, 1, 1, now(), now(), 1, 1);
-
-# Enable auditing
-INSERT INTO x_audit_map (res_id, audit_type, create_time, update_time, added_by_id, upd_by_id)
VALUES (@resource_id, 1, now(), now(), 1, 1);

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/5e483675/security-admin/db/create_repo_hive.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/create_repo_hive.sql b/security-admin/db/create_repo_hive.sql
deleted file mode 100644
index 8c89154..0000000
--- a/security-admin/db/create_repo_hive.sql
+++ /dev/null
@@ -1,90 +0,0 @@
--- Licensed to the Apache Software Foundation (ASF) under one or more
--- contributor license agreements.  See the NOTICE file distributed with
--- this work for additional information regarding copyright ownership.
--- The ASF licenses this file to You under the Apache License, Version 2.0
--- (the "License"); you may not use this file except in compliance with
--- the License.  You may obtain a copy of the License at
---
---     http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-
-# Replace the following:
-#  %REPOSITORY_NAME%
-#  %REPOSITORY_DESC%
-#  %USERNAME%
-#  %PASSWORD%
-#  %JDBC_DRIVERCLASSNAME%
-#  %JDBC_URL%
-#  %COMMON_NAME_FOR_CERTIFICATE%
-#
-# Example:
-#  INSERT INTO `x_asset` (asset_name, descr, act_status, asset_type, config, create_time,
update_time, added_by_id, upd_by_id)
-#   VALUES ('hivetest', 'hive test repo', 1, 3, '{\"username\":\"policymgr\",\"password\":\"policymgr\",\"jdbc.driverClassName\":\"org.apache.hive.jdbc.HiveDriver\",\"jdbc.url\":\"jdbc:hive2://sandbox.hortonworks.com:10000/default\",\"commonNameForCertificate\":\"\"}',
now(), now(), 1, 1);
-#
-
-INSERT INTO `x_asset` (asset_name, descr, act_status, asset_type, config, create_time, update_time,
added_by_id, upd_by_id)
- VALUES ('%REPOSITORY_NAME%', '%REPOSITORY_DESC%', 1, 3, '{\"username\":\"%USERNAME%\",\"password\":\"%PASSWORD%\",\"jdbc.driverClassName\":\"%JDBC_DRIVERCLASSNAME%\",\"jdbc.url\":\"%JDBC_URL%\",\"commonNameForCertificate\":\"%COMMON_NAME_FOR_CERTIFICATE%\"}',
now(), now(), 1, 1);
-SELECT @asset_id := id FROM x_asset WHERE asset_name='%REPOSITORY_NAME%' and act_status =
1;
-
-# create default policy to allow access to public
-INSERT INTO x_resource (policy_name, res_name, descr, res_type, asset_id, is_encrypt, is_recursive,
res_dbs, res_tables, res_cols, res_status, table_type, col_type, create_time, update_time,
added_by_id, upd_by_id) 
- VALUES ('default-hive', '/*/*/*', 'Default policy', 1, @asset_id, 2, 0, '*', '*', '*', 1,
0, 0, now(), now(), 1, 1);
-SELECT @resource_id := id FROM x_resource WHERE policy_name='default-hive';
-
-DELIMITER //
-DROP PROCEDURE IF EXISTS CreateXAGroup;
-CREATE PROCEDURE CreateXAGroup(in groupName varchar(1024))
-BEGIN
-  DECLARE groupId bigint(20);
-
-  SELECT g.id INTO groupId FROM x_group g WHERE g.group_name = groupName;
-
-  IF groupId IS NULL THEN
-	SELECT CONCAT('Creating group ', groupName);
-    INSERT INTO x_group (group_name, descr, status, group_type, create_time, update_time,
added_by_id, upd_by_id) VALUES (groupName, groupName, 0, 1, now(), now(), 1, 1);
-  ELSE
-    SELECT CONCAT('Group ', groupName, ' already exists');
-  END IF;
-END //
-DELIMITER ;
-CALL CreateXAGroup('public');
-DROP PROCEDURE IF EXISTS CreateXAGroup;
-
-SELECT @group_public := id FROM x_group WHERE group_name='public';
-
-SELECT @perm_create := 4;
-SELECT @perm_select := 10;
-SELECT @perm_update := 11;
-SELECT @perm_drop   := 12;
-SELECT @perm_alter  := 13;
-SELECT @perm_index  := 14;
-SELECT @perm_lock   := 15;
-SELECT @perm_all    := 16;
-SELECT @perm_admin  := 6;
-
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_create, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_select, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_update, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_drop, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_alter, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_index, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_lock, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_all, now(), 0, 1, 1, now(), now(), 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, perm_group, is_recursive,
is_wild_card, grant_revoke, create_time, update_time, added_by_id, upd_by_id) VALUES (@resource_id,
@group_public, 2, @perm_admin, now(), 0, 1, 1, now(), now(), 1, 1);
-
-# Enable auditing
-INSERT INTO x_audit_map (res_id, audit_type, create_time, update_time, added_by_id, upd_by_id)
VALUES (@resource_id, 1, now(), now(), 1, 1);

http://git-wip-us.apache.org/repos/asf/incubator-argus/blob/5e483675/security-admin/db/create_repo_knox.sql
----------------------------------------------------------------------
diff --git a/security-admin/db/create_repo_knox.sql b/security-admin/db/create_repo_knox.sql
deleted file mode 100644
index 5d42115..0000000
--- a/security-admin/db/create_repo_knox.sql
+++ /dev/null
@@ -1,260 +0,0 @@
--- Licensed to the Apache Software Foundation (ASF) under one or more
--- contributor license agreements.  See the NOTICE file distributed with
--- this work for additional information regarding copyright ownership.
--- The ASF licenses this file to You under the Apache License, Version 2.0
--- (the "License"); you may not use this file except in compliance with
--- the License.  You may obtain a copy of the License at
---
---     http://www.apache.org/licenses/LICENSE-2.0
---
--- Unless required by applicable law or agreed to in writing, software
--- distributed under the License is distributed on an "AS IS" BASIS,
--- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--- See the License for the specific language governing permissions and
--- limitations under the License.
-
-#
-# create a demo repository, policy for Knox agent
-#
-# repository              -> x_asset
-# policy                  -> x_resource
-# users, groups in policy -> x_perm_map
-#
-# Replace the following:
-#  %REPOSITORY_NAME% 
-#  %REPOSITORY_DESC%
-#  %USERNAME%
-#  %PASSWORD%
-#  %JDBC_DRIVERCLASSNAME%
-#  %JDBC_URL%
-#  %COMMON_NAME_FOR_CERTIFICATE%
-
-# Create Repository
-# asset_name: repository name
-# descr: repository description
-# act_status: active status: 1 -> active
-# asset_type: asset type: 1 ->hdfs, 2 ->hbase, 3->hive, 4-> knox
-# config: config parameters for repository in json format
-INSERT INTO `x_asset` (
-     asset_name, 
-     descr, 
-     act_status, 
-     asset_type, 
-     config, 
-     create_time, 
-     update_time,
-     added_by_id, 
-     upd_by_id)
-   VALUES (
-    'knoxtest', 
-    'knox test repo', 
-    1, 
-    4, 
-    '{\"knox.admin.user\":\"guest\",\"knox.admin.password\":\"guest-password\",\"knox.url\":\"https://hdp.example.com:8443/gateway/hdp/webhdfs/v1?op=LISTSTATUS\",\"knox.cert.cn\":\"cn=knox\"}',

-    now(), 
-    now(), 
-    1, 
-    1);
-
-# Create repostory
-# asset_name: repository name
-# descr: repository description
-# act_status: active status: 1 -> active
-# asset_type: asset type: 1 ->hdfs, 2 ->hbase, 3->hive, 4-> knox
-# config: config parameters for repository in json format
-# INSERT INTO `x_asset` (
-#   asset_name, 
-#  descr, 
-#  act_status, 
-#  asset_type, 
-#  config, 
-#  create_time, 
-#  update_time, 
-#  added_by_id, 
-#  upd_by_id)
-#VALUES (
-#  '%REPOSITORY_NAME%', 
-#  '%REPOSITORY_DESC%', 
-#  1, 
-#  3, 
-#  '{\"username\":\"%USERNAME%\",\"password\":\"%PASSWORD%\",\"jdbc.driverClassName\":\"%JDBC_DRIVERCLASSNAME%\",\"jdbc.url\":\"%JDBC_URL%\",\"commonNameForCertificate\":\"%COMMON_NAME_FOR_CERTIFICATE%\"}',

-#  now(), 
-#  now(), 
-#  1, 
-#  1);
-
-SELECT @asset_id := id FROM x_asset WHERE asset_name='%REPOSITORY_NAME%' and act_status =
1;
-
-# create policy example
-# INSERT INTO x_resource (
-#   res_name, 
-#   descr, 
-#   res_type, 
-#   asset_id, 
-#   is_encrypt, 
-#   is_recursive, 
-#   res_dbs, 
-#   res_tables, 
-#   res_cols, 
-#   res_status, 
-#   table_type, 
-#   col_type, 
-#   create_time, 
-#   update_time, 
-#   added_by_id, 
-#   upd_by_id) 
- #  VALUES ('/*/*/*', 'Default policy', 1, @asset_id, 2, 0, '*', '*', '*', 1, 0, 0, now(),
now(), 1, 1);
-
-# create policy to allow access to public
-INSERT INTO x_resource (
-    policy_name,
-	res_name, 
-    descr, 
-    res_type, 
-    asset_id, 
-    is_encrypt, 
-    is_recursive, 
-    res_dbs, 
-    res_tables, 
-    res_cols, 
-    res_status, 
-    table_type, 
-    col_type, 
-    create_time, 
-    update_time, 
-    added_by_id, 
-    upd_by_id) 
-VALUES (
-    'default-knox', 
-    '/*/*/*', 
-    'Default policy', 
-    1, 
-    @asset_id, 
-    2, 
-    0, 
-    '*', 
-    '*', 
-    '*', 
-    1, 
-    0, 
-    0, 
-    now(), 
-    now(), 
-    1, 
-    1);
-
-SELECT @resource_id := id FROM x_resource WHERE policy_name='default-knox';
-
-
-DELIMITER //
-DROP PROCEDURE CreateXAGroup;
-CREATE PROCEDURE CreateXAGroup(in groupName varchar(1024))
-BEGIN
-   DECLARE groupId bigint(20);
-
-   SELECT g.id INTO groupId FROM x_group g WHERE g.group_name = groupName;
-
-   IF groupId IS NULL THEN
-      INSERT INTO x_group (
-          group_name, 
-          descr, 
-          status, 
-          group_type, 
-          group_src, 
-          create_time, 
-          update_time, 
-          added_by_id, 
-          upd_by_id) 
-      VALUES (
-          groupName, 
-          groupName, 
-          0, 
-          1, 
-          0, 
-          now(), 
-          now(), 
-          1, 
-          1);
-   END IF;
-END //
-
-
-DELIMITER ;
-CALL CreateXAGroup('public');
-
-SELECT @group_public := id FROM x_group WHERE group_name='public';
-
-SELECT @perm_create := 4;
-SELECT @perm_select := 10;
-SELECT @perm_update := 11;
-SELECT @perm_drop   := 12;
-SELECT @perm_alter  := 13;
-SELECT @perm_index  := 14;
-SELECT @perm_lock   := 15;
-SELECT @perm_all    := 16;
-SELECT @perm_admin  := 6;
-
-
-# add permitted users, groups to policy
-# res_id: policy id
-# perm_type: read | write | | execute | admin etc
-# perm_for: user | grouo
-# user_id: user id
-# group_id: group id
-# perm_group: not used
-INSERT INTO x_perm_map (
-    res_id, 
-    group_id, 
-    perm_for, 
-    perm_type, 
-    is_recursive, 
-    is_wild_card, 
-    grant_revoke) 
-  VALUES (
-    @resource_id, 
-    @group_public, 
-    2, 
-    @perm_create, 
-    0, 
-    1, 
-    1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, is_recursive, is_wild_card,
grant_revoke) 
-                VALUES (@resource_id, @group_public, 2, @perm_select, 0, 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, is_recursive, is_wild_card,
grant_revoke) 
-                VALUES (@resource_id, @group_public, 2, @perm_update, 0, 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, is_recursive, is_wild_card,
grant_revoke) 
-                VALUES (@resource_id, @group_public, 2, @perm_drop, 0, 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, is_recursive, is_wild_card,
grant_revoke) 
-                VALUES (@resource_id, @group_public, 2, @perm_alter, 0, 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, is_recursive, is_wild_card,
grant_revoke) 
-                VALUES (@resource_id, @group_public, 2, @perm_index, 0, 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, is_recursive, is_wild_card,
grant_revoke) 
-                VALUES (@resource_id, @group_public, 2, @perm_lock, 0, 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, is_recursive, is_wild_card,
grant_revoke) 
-                VALUES (@resource_id, @group_public, 2, @perm_all, 0, 1, 1);
-
-INSERT INTO x_perm_map (res_id, group_id, perm_for, perm_type, is_recursive, is_wild_card,
grant_revoke) 
-                VALUES (@resource_id, @group_public, 2, @perm_admin, 0, 1, 1);
-
-# Enable auditing
-INSERT INTO x_audit_map (
-    res_id, 
-    audit_type, 
-    create_time, 
-    update_time, 
-    added_by_id, 
-    upd_by_id) 
-  VALUES (
-    @resource_id, 
-    1, 
-    now(), 
-    now(), 
-    1, 
-    1);


Mime
View raw message