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

231 Коммитов

Автор SHA1 Сообщение Дата
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
Phil Booth 02965a0b42 chore(project): pin rust to nightly-2018-06-10 2018-06-11 07:41:29 +01:00
Beatriz Rizental 49ed73cd34 fix(logging): add mozlog logging for requests
https://github.com/mozilla/fxa-email-service/pull/65
r=philbooth
2018-06-11 07:02:10 +01:00
Beatriz Rizental 50f8d523a4 fix(config): inject config in rocket managed state
https://github.com/mozilla/fxa-email-service/pull/66
r=philbooth
2018-06-10 22:46:07 +01:00
Phil Booth 5986e841ce fix(bounces): ensure db errors don't get converted to 429 responses (#59) r=@vladikoff 2018-06-07 21:37:43 -07:00
Phil Booth 44dcffd364
chore(project): remove the validator dependency
https://github.com/mozilla/fxa-email-service/pull/60
r=vladikoff
2018-06-06 12:42:18 +01:00
Phil Booth 145df00ffc chore(project): limit futures to < 0.2 (#58) r=@vladikoff 2018-06-05 17:16:02 -04:00
Beatriz Rizental 2beab89458 chore(project): loosen dependencies version numbers
https://github.com/mozilla/fxa-email-service/pull/57
r=philbooth
2018-06-05 21:50:02 +01:00
Phil Booth 008f119137 fix(validation): relax the sendgrid API key validation regex (#55) r=@vbudhram,@vladikoff 2018-06-05 15:45:09 -04:00
JR Conlin 66f5d5c049 fix(validation): allow RFC5321 compliant email addresses
email address validation is a pain, and you can use a surprising variety
of characters in an address.

(At least we're drawing the line at no quoted characters...)

Closes #44

https://github.com/mozilla/fxa-email-service/pull/45
r=philbooth
2018-06-05 18:35:27 +01:00
Phil Booth 7427318aaf refactor(queues): simplify lifetimes for queue objects 2018-06-05 18:35:27 +01:00
Phil Booth 6c154a04f8 feat(queues): return futures instead of blocking for queue handling 2018-06-05 18:35:27 +01:00
Phil Booth 4b05fd3dc3 chore(queues): marshall SES notifications to our own generic type 2018-06-05 18:35:27 +01:00
Phil Booth 4338f24cbe feat(queues): handle SES bounce, complaint and delivery notifications
A direct mapping of functionality from the auth server, so the different
notification types are expected on three different queues. Long-term it
makes sense to simplify that down to a single queue, but this way we can
ease the new service in alongside the existing auth server.

As a first cut, the methods on queues::sqs::Queue all block the thread
in this implementation. A subsequent change will transition to futures.
2018-06-05 18:35:27 +01:00
Phil Booth f18a5bc60e
chore(code): eliminate some if-lets in favour of combinators
https://github.com/mozilla/fxa-email-service/pull/43
r=vladikoff
2018-06-05 13:23:01 +01:00
Phil Booth bc62a046d7 chore(project): delete errant src/queues/sendgrid/mod.rs
Accidentally added as part of fe8ec12 when I switched branches from the
in-progress Sengrid queue implementation and did `git add .`.
2018-06-05 09:51:23 +01:00
Phil Booth fe8ec12f55
fix(sendgrid): return message id from the sendgrid provider
https://github.com/mozilla/fxa-email-service/pull/37
r=rfk,shane-tomlinson
2018-06-05 09:15:40 +01:00
Phil Booth 82acb10ed6
chore(errors): don't serialize nulls in error payloads
https://github.com/mozilla/fxa-email-service/pull/39
r=shane-tomlinson
2018-06-04 12:34:33 +01:00
Phil Booth b5343d54b2
fix(errors): return JSON payloads for error responses
https://github.com/mozilla/fxa-email-service/pull/36
r=vbudhram
2018-06-01 18:25:11 +01:00
Phil Booth 1d5d100d20
chore(project): update rocket, unpin from nightly-2018-05-29 2018-06-01 10:24:13 +01:00
Phil Booth 25947a96d7
feat(sendgrid): implement basic sending via sendgrid
https://github.com/mozilla/fxa-email-service/pull/34
r=vbudhram
2018-05-31 17:31:14 +01:00