Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SMTP config: add global and local password file fields #3038

Merged
merged 13 commits into from Sep 16, 2022

Commits on Sep 12, 2022

  1. 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 prometheus#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>
    ericrrath committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    e2971ee View commit details
    Browse the repository at this point in the history
  2. changed *AuthPasswordFile field types to string per review feedback

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    397db16 View commit details
    Browse the repository at this point in the history
  3. added error to getPassword() retval per review feedback

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    c66e4ea View commit details
    Browse the repository at this point in the history
  4. simplified conf.smtp-* files

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    751ecd3 View commit details
    Browse the repository at this point in the history
  5. update docs to reflect field type change

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 12, 2022
    Configuration menu
    Copy the full SHA
    936a7de View commit details
    Browse the repository at this point in the history

Commits on Sep 13, 2022

  1. don't treat username-without-password as invalid

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    803d8bb View commit details
    Browse the repository at this point in the history
  2. test cleanup

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    4ad5936 View commit details
    Browse the repository at this point in the history
  3. 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>
    ericrrath and simonpasquier committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    114b26c View commit details
    Browse the repository at this point in the history
  4. Updated per review feedback

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 13, 2022
    Configuration menu
    Copy the full SHA
    9091654 View commit details
    Browse the repository at this point in the history

Commits on Sep 14, 2022

  1. added sub-test per review feedback

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 14, 2022
    Configuration menu
    Copy the full SHA
    ba8a3bb View commit details
    Browse the repository at this point in the history

Commits on Sep 15, 2022

  1. added test on Email.getPassword() per feedback

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    da48e29 View commit details
    Browse the repository at this point in the history
  2. only inherit global SMTP passwords if neither local password field is…

    … set
    
    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    d51d1b3 View commit details
    Browse the repository at this point in the history
  3. removed blank line caught by gofumpt

    Signed-off-by: Eric R. Rath <eric.rath@oracle.com>
    ericrrath committed Sep 15, 2022
    Configuration menu
    Copy the full SHA
    1444875 View commit details
    Browse the repository at this point in the history