up
This commit is contained in:
parent
1154ada2df
commit
927310a439
|
@ -129,10 +129,9 @@ func (w *WaapSource) Configure(yamlConfig []byte, logger *log.Entry) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
w.InChan = make(chan waf.ParsedRequest)
|
w.InChan = make(chan waf.ParsedRequest)
|
||||||
|
waapCfg := waf.WaapConfig{Logger: w.logger.WithField("component", "waap_config")}
|
||||||
|
|
||||||
//let's load the associated waap_config:
|
//let's load the associated waap_config:
|
||||||
if w.config.WaapConfigPath != "" {
|
|
||||||
waapCfg := waf.WaapConfig{Logger: w.logger.WithField("component", "waap_config")}
|
|
||||||
if w.config.WaapConfigPath != "" {
|
if w.config.WaapConfigPath != "" {
|
||||||
err := waapCfg.LoadByPath(w.config.WaapConfigPath)
|
err := waapCfg.LoadByPath(w.config.WaapConfigPath)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
@ -146,15 +145,11 @@ func (w *WaapSource) Configure(yamlConfig []byte, logger *log.Entry) error {
|
||||||
} else {
|
} else {
|
||||||
return fmt.Errorf("no waap_config provided")
|
return fmt.Errorf("no waap_config provided")
|
||||||
}
|
}
|
||||||
|
|
||||||
w.WaapRuntime, err = waapCfg.Build()
|
w.WaapRuntime, err = waapCfg.Build()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to build waap_config : %s", err)
|
return fmt.Errorf("unable to build waap_config : %s", err)
|
||||||
}
|
}
|
||||||
} else if w.config.WaapConfig != "" {
|
|
||||||
return fmt.Errorf("resolution of waap_config not implemented yet")
|
|
||||||
} else {
|
|
||||||
return fmt.Errorf("no waap_config provided")
|
|
||||||
}
|
|
||||||
|
|
||||||
err = w.WaapRuntime.ProcessOnLoadRules()
|
err = w.WaapRuntime.ProcessOnLoadRules()
|
||||||
|
|
||||||
|
|
|
@ -168,9 +168,10 @@ func (wc *WaapConfig) Load(configName string) error {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("unable to load waap-config %s : %s", hubWaapConfigItem.LocalPath, err)
|
return fmt.Errorf("unable to load waap-config %s : %s", hubWaapConfigItem.LocalPath, err)
|
||||||
}
|
}
|
||||||
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
return nil
|
return fmt.Errorf("no waap-config found for %s", configName)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (wc *WaapConfig) Build() (*WaapRuntimeConfig, error) {
|
func (wc *WaapConfig) Build() (*WaapRuntimeConfig, error) {
|
||||||
|
|
Loading…
Reference in a new issue