mirror of
https://github.com/alibaba/druid.git
synced 2023-03-04 19:17:16 +00:00
improved WallFilter config. issue #1426
This commit is contained in:
@@ -94,6 +94,12 @@ public class DruidDataSourceFactory implements ObjectFactory {
|
||||
"druid.maxWaitThreadCount", //
|
||||
"druid.failFast", //
|
||||
"druid.phyTimeoutMillis", //
|
||||
"druid.wall.tenantColumn", //
|
||||
"druid.wall.updateAllow", //
|
||||
"druid.wall.deleteAllow", //
|
||||
"druid.wall.insertAllow", //
|
||||
"druid.wall.selelctAllow", //
|
||||
"druid.wall.multiStatementAllow", //
|
||||
};
|
||||
|
||||
@Override
|
||||
|
||||
@@ -791,33 +791,39 @@ public class WallConfig implements WallConfigMBean {
|
||||
|
||||
public void configFromProperties(Properties properties) {
|
||||
{
|
||||
String tenantColumn = properties.getProperty("druid.wall.tenantColumn");
|
||||
if (tenantColumn != null) {
|
||||
this.setTenantColumn(tenantColumn);
|
||||
String propertyValue = properties.getProperty("druid.wall.tenantColumn");
|
||||
if (propertyValue != null) {
|
||||
this.setTenantColumn(propertyValue);
|
||||
}
|
||||
}
|
||||
{
|
||||
Boolean selelctAllow = getBoolean(properties, "druid.wall.selelctAllow");
|
||||
if (selelctAllow != null) {
|
||||
this.setSelelctAllow(selelctAllow);
|
||||
Boolean propertyValue = getBoolean(properties, "druid.wall.selelctAllow");
|
||||
if (propertyValue != null) {
|
||||
this.setSelelctAllow(propertyValue);
|
||||
}
|
||||
}
|
||||
{
|
||||
Boolean updateAllow = getBoolean(properties, "druid.wall.updateAllow");
|
||||
if (updateAllow != null) {
|
||||
this.setUpdateAllow(updateAllow);
|
||||
Boolean propertyValue = getBoolean(properties, "druid.wall.updateAllow");
|
||||
if (propertyValue != null) {
|
||||
this.setUpdateAllow(propertyValue);
|
||||
}
|
||||
}
|
||||
{
|
||||
Boolean deleteAllow = getBoolean(properties, "druid.wall.deleteAllow");
|
||||
if (deleteAllow != null) {
|
||||
this.setDeleteAllow(deleteAllow);
|
||||
Boolean propertyValue = getBoolean(properties, "druid.wall.deleteAllow");
|
||||
if (propertyValue != null) {
|
||||
this.setDeleteAllow(propertyValue);
|
||||
}
|
||||
}
|
||||
{
|
||||
Boolean insertAllow = getBoolean(properties, "druid.wall.insertAllow");
|
||||
if (insertAllow != null) {
|
||||
this.setInsertAllow(insertAllow);
|
||||
Boolean propertyValue = getBoolean(properties, "druid.wall.insertAllow");
|
||||
if (propertyValue != null) {
|
||||
this.setInsertAllow(propertyValue);
|
||||
}
|
||||
}
|
||||
{
|
||||
Boolean propertyValue = getBoolean(properties, "druid.wall.multiStatementAllow");
|
||||
if (propertyValue != null) {
|
||||
this.setMultiStatementAllow(propertyValue);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user