Search in sources :

Example 11 with WallConfig

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

the class WallConfigTest method test_deleteAllow_false.

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

Example 12 with WallConfig

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

the class WallConfigTest method test_updateAllow.

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

Example 13 with WallConfig

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

the class WallConfigTest method test_selectAllow_false.

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

Example 14 with WallConfig

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

the class PGDenyFunctionTest method test_true.

public void test_true() throws Exception {
    WallConfig config = new WallConfig();
    config.setFunctionCheck(false);
    Assert.assertTrue(//
    WallUtils.isValidatePostgres("SELECT current_catalog() from t where id = ?", //
    config));
}
Also used : WallConfig(com.alibaba.druid.wall.WallConfig)

Example 15 with WallConfig

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

the class WallConfigTest method test_insertAllow.

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

Aggregations

WallConfig (com.alibaba.druid.wall.WallConfig)82 Properties (java.util.Properties)8 DruidDataSource (com.alibaba.druid.pool.DruidDataSource)4 WallFilter (com.alibaba.druid.wall.WallFilter)4 WallCheckResult (com.alibaba.druid.wall.WallCheckResult)3 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 Filter (com.alibaba.druid.filter.Filter)1 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