alertmanager/config/testdata
Eric R. Rath efc956c7f7
SMTP config: add global and local password file fields (#3038)
* SMTP config: add global and local password file fields

Add config fields (for both global email config and route-specific email
config) that specify path to file containing SMTP password.  We don't
want the password in the config file itself, and reading the password
from a k8s-secret-backed file keeps the password itself "encrypted at
rest" in etcd, and cleanly separated from the rest of the AM config.

I used the same approach as pull request #2534 "Add support to set the
Slack URL in the file"
<https://github.com/prometheus/alertmanager/pull/2534/files> in the
upstream repo.

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* changed *AuthPasswordFile field types to string per review feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* added error to getPassword() retval per review feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* simplified conf.smtp-* files

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* update docs to reflect field type change

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* don't treat username-without-password as invalid

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* test cleanup

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* Apply suggestions from code review

Co-authored-by: Simon Pasquier <spasquie@redhat.com>
Signed-off-by: Eric R. Rath <4080262+ericrrath@users.noreply.github.com>

* Updated per review feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* added sub-test per review feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* added test on Email.getPassword() per feedback

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* only inherit global SMTP passwords if neither local password field is set

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

* removed blank line caught by gofumpt

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>

Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
Signed-off-by: Eric R. Rath <4080262+ericrrath@users.noreply.github.com>
Co-authored-by: Simon Pasquier <spasquie@redhat.com>
2022-09-16 14:36:57 +02:00
..
conf.empty-fields.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.good.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.group-by-all.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.http-config.good.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.nil-match_re-route.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.nil-source_match_re-inhibition.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.nil-target_match_re-inhibition.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.opsgenie-both-file-and-apikey.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.opsgenie-default-apikey-file.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.opsgenie-default-apikey-old-team.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.opsgenie-default-apikey.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.opsgenie-no-apikey.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.slack-both-file-and-url.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.slack-default-api-url-file.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.slack-no-api-url.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.smtp-both-password-and-file.yml SMTP config: add global and local password file fields (#3038) 2022-09-16 14:36:57 +02:00
conf.smtp-no-username-or-password.yml SMTP config: add global and local password file fields (#3038) 2022-09-16 14:36:57 +02:00
conf.smtp-password-global-and-local.yml SMTP config: add global and local password file fields (#3038) 2022-09-16 14:36:57 +02:00
conf.sns-invalid.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.sns-topic-arn.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.victorops-default-apikey.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00
conf.victorops-no-apikey.yml *: bump to Go 1.17 (#2792) 2021-12-22 14:03:53 +01:00