Skip to content

DAS-459 send emails with AWS SES #90

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

Merged
merged 2 commits into from
Mar 18, 2021
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.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,6 @@ You will also need to extend project build settings to include the new plug, ple
The following configuration parameters need to be provided as environment variables:

- `APPLICATION_SECRET` - application secret
- `MAILER_HOST` - mailer system host<sup>*</sup>
- `MAILER_PORT` - mailer system port<sup>*</sup>
- `MAILER_USER` - mailer system username<sup>*</sup>
- `MAILER_PASSWORD` - mailer system password<sup>*</sup>
- `MAILER_FROM` - email `From` field value<sup>*</sup>
- `HAT_USER` - username of the dedicated dataplug account on HATs
- `HAT_PASSWORD` - password of the dedicated dataplug account on HATs
Expand Down
19 changes: 9 additions & 10 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -55,22 +55,21 @@ val dataplug = project
Library.Play.Jwt.bouncyCastle,
Library.Play.Jwt.bouncyCastlePkix,
Library.Play.Jwt.nimbusDsJwt,
Library.Play.mailer,
Library.Play.mailerGuice,
Library.Play.playSlick,
Library.Play.Silhouette.cryptoJca,
Library.Play.Silhouette.passwordBcrypt,
Library.Play.Silhouette.persistence,
Library.Play.Silhouette.silhouette,
Library.Play.test,
Library.Play.typesafeConfigExtras,
Library.Play.Utils.playBootstrap,
Library.Play.ws,
Library.Specs2.core,
Library.Specs2.matcherExtra,
Library.Specs2.mock,
Library.Utils.apacheCommonLang,
Library.scalaGuice
Library.AwsV1.awsJavaSesSdk,
Library.scalaGuice,
Library.Play.test % Test,
Library.Specs2.core % Test,
Library.Specs2.matcherExtra % Test,
Library.Specs2.mock % Test
)
)
.enablePlugins(PlayScala, SbtWeb, SbtSassify)
Expand All @@ -90,7 +89,7 @@ lazy val dataplugFacebook = Project(id = "dataplug-facebook", base = file("datap
.settings(buildSettings)
.enablePlugins(AshScriptPlugin)
.settings(packageSettings)
.dependsOn(dataplug)
.dependsOn(dataplug % "test->test;compile->compile")

lazy val dataplugTwitter = Project(id = "dataplug-twitter", base = file("dataplug-twitter"))
.enablePlugins(BasicSettings)
Expand All @@ -114,7 +113,7 @@ lazy val dataplugGcalendar = Project(id = "dataplug-gcalendar", base = file("dat
.settings(buildSettings)
.enablePlugins(AshScriptPlugin)
.settings(packageSettings)
.dependsOn(dataplug)
.dependsOn(dataplug % "test->test;compile->compile")

lazy val dataplugMonzo = Project(id = "dataplug-monzo", base = file("dataplug-monzo"))
.enablePlugins(BasicSettings)
Expand Down Expand Up @@ -175,7 +174,7 @@ lazy val dataplugInstagram = Project(id = "dataplug-instagram", base = file("dat
.settings(buildSettings)
.enablePlugins(AshScriptPlugin)
.settings(packageSettings)
.dependsOn(dataplug)
.dependsOn(dataplug % "test->test;compile->compile")

lazy val dataplugUber = Project(id = "dataplug-uber", base = file("dataplug-uber"))
.enablePlugins(BasicSettings)
Expand Down
12 changes: 0 additions & 12 deletions dataplug-facebook/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ play {
}
}

play.mailer {
host = ${?MAILER_HOST}
port = ${?MAILER_PORT}
user = ${?MAILER_USER}
password = ${?MAILER_PASSWORD}
ssl = false
tls = true
mock = false
from = "[email protected]"
from = ${?MAILER_FROM}
}

auth.allowedResources = ["https://facebook.dataswift.io", "https://facebook.dataswift.dev", "https://facebook.hubofallthings.net", "https://facebook.hubat.net", "https://dataplug:9443.hat.org"]

hat.secure = true
Expand Down
2 changes: 1 addition & 1 deletion dataplug-facebook/conf/application.dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,6 @@ service.scheme = "https://"
service.address = "dataplug.hat.org:9443"
service.secure = true

play.mailer.mock = true
mailer.mock = true

include "silhouette.staging.conf"
12 changes: 0 additions & 12 deletions dataplug-facebook/conf/application.staging.conf
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,6 @@ play {
}
}

play.mailer {
host = ${?MAILER_HOST}
port = ${?MAILER_PORT}
user = ${?MAILER_USER}
password = ${?MAILER_PASSWORD}
ssl = false
tls = true
mock = false
from = "[email protected]"
from = ${?MAILER_FROM}
}

auth.allowedResources = ["https://facebook.dataswift.io", "https://facebook.dataswift.dev", "https://facebook.hubofallthings.net", "https://facebook.hubat.net", "https://dataplug:9443.hat.org"]

hat.secure = true
Expand Down

This file was deleted.

This file was deleted.

12 changes: 0 additions & 12 deletions dataplug-fitbit/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ play {
}
}

play.mailer {
host = ${?MAILER_HOST}
port = ${?MAILER_PORT}
user = ${?MAILER_USER}
password = ${?MAILER_PASSWORD}
ssl = false
tls = true
mock = false
from = "[email protected]"
from = ${?MAILER_FROM}
}

auth.allowedResources = ["https://fitbit.dataswift.io", "https://fitbit.dataswift.dev", "https://fitbit.hubofallthings.net", "https://fitbit.hubat.net", "http://dataplug.hat.org"]

hat.secure = true
Expand Down
2 changes: 1 addition & 1 deletion dataplug-fitbit/conf/application.dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,4 @@ service.scheme = "http://"
service.address = "dataplug.hat.org:9000"
service.secure = false

play.mailer.mock = true
mailer.mock = true
12 changes: 0 additions & 12 deletions dataplug-gcalendar/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,6 @@ play {
}
}

play.mailer {
host = ${?MAILER_HOST}
port = ${?MAILER_PORT}
user = ${?MAILER_USER}
password = ${?MAILER_PASSWORD}
ssl = false
tls = true
mock = false
from = "[email protected]"
from = ${?MAILER_FROM}
}

auth.allowedResources = ["https://google-calendar.dataswift.io", "https://google-calendar.dataswift.dev", "https://google-calendar.hubofallthings.net", "https://dataplug.hat.org:9443", "https://google-calendar.hubat.net"]

hat.secure = true
Expand Down
2 changes: 1 addition & 1 deletion dataplug-gcalendar/conf/application.dev.conf
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ service.secure = true
service.name = "google-calendar-dev"
service.name = ${?TOKEN_APP_NAME}

play.mailer.mock = true
mailer.mock = true
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@
package com.hubofallthings.dataplugCalendar

import akka.util.Timeout
import com.hubofallthings.dataplug.apiInterfaces.models.{DataPlugFetchContinuation, DataPlugFetchNextSync}
import com.hubofallthings.dataplug.apiInterfaces.models.{ DataPlugFetchContinuation, DataPlugFetchNextSync }
import com.hubofallthings.dataplug.models.User
import com.hubofallthings.dataplug.services.UserService
import com.hubofallthings.dataplug.testkit.{DataPlugEndpointInterfaceTestHelper, TestModule}
import com.hubofallthings.dataplug.testkit.{ DataPlugEndpointInterfaceTestHelper, TestModule }
import com.hubofallthings.dataplugCalendar.apiInterfaces.GoogleCalendarEventsInterface
import com.mohiva.play.silhouette.api.LoginInfo
import com.mohiva.play.silhouette.api.repositories.AuthInfoRepository
Expand All @@ -23,9 +23,8 @@ import org.specs2.specification.BeforeAfterAll
import play.api.inject._
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.libs.ws.WSClient
import play.api.{Configuration, Logger}
import play.api.{ Configuration, Logger }

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._

class GoogleCalendarEventsInterfaceSpec(implicit val ee: ExecutionEnv) extends Specification with DataPlugEndpointInterfaceTestHelper with BeforeAfterAll {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,18 +18,20 @@ import com.mohiva.play.silhouette.impl.providers.OAuth2Info
import org.specs2.concurrent.ExecutionEnv
import org.specs2.mutable.Specification
import org.specs2.specification.BeforeAfterAll
import play.api.{Configuration, Logger}
import play.api.{Configuration, Environment, Logger}
import play.api.inject._
import play.api.inject.guice.GuiceApplicationBuilder
import play.api.libs.ws.WSClient

import scala.concurrent.ExecutionContext.Implicits.global
import scala.concurrent.duration._

class GoogleCalendarListSpec(implicit val ee: ExecutionEnv) extends Specification with DataPlugEndpointInterfaceTestHelper with BeforeAfterAll {

val injector = new GuiceApplicationBuilder()
.loadConfig(env => Configuration.load(env))
.loadConfig { env =>
println(env)
Configuration.load(env)
}
.overrides(new TestModule)
.overrides(bind[WSClient].toInstance(client))
.build
Expand Down
2 changes: 2 additions & 0 deletions dataplug-gcalendar/test/resources/application.test.conf
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ silhouette {
authenticator.cookie.signer.key = "[changeme]" // A unique encryption key
authenticator.crypter.key = "[changeme]" // A unique encryption key

csrfStateItemHandler.signer.key = csrfkey

# OAuth1 token secret provider settings
oauth1TokenSecretProvider.cookieName = "OAuth1TokenSecret"
oauth1TokenSecretProvider.cookiePath = "/"
Expand Down
12 changes: 0 additions & 12 deletions dataplug-instagram/conf/application.conf
Original file line number Diff line number Diff line change
Expand Up @@ -20,18 +20,6 @@ play {
}
}

play.mailer {
host = ${?MAILER_HOST}
port = ${?MAILER_PORT}
user = ${?MAILER_USER}
password = ${?MAILER_PASSWORD}
ssl = false
tls = true
mock = false
from = "[email protected]"
from = ${?MAILER_FROM}
}

auth.allowedResources = ["https://instagram.dataswift.io", "https://instagram.dataswift.dev", "https://instagram.hubofallthings.net", "https://instagram.hubat.net", "http://dataplug.hat.org", "https://dataplug.hat.org"]

hat.secure = true
Expand Down
Loading