Граф коммитов

251 Коммитов

Автор SHA1 Сообщение Дата
Phil Booth ca4b201156
feat(settings): enable the default provider to override requests
Over in https://github.com/mozilla/fxa-auth-server/pull/2535, work is
being done to enable the auth server to specify the provider for
specific requests. This causes a problem in fxa-local-dev, because we
always want to use the local smtp provider there.

As a hackish approach to resolving that conflict, this change introduces
a new boolean setting called `forceprovider`. If `forceprovider` is
`true`, the default provider may not be overridden by individual
requests.
2018-07-30 07:45:25 +01:00
Beatriz Rizental 1db8d44909 feat(settings): add secret_key to settings (#147) r=@vladikoff
Fixes #146

When I changed to use Rocket::custom instead of Rocket.toml for creating configuration, I forgot about ROCKET_SECRET_KEY.

It's good to note that, because we are using Rocket::custom none of the ROCKET_ env vars will work, so if ever we need to set any of the fields in config, we need to add to our config and to our rocket config builder function.

These are the possible fields in rocket config: https://api.rocket.rs/rocket/config/struct.ConfigBuilder.html#fields
2018-07-27 15:35:05 -04:00
Beatriz Rizental f35e1298c8 chore(providers): lock socketlabs to a crates.io version (#149) 2018-07-27 14:27:02 -04:00
Vlad Filippov 9cec32c61a
chore(docs): improve release doc (#144) 2018-07-26 00:35:51 -04:00
Vlad Filippov cfdb2583e7
Release v1.116.3 (#143) 2018-07-25 21:06:11 -04:00
Beatriz Rizental ff07bb9cc6 refactor(settings): drop NODE_ENV and add LOG_LEVEL (#141) r=@vladikoff
Fixes #138
Connects to #139
2018-07-25 20:50:32 -04:00
Beatriz Rizental 13cd22139f feat(providers): create socketlabs provider
https://github.com/mozilla/fxa-email-service/pull/140
r=philbooth
2018-07-25 23:24:09 +01:00
Vlad Filippov 1dd223a017
Release v1.116.2 (#137) 2018-07-19 10:19:07 -04:00
John Morrison b915b7e8d3 fix(docker): Rocket.toml no longer exists, so don't copy it (#136) 2018-07-18 22:47:34 -04:00
Vlad Filippov 09a8c5df1d
Release v1.116.1 (#135) 2018-07-18 12:43:58 -04:00
Beatriz Rizental b69cfb5365 feat(project): create healthcheck endpoints and make $PORT an env variable (#134) r=@philbooth,@vladikoff
Fixes #132
Fixes #133
2018-07-18 12:37:30 -04:00
Beatriz Rizental 7159ca30ab chore(tests): add tests for ses provider and mime message building
https://github.com/mozilla/fxa-email-service/pull/128
r=vladikoff,philbooth
2018-07-16 20:13:26 +01:00
Phil Booth 7512acf0b8 fix(deploy): pin to a known compatible rust version in docker and ci (#131) r=@vladikoff
Fixes #130.

We don't want the regular cycle of conflicts between Rust nightlies and (usually) rocket codegen to affect us in prod. And, funnily enough, the version that I first tried pinning to contains one of those of conflicts, so good reminder there. (nightly 2018-07-15 works with Rocket 0.3.15, but we're pinned to a specific commit on master for now)
2018-07-16 08:53:44 -04:00
John Morrison 16f7630f81 fix(docker): include /app/version.json in final image (dockerflow required) (#129) 2018-07-14 08:04:30 -04:00
vladikoff e12daf876a Release v1.116.0 2018-07-12 13:23:08 -04:00
Beatriz Rizental 825e399333 feat(logging): turn off rocket logs for production (#125) r=@vladikoff
Fixes #111

In order to do this I had to point our rocket version to the Rocket repo and that introduced some breaking changes which I also fixed in this PR. Mostly they were variable name changes
2018-07-12 12:46:14 -04:00
Beatriz Rizental 019f6b7153 chore(config): make smtp provider the default for dev env
https://github.com/mozilla/fxa-email-service/pull/126
r=philbooth
2018-07-12 07:25:59 +01:00
Beatriz Rizental 20b7fc08ee feat(providers): implement smtp provider
https://github.com/mozilla/fxa-email-service/pull/122
r=philbooth
2018-07-11 07:07:50 +01:00
Phil Booth 2102e32c75
refactor(types): extract the EmailAddress type to its own module
https://github.com/mozilla/fxa-email-service/pull/120
r=shane-tomlinson,brizental
2018-07-06 17:53:36 +01:00
Phil Booth ba9f8b88e2
fix(docs): better docs for the settings module
https://github.com/mozilla/fxa-email-service/pull/121
r=shane-tomlinson,brizental
2018-07-06 17:52:26 +01:00
Beatriz Rizental d54b46ab69 refactor(settings): refactor settings properties to types
https://github.com/mozilla/fxa-email-service/pull/114
r=philbooth,vladikoff
2018-07-06 05:43:05 +01:00
Phil Booth e6e3350cbc fix(scripts): don't try to deploy docs if they haven't changed 2018-07-05 08:17:35 +01:00
Phil Booth 8e48f36ead
fix(scripts): stop gh-pages script from failing for pull requests
https://github.com/mozilla/fxa-email-service/pull/118
r=vladikoff
2018-07-04 23:32:25 +01:00
Phil Booth b47e2f9d4a chore(docs): automatically publish rustdoc output to github pages 2018-07-04 23:01:46 +01:00
Phil Booth f2edb78c79 feat(docs): generate developer docs with rustdoc 2018-07-04 20:53:21 +01:00
Phil Booth fb56a2090b fix(scripts): update references to bin names with `fxa-email-` prefix 2018-07-03 15:43:51 +01:00
Beatriz Rizental 90bec93fc6 fix(settings): get message data hmac key setting to work with env variables (#110) r=@philbooth,@vladikoff
Fixes #109
2018-06-28 14:56:13 -04:00
Vlad Filippov 05f93b9da5
feat(docker): copy Rocket.toml in the docker image (#107) r=@brizental
Fixes #106
2018-06-27 16:27:14 -04:00
Vlad Filippov b3e3ac298a
feat(docker): set ROCKET_ENV to prod (#105) r=@brizental 2018-06-27 16:07:57 -04:00
Beatriz Rizental c2c7e1372a chore(settings): prepare prod and stage configs for deployment (#104) r=@vladikoff
Fixes #100
Fixes #24

As mentioned in #24 we still need to see about ROCKET_WORKERS.

Also, in production, rocket sends a warning about not having set a secret_key, but I decided to leave it without anything for now. Anyways that would be something that probably we wouldn't "hard code" here.
2018-06-27 13:57:41 -04:00
Beatriz Rizental 199cd82570 feat(logging): add null logger for testing environment (#102) r=@philbooth,@vladikoff
Fixes #82

When we are in a testing environment (which means when NODE_ENV=test) the logger won't show anything.

So now, instead of having mozlog:true | false in the config, we have logging: null | pretty | mozlog.
2018-06-27 12:02:15 -04:00
Vlad Filippov fe5cae057c
Release v1.115.0 (#103) 2018-06-27 11:07:48 -04:00
Vlad Filippov 45c8247532
chore(ci): add circle ci badge (#101) r=@brizental 2018-06-26 18:18:42 -04:00
Vlad Filippov 0e172a9c48
Setup Circle CI to create docker images (#87) r=@jrgm
Fixes #47
2018-06-26 17:50:40 -04:00
Beatriz Rizental 1797317231 refactor(errors): use failure crate to handle errors (#94) r=@vladikoff,@pjenvey
Fixes #48
Fixes #77 

I had to change basically everything since my last PR (#85) about this, so I thought it would be best to just create a new PR.

To get the failure errors working I needed to get at least providers, bounces and db to also work with the failure errors, not just the Rocket and HTTP errors. That's what I'm doing in this PR. Since this is kind of a big change, I thought it would be best to send this in before adapting the tests to the new error type, so, right now, many tests are commented.

Let me know what you guys think. If you think this is a good change I still would need to adapt all tests and also there are some error types specially for the queues bin that need to be changed as well.

I personally think this is a good change. It is abstracting all the errors to one single place in the code. While working on this refactoring, I saw a bunch of repeated code for error handling. This ends that, which means it will be easier to maintain and create new error types with this way of doing things. Also, we are now getting much more information about each error, not just the HTTP status and message and it's very easy to customize this even further.
2018-06-26 17:29:21 -04:00
Vlad Filippov 59280fac1d
refactor(bin): Make final binary names more verbose (#96) r=@philbooth
Fixes #93
2018-06-25 11:26:52 -04:00
Phil Booth 8f91388d19 chore(project): update rocket to work with latest nightly 2018-06-25 08:56:09 +01:00
Phil Booth 0cc089e93e fix(queues): use correct name when deserializing bouncedRecipients 2018-06-22 00:04:23 -04:00
Phil Booth 0a6c04328f fix(queues): accept partially-filled notifications from sendgrid 2018-06-22 00:04:23 -04:00
Phil Booth 1c21d6eca1 fix(queues): fix nonsensical parse logic for sqs notifications 2018-06-22 00:04:23 -04:00
Beatriz Rizental efb8f0d782 feat(providers): add custom headers option
https://github.com/mozilla/fxa-email-service/pull/89
r=vladikoff,philbooth
2018-06-21 19:30:11 +01:00
Beatriz Rizental 3ec3e039ed fix(validation): make email regex less restrictive (#86) r=@vladikoff,@rfk,@philbooth
Fixes #81

Inspired by: https://github.com/mozilla/fxa-content-server/blob/master/app/scripts/lib/validate.js#L30
Tested with: https://github.com/mozilla/fxa-content-server/blob/master/app/tests/spec/lib/validate.js#L18 and also https://blogs.msdn.microsoft.com/testing123/2009/02/06/email-address-test-cases/
2018-06-20 14:11:20 -04:00
Phil Booth 2aa1459d2e feat(metadata): send message metadata in outgoing notifications (#73) r=@vladikoff,@brizental
Depends on #72. Fixes #4.

Adds the ability to consume stored metadata from Redis and add it to the outgoing notification.
2018-06-20 13:41:08 -04:00
Phil Booth 98b738a9c6
feat(metadata): store caller-specific metadata with the message id
Stores a "metadata" string from the caller in Redis, keyed by a hash of
the message id. In practice the metadata is JSON in the auth server's
case, but this repo neither knows or cares about that. No functionality
is added here to read or clear the data from Redis, that's coming in a
separate changeset for the queues process.

The HMAC key for hashing the message id comes from config, obviously,
because it's secret. It has a very specific name at the moment, but we
should feel free to rename it to something more generic than that if we
have other data that we'd like to hash with it in the future.

https://github.com/mozilla/fxa-email-service/pull/72
r=vladikoff
2018-06-19 08:28:02 +01:00
Beatriz Rizental f4271b9e6b feat(logging): add mozlog to settings and scrub sensitive data (#74) r=@philbooth,@vladikoff
Fixes #18
Connects to #10
2018-06-18 12:09:35 -04:00
Phil Booth 723457c840 refactor(db): hide queues db access behind bounces interface (#80) r=@vladikoff,@brizental
Fixes #68.

We don't want to let knowledge about the auth db leak into any unrelated application logic, because it's both temporary and in possession of capabilities that this repo has no business knowing about.
2018-06-17 20:39:00 -04:00
Phil Booth 22bd45fd48
chore(project): unpin rust from nightly-2018-06-10 2018-06-17 07:09:17 +01:00
Phil Booth cecf4d3940 refactor(project): push core code into a common lib (#78)
Fixes #76
2018-06-14 09:18:14 -07:00
Beatriz Rizental 931ae45fc5 refactor(clippy): refactor job based on some clippy lints
Fixes #52 
https://github.com/mozilla/fxa-email-service/pull/71
r=philboth
2018-06-12 07:02:49 +01:00
Beatriz Rizental 3d5397aa7a refactor(service): remove smtp settings (#70) r=@vladikoff
Fixes #61 .

Not much to talk about here, just deleted the settings and adjusted the tests.

The Cargo.lock file was updated as well, I think that's because some of the crates were updated. Since we got >= in the cargo versions right now, I think when crates are updated we just grab the new versions on cargo build, thus updating the Cargo.lock file.
2018-06-11 09:24:04 -07:00