use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallDeleteWhereTest2 method test_check_false.
public void test_check_false() throws Exception {
WallConfig config = new WallConfig();
config.setDeleteWhereAlwayTrueCheck(false);
config.setConditionAndAlwayTrueAllow(true);
config.setCommentAllow(true);
Assert.assertTrue(WallUtils.isValidateMySql(sql, config));
Assert.assertTrue(WallUtils.isValidateMySql(sql1, config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallDeleteWhereTest2 method test_check_true.
public void test_check_true() throws Exception {
WallConfig config = new WallConfig();
config.setDeleteWhereAlwayTrueCheck(true);
config.setConditionAndAlwayTrueAllow(true);
config.setCommentAllow(true);
Assert.assertFalse(WallUtils.isValidateMySql(sql, config));
Assert.assertFalse(WallUtils.isValidateMySql(sql1, config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallDropTest method testOracle.
public void testOracle() throws Exception {
WallConfig config = new WallConfig();
config.setDropTableAllow(false);
Assert.assertFalse(WallUtils.isValidateOracle("DROP TABLE T1", config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class MySqlWallPermitTableTest method test_allow.
public void test_allow() throws Exception {
WallConfig config = new WallConfig();
config.setTableCheck(false);
Assert.assertTrue(WallUtils.isValidateMySql("select benchmark( 500000, sha1( 'test' ) ) FROM X", config));
}
use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.
the class WallUnionTest method testOracle.
public void testOracle() throws Exception {
WallConfig config = new WallConfig();
config.setSelectUnionCheck(true);
Assert.assertTrue(WallUtils.isValidateOracle("select f1, f2 from t where f1=1 union select 1, 2", config));
Assert.assertFalse(WallUtils.isValidateOracle("select f1, f2 from t where f1=1 union select 1, 2 --", config));
}
Aggregations