fxa/packages/123done
Ben Bangert 58f184f306
fix(backstage): update db references, add gql API ref
[skip ci]

Because:

* We want to properly name cache vs. databases.
* We want to add the GraphQL API to the list of services.

This commit:

* Renames the database resources to cache resources.
* Adds the GraphQL API to the list of services.
2024-01-26 08:41:53 -08:00
..
ansible refactor(config): replace 127.0.0.1 with localhost 2020-04-15 13:55:42 -07:00
scripts Display a 🔒 icon for users who signed in with 2FA mozilla/123done#165) r=@vladikoff 2018-04-16 16:08:55 -04:00
static fix(functional-tests): Fix flow metrics errors in Playwright tests 2023-06-06 11:01:54 -04:00
.eslintrc.json chore(lint): Fix 123done ESLint config 2022-07-13 10:39:39 -07:00
.nsprc chore(deps): Updates to address nsp advisory 1179 2020-03-19 10:42:24 -07:00
.prettierignore refactor(packages): use workspace references 2020-05-21 10:57:21 -07:00
Procfile feat(heroku): adds support for heroku and 123done 2021-05-04 16:47:46 -04:00
README.md chore(deps): Specify 123Done client secret from a secrets.json file 2023-11-06 15:50:05 -05:00
backstage.yaml fix(backstage): update db references, add gql API ref 2024-01-26 08:41:53 -08:00
config-local-untrusted.json chore(deps): Specify 123Done client secret from a secrets.json file 2023-11-06 15:50:05 -05:00
config-local.json chore(deps): Specify 123Done client secret from a secrets.json file 2023-11-06 15:50:05 -05:00
config-stage-untrusted.json feat(heroku): adds support for heroku and 123done 2021-05-04 16:47:46 -04:00
config.js chore(deps): Specify 123Done client secret from a secrets.json file 2023-11-06 15:50:05 -05:00
config.json chore(deps): Specify 123Done client secret from a secrets.json file 2023-11-06 15:50:05 -05:00
oauth.js feat(oauth): Add support for `prompt=login` and return the `auth_time` in id token 2022-11-17 13:26:19 -05:00
package.json task(CI): Improve nx caching for CI pipelines 2023-08-29 11:19:54 -07:00
pm2.config.js chore(deps): upgrade to node.js 18 2023-03-20 13:28:10 -05:00
server.js task(ci): Remove redis dev password from source 2023-11-03 14:24:07 -07:00
version.js feat(123done): add version route 2020-09-08 11:44:54 -04:00

README.md

A demo of Firefox Accounts OAuth

Running locally

  1. Complete prerequisites for running FxA
  2. Create a secrets.json file in 123done root folder and specify the client_secret value.
  3. Run the server: yarn start
  4. Visit it in your browser: http://localhost:8080/
  5. Hack and reload! (web resources don't require a server restart)

Ansible Deployment

See fxa-dev 123done Ansible configuration for details.

Heroku Deployment

Before you begin

  • This process is to deploy an existing FxA-integrated Heroku application. Separate steps are required to create a new Heroku app integrated with FxA, including updating the client URL redirect values in the FxA OAuth database.
  • Unless your tests require the untrusted 123Done app, you may just need to deploy the 123Done trusted app to stage and prod (i.e. deploy two instead of all four apps).

Instructions

  1. Sign up for Heroku at https://sso.heroku.com/login
  1. Install heroku cli and login
  • heroku login
  1. Ensure access to 123Done apps
  • Search for and have a mozillacorporation member grant access (view, deploy, operate, manage) to following apps:
    • production-123done
    • production-123done-untrusted
    • stage-123done
    • stage-123done-untrusted
  • You'll get an invitation email for each app.
  • Why are there four apps?
    • There is a trusted and an untrusted OAuth RP app for each environment to test trusted and untrusted OAuth flows.
  1. Clone each app on the command line that you need to deploy with the provided instructions in the invitation email.
  • E.g. heroku git:clone -a stage-123done
  • Note: While app config for stage is in the 123Done package in our FxA monorepo, prod config is in environment variables in the Heroku dashboard to avoid exposing the OAuth client secret.
  1. Deploy app
  • In the fxa repo, checkout branch origin/heroku-updates and create and checkout a local branch of the same name.
    • This branch contains different root level package.json commands and/or (dev)dependencies that reduce the size of the Heroku deploy slug. There are limits to the size that can be deployed.
    • The main differences are the install run script and to avoid the check-package-manager.sh script, since the command uses npm instead of yarn.
      • Note: Heroku is compatible with yarn, but at the time of writing, only npm worked correctly.
  • Rebase train-XXX branch
    • git rebase origin/train-XXX
      • XXX is the train for the environment you want to deploy in.
  • Create a remote for your local repository for each app you want to deploy.
    • E.g. heroku git:remote -a stage-123done
  • Deploy
    • git push <heroku remote origin> heroku-updates:main -f
      • Force push is needed here because of the commit with changes to package.json
      • <heroku remote origin> is the git remote linked to the version of the heroku app you're deploying, i.e. stage/production and trusted/untrusted.
      • N.B. There may have been breaking changes to the fxa root package.json since the last 123Done deploy. Confer with the team, but if needed, the root package.json can be modified and the last commit amended. Then retry the command.
  1. Push changes to back to FxA repo
  • git push origin heroku-updates -f

Testing

This package does not currently have a test suite.

Run npm test to lint the code.