Search in sources :

Example 41 with WallConfig

use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.

the class WallTruncateTest method testMySql_false.

public void testMySql_false() throws Exception {
    WallConfig config = new WallConfig();
    config.setTruncateAllow(false);
    Assert.assertFalse(WallUtils.isValidateMySql(sql, config));
}
Also used : WallConfig(com.alibaba.druid.wall.WallConfig)

Example 42 with WallConfig

use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.

the class WallTruncateTest method testORACLE_false.

public void testORACLE_false() throws Exception {
    WallConfig config = new WallConfig();
    config.setTruncateAllow(false);
    Assert.assertFalse(WallUtils.isValidateOracle(sql, config));
}
Also used : WallConfig(com.alibaba.druid.wall.WallConfig)

Example 43 with WallConfig

use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.

the class WallConfigTest method test_selectAllow.

public void test_selectAllow() throws Exception {
    Properties properties = new Properties();
    properties.setProperty("druid.wall.selelctAllow", "true");
    WallConfig config = new WallConfig();
    config.configFromProperties(properties);
    Assert.assertTrue(config.isSelelctAllow());
}
Also used : WallConfig(com.alibaba.druid.wall.WallConfig) Properties(java.util.Properties)

Example 44 with WallConfig

use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.

the class WallConfigTest method test_deleteAllow.

public void test_deleteAllow() throws Exception {
    Properties properties = new Properties();
    properties.setProperty("druid.wall.deleteAllow", "true");
    WallConfig config = new WallConfig();
    config.configFromProperties(properties);
    Assert.assertTrue(config.isDeleteAllow());
}
Also used : WallConfig(com.alibaba.druid.wall.WallConfig) Properties(java.util.Properties)

Example 45 with WallConfig

use of com.alibaba.druid.wall.WallConfig in project druid by alibaba.

the class WallDeleteWhereTest1 method testMySql_false.

public void testMySql_false() throws Exception {
    WallConfig config = new WallConfig();
    config.setDeleteWhereNoneCheck(true);
    Assert.assertFalse(WallUtils.isValidateMySql(sql, config));
}
Also used : WallConfig(com.alibaba.druid.wall.WallConfig)

Aggregations

WallConfig (com.alibaba.druid.wall.WallConfig)83 Properties (java.util.Properties)8 WallFilter (com.alibaba.druid.wall.WallFilter)5 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)4 WallCheckResult (com.alibaba.druid.wall.WallCheckResult)3 Filter (com.alibaba.druid.filter.Filter)2 SQLExpr (com.alibaba.druid.sql.ast.SQLExpr)2 OracleMockDriver (com.alibaba.druid.test.util.OracleMockDriver)2 WallContext (com.alibaba.druid.wall.WallContext)2 MySqlWallProvider (com.alibaba.druid.wall.spi.MySqlWallProvider)2 SQLCommentHint (com.alibaba.druid.sql.ast.SQLCommentHint)1 SQLStatement (com.alibaba.druid.sql.ast.SQLStatement)1 SQLStartTransactionStatement (com.alibaba.druid.sql.ast.statement.SQLStartTransactionStatement)1 MySqlCommitStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlCommitStatement)1 MySqlDeleteStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlDeleteStatement)1 MySqlDescribeStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlDescribeStatement)1 MySqlHintStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlHintStatement)1 MySqlLockTableStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlLockTableStatement)1 MySqlRenameTableStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlRenameTableStatement)1 MySqlReplaceStatement (com.alibaba.druid.sql.dialect.mysql.ast.statement.MySqlReplaceStatement)1