fxa/packages/fxa-support-panel
Vijay Budhram c651574626
Release 1.247.5
2022-12-16 15:18:49 -05:00
..
.vscode chore(multiple): update mocha wherever used 2022-06-28 09:03:42 -07:00
src task(support-panel): Adds tracing to support panel 2022-09-15 13:50:05 -07:00
test
views fix(fxa-auth-server) change user-facing 'verify' references to 'confirm' in emails 2022-08-10 15:40:13 -07:00
.nsprc
CHANGELOG.md Merge pull request #13572 from mozilla/FXA-5496-stop-generating-changelogs-in-our-release-script 2022-07-11 16:20:36 -07:00
README.md
nest-cli.json
package.json Release 1.247.5 2022-12-16 15:18:49 -05:00
pm2.config.js task(support-panel): Adds tracing to support panel 2022-09-15 13:50:05 -07:00
tsconfig.build.json
tsconfig.json

README.md

fxa-support-panel

The Firefox Accounts Support Panel is a small web service that is intended for use as an embedded iframe in the Zendesk Support UX. It's intended to show Subscription Support Agents relevant data about a users Firefox Account so that they may assist the users support request.

Software Architecture

The primary source of truth on FxA user data is the fxa-auth-server. That service is configured to use OAuth for user and service access to account data, and has write access to the user data. Since this view is intended purely for read-only access to user data for assisting a support agent, this service instead uses read-restricted mysql credentials.

Read-only access is enforced on the database by using a MySQL user restricted to the stored procedures needed to run the queries that fetch basic profile information.

Local Development

In order to make API calls, the support panel needs a shared secret bearer token with the auth server. This can be done by setting the corresponding environment variables for each server to match to the same string value:

  • fxa-support-panel: AUTH_SECRET_BEARER_TOKEN
  • fxa-auth-server: SUPPORT_PANEL_AUTH_SECRET_BEARER_TOKEN

Note: the default config for each server should already have this set up.

The support panel can be viewed locally by going to http://localhost:${port}/?uid=${uid}, where:

  • port is the port as defined in ./pm2.config.js
  • uid is a local FxA user ID

Testing

This package uses Jest to test its code. By default yarn test will test all files ending in .spec.ts.

Test commands:

# Test with coverage
yarn test:cov

# Test on file change
yarn test:watch