Skip to content

Commit

Permalink
Validate that either bot_token or http_configs.authorization must be …
Browse files Browse the repository at this point in the history
…present

Signed-off-by: gotjosh <josue.abreu@gmail.com>
  • Loading branch information
gotjosh committed Nov 9, 2022
1 parent e4fc298 commit 628312e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions config/notifiers.go
Original file line number Diff line number Diff line change
Expand Up @@ -197,6 +197,12 @@ func (c *WebexConfig) UnmarshalYAML(unmarshal func(interface{}) error) error {
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
}

Expand Down

0 comments on commit 628312e

Please sign in to comment.