From 8ce686a024d45a4e3b5609dbeb201bf5afe44fb2 Mon Sep 17 00:00:00 2001 From: Ben Bangert Date: Thu, 21 Nov 2019 12:56:31 -0800 Subject: [PATCH] fix(event-broker): allow userAgent to be empty Because: * The docs don't match actual login messages we emit. * Event-broker required a userAgent string in the login message. This commit: * Updates the docs to reflect the optional nature of the userAgent. * Changes the event-broker login messge schema to make the userAgent optional. Closes #3421 --- packages/fxa-auth-server/docs/service_notifications.md | 2 +- packages/fxa-event-broker/lib/serviceNotifications.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/fxa-auth-server/docs/service_notifications.md b/packages/fxa-auth-server/docs/service_notifications.md index 752efad1ce..b18682742e 100644 --- a/packages/fxa-auth-server/docs/service_notifications.md +++ b/packages/fxa-auth-server/docs/service_notifications.md @@ -83,7 +83,7 @@ Message Properties: - `uid`: The userid of the account being that was used to log in. - `email`: The primary email address of the account. - `deviceCount`: The number of active sessions on the user's account. -- `userAgent`: The user-agent header sent by the user on their login request. +- `userAgent`: Optional,the user-agent header sent by the user on their login request. This event is currently consumed by the email marketing team in order to manage sync-setup-related email campaigns. diff --git a/packages/fxa-event-broker/lib/serviceNotifications.ts b/packages/fxa-event-broker/lib/serviceNotifications.ts index 06c326bf09..ad54c2be59 100644 --- a/packages/fxa-event-broker/lib/serviceNotifications.ts +++ b/packages/fxa-event-broker/lib/serviceNotifications.ts @@ -37,7 +37,7 @@ const LOGIN_SCHEMA = joi timestamp: joi.number().optional(), ts: joi.number().required(), uid: joi.string().required(), - userAgent: joi.string().required() + userAgent: joi.string().optional() }) .unknown(true) .required();