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:
gotjosh 2022-11-09 18:26:06 +00:00
parent e8b5c0aa0d
commit 7f94b16470
No known key found for this signature in database
GPG Key ID: A6E1DDE38FF3C74E
1 changed files with 6 additions and 0 deletions

View File

@ -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
} }