Validate that either bot_token or http_configs.authorization must be present
Signed-off-by: gotjosh <josue.abreu@gmail.com>
This commit is contained in:
parent
e8b5c0aa0d
commit
7f94b16470
|
@ -197,6 +197,12 @@ func (c *WebexConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
|
||||||
return fmt.Errorf("missing room_id on webex_config")
|
return fmt.Errorf("missing room_id on webex_config")
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if c.BotToken == "" {
|
||||||
|
if c.HTTPConfig == nil || c.HTTPConfig.Authorization == nil {
|
||||||
|
return fmt.Errorf("missing one of webex_configs.http_config.authorization or bot_token")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue