* try a more complicated but clearer approach explicitly returning a no-auth stmp.Auth when no username is supplied in config
Signed-off-by: Jo Walsh <jowalsh@bgs.ac.uk>
* fix test to expect no error from auth if username is not supplied
Signed-off-by: Jo Walsh <jowalsh@bgs.ac.uk>
* clean up some formatting errors in surplus comments
Signed-off-by: Jo Walsh <jowalsh@bgs.ac.uk>
* keep noAuth / loginAuth functions all together
Signed-off-by: Jo Walsh <jowalsh@bgs.ac.uk>
* Address latest comments
Co-Authored-By: Jo Walsh <jowalsh@bgs.ac.uk>
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Support adding custom fields to VictorOps notifications
* Response to feedback
* Added logic to validate victorops custom fields to config load time
* Cleanup victorops notifier of logic duplicated in config check
* rebase and further cleanup from feedback
* another grammer fix
Signed-off-by: Jason Roberts <jroberts@drud.com>
* config: validate URLs at config load time
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Address Brian and Lucas comments
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Shallow copy of URL instead of reparsing it
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Unshadow net/url package
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
* Make a deep-copy of URL struct
Signed-off-by: Simon Pasquier <spasquie@redhat.com>
- `tmplText` and `tmplHTML` are using a monad-style error handling [1].
This reduces the verbosity of the error logic, but introduces the risk
of forgetting the final error check. This patch does not remove this
coding-style, but ensures proper error checking in the Email and
PagerDuty notifier.
- Ensure to handle errors returned by `multipartWriter.Close()` and
`wc.Write(buffer.Bytes())` in `Email.Notify()`.
[1] https://www.innoq.com/en/blog/golang-errors-monads/
Signed-off-by: Max Leonard Inden <IndenML@gmail.com>
See #1223, looks like OpsGenie now sometimes returns a 422 when you
don't specify a team. This change cleans up the JSON output and
add a few unit tests.
* WECHAT support by ybyang2/berlinsaint
* correct the whitespace
* add some TestFile and modify some naming errors by ybyang2/berlinsaint
* modify wechat retry test expect
* template error
* add newline
Signed-off-by: yb_home <berlinsaint@126.com>
* fmt some pr code
* use the @stuartnelson3 the test-ci-wechat bingdata.go
* notify go add wechat