Search in sources :

Example 81 with WallConfig

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

the class MySqlWallTest25 method test_true_2.

public void test_true_2() throws Exception {
    WallConfig config = new WallConfig();
    config.setUpdateWhereNoneCheck(true);
    Assert.assertTrue(//
    WallUtils.isValidateMySql("update test.dml_health_check set id=? limit ?", //
    config));
}
Also used : WallConfig(com.alibaba.druid.wall.WallConfig)

Example 82 with WallConfig

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

the class MySqlWallTest33 method test_true.

public void test_true() throws Exception {
    WallConfig config = new WallConfig();
    config.setStrictSyntaxCheck(false);
    Assert.assertTrue(//
    WallUtils.isValidateMySql("DELETE FROM lhwdesign_data WHERE data_id IN (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?", //
    config));
}
Also used : WallConfig(com.alibaba.druid.wall.WallConfig)

Example 83 with WallConfig

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

the class DruidDBConfig method getProxyFilters.

private List<Filter> getProxyFilters() {
    List<Filter> proxyFilters = Lists.newArrayList();
    WallConfig wallConfig = new WallConfig();
    wallConfig.setDir("");
    wallConfig.setCommentAllow(true);
    wallConfig.init();
    WallFilter wallFilter = new WallFilter();
    wallFilter.setDbType("mysql");
    wallFilter.setConfig(wallConfig);
    proxyFilters.add(wallFilter);
    return proxyFilters;
}
Also used : WallFilter(com.alibaba.druid.wall.WallFilter) WallFilter(com.alibaba.druid.wall.WallFilter) WebStatFilter(com.alibaba.druid.support.http.WebStatFilter) Filter(com.alibaba.druid.filter.Filter) 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