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

111 Коммитов

Автор SHA1 Сообщение Дата
Beatriz Rizental eddeb9a97e Release v1.118.0 (#165) 2018-08-09 14:55:55 -04:00
Beatriz Rizental c085cbb3f3 fix(ses): use updated rusoto version that sends message in body (#164) r=@vladikoff
Fixes https://github.com/mozilla/fxa-email-service/issues/139
2018-08-09 14:21:32 -04:00
Beatriz Rizental 501a59167c chore(queues): use mozlog and failure in queues process (#161) r=@vladikoff,@philbooth
Fixes #10
Fixes #99
Connects to #116

This was my first experience messing with the queues part of the service, I thought dealing with these issues first would make the experience smoother. I added the standard logging and error handling with the failure crate just like the rest of the lib.

Since our errors were very much centered around requests and rocket, we have some fields that don't really make sense for the queues process, like the http code, so let me know what you think about that and if the queues process should have a different error format. I also did another minor change to the errors: now the response JSON will return a number for code and errno, instead of a string.

For logging, I implemented an AppErrorFields so that we get better structured logs for our AppErrors. I used slog_scope to make it easier to have a global logger for the queues process, let me know what you think about that... In the README.md for that crate, they have some warnings about it not being the best idea all the time, but anyways, I thought it was neat and worked well for our case.

Finally, when I started working in the queues they were not really working due to parsing errors, you will see that I changed a little bit the SQS Notification struct, that was for parsing to work, also I created a notification-dev queue in the AWS Console, because it didn't exist yet, I think everything is working fine now.
2018-08-08 20:24:14 -04:00
Phil Booth 95acb7c99e
Merge pull request #160 from brizental/brizental/updates
chore(deps): update rocket, failure, rusoto and rust versions
r=philbooth
2018-08-08 19:02:09 +01:00
Beatriz Rizental 9854cc99a0 chore(deps): update rocket, failure, rusoto and rust versions 2018-08-08 09:43:34 -07:00
Beatriz Rizental e0a283915a chore(config): change aws region defaults for dev and prod (#154) r=@vladikoff,@philbooth
Fixes #153
2018-08-02 16:41:28 -04:00
Beatriz Rizental bed6a93f9d Release v1.117.0 (#152) 2018-08-01 13:42:20 -04:00
Beatriz Rizental 3e3d6cf72e chore(tests): add tests for request unicode handling (#151) r=@vladikoff,@philbooth
Fixes #9
2018-08-01 11:52:07 -04:00
Phil Booth 0e7957a878
Merge pull request #142 from mozilla/pb/enforce-default-provider
https://github.com/mozilla/fxa-email-service/pull/142
r=brizental,vladikoff
2018-07-30 08:04:05 +01:00
Phil Booth c115318dfa
refactor(settings): group provider-related settings together 2018-07-30 07:45:29 +01:00
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