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

refactor: plugin email without auth #170

Merged
merged 1 commit into from
Jul 27, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
30 changes: 15 additions & 15 deletions pkg/plugins/builtin/email/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,18 @@ This plugin send an email.

## Configuration

|Fields|Description
|---|---
| `smtp_username` | username of SMTP server
| `smtp_password` | password of SMTP server
| `smtp_port` | port of SMTP server
| `smtp_hostname` | hostname of SMTP server
| `smtp_skip_tls_verif` | Skip or not TLS insecure verify
| `from_address` | from which email you want to send the message
| `from_name` | from which name you want to send the message
| `to` | receiver(s) of your email
| `subject` | subject of your email
| `body` | content of your email
| Fields | Description |
| --------------------- | --------------------------------------------- |
| `smtp_username` | username of SMTP server |
| `smtp_password` | password of SMTP server |
| `smtp_port` | port of SMTP server |
| `smtp_hostname` | hostname of SMTP server |
| `smtp_skip_tls_verif` | Skip or not TLS insecure verify |
| `from_address` | from which email you want to send the message |
| `from_name` | from which name you want to send the message |
| `to` | receiver(s) of your email |
| `subject` | subject of your email |
| `body` | content of your email |

## Example

Expand All @@ -25,9 +25,9 @@ An action of type `email` requires the following kind of configuration:
action:
type: email
configuration:
# mandatory, string
# optional, string, leave empty for no auth
smtp_username: {{.config.smtp.username}}
# mandatory, string
# optional, string, leave empty for no auth
smtp_password: {{.config.smtp.password}}
# mandatory, string as uint
smtp_port: {{.config.smtp.port}}
Expand Down Expand Up @@ -68,4 +68,4 @@ Sensitive data should be retrieved from configstore and accessed through `{{.con

The `email` plugin declares automatically resources for its steps:
- `socket` to rate-limit concurrent execution on the number of open outgoing sockets
- `url:smtp_hostname` (where `smtp_hostname` is the outgoing SMTP server of the plugin configuration) to rate-limit concurrent execution on a specific outgoing SMTP server
- `url:smtp_hostname` (where `smtp_hostname` is the outgoing SMTP server of the plugin configuration) to rate-limit concurrent execution on a specific outgoing SMTP server
8 changes: 0 additions & 8 deletions pkg/plugins/builtin/email/email.go
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,6 @@ type Config struct {
func validConfig(config interface{}) error {
cfg := config.(*Config)

if cfg.SMTPUsername == "" {
return errors.New("smtp_username is missing")
}

if cfg.SMTPPassword == "" {
return errors.New("smtp_password is missing")
}

if cfg.SMTPPort == "" {
return errors.New("smtp_port is missing")
}
Expand Down