-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
18 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,6 +81,7 @@ emailsender: | |
clusterName: "" | ||
environment: "" | ||
senderAddress: "[email protected]" | ||
senderAlias: "RHACS Cloud Service" | ||
authConfigFromKubernetes: true | ||
emailProvider: "AWS_SES" | ||
resources: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -40,6 +40,7 @@ type Config struct { | |
KubernetesSvcURL string `env:"KUBERNETES_SVC_URL" envDefault:"https://kubernetes.default.svc"` | ||
KubernetesJWKSPath string `env:"KUBERNETES_JWKS_PATH" envDefault:"openid/v1/jwks"` | ||
SenderAddress string `env:"SENDER_ADDRESS" envDefault:"[email protected]"` | ||
SenderAlias string `env:"SENDER_ALIAS" envDefault:"RHACS Cloud Service"` | ||
LimitEmailPerTenant int `env:"LIMIT_EMAIL_PER_TENANT" envDefault:"250"` | ||
SesMaxBackoffDelay time.Duration `env:"SES_MAX_BACKOFF_DELAY" envDefault:"5s"` | ||
SesMaxAttempts int `env:"SES_MAX_ATTEMPTS" envDefault:"3"` | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,6 +33,7 @@ func (m *MockedRateLimiter) PersistEmailSendEvent(tenantID string) error { | |
|
||
func TestSend_Success(t *testing.T) { | ||
from := "[email protected]" | ||
fromAlias := "RHACS Cloud Service" | ||
to := []string{"[email protected]", "[email protected]"} | ||
subject := "Test subject" | ||
textBody := "text body" | ||
|
@@ -62,6 +63,7 @@ func TestSend_Success(t *testing.T) { | |
mockedSES := &SES{sesClient: mockClient} | ||
mockedSender := AWSMailSender{ | ||
from, | ||
fromAlias, | ||
mockedSES, | ||
mockedRateLimiter, | ||
} | ||
|
@@ -87,6 +89,7 @@ func TestSend_LimitExceeded(t *testing.T) { | |
mockedSES := &SES{sesClient: mockClient} | ||
mockedSender := AWSMailSender{ | ||
"[email protected]", | ||
"from-alias", | ||
mockedSES, | ||
mockedRateLimiter, | ||
} | ||
|
@@ -100,6 +103,7 @@ func TestSend_LimitExceeded(t *testing.T) { | |
|
||
func TestSendAppendsFromAndTo(t *testing.T) { | ||
from := "[email protected]" | ||
fromAlias := "RHACS Cloud Service" | ||
to := []string{"[email protected]", "[email protected]"} | ||
textBody := "text body" | ||
tenantID := "test-tenant-id" | ||
|
@@ -126,6 +130,7 @@ func TestSendAppendsFromAndTo(t *testing.T) { | |
mockedSES := &SES{sesClient: mockClient} | ||
sender := AWSMailSender{ | ||
from, | ||
fromAlias, | ||
mockedSES, | ||
mockedRateLimiter, | ||
} | ||
|