• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

mozilla / blurts-server / #13312

pending completion
#13312

push

circleci

jswinarton
MNTOR-1385 Basic backend flow for Premium featureset

Add the backend elements necessary to run the basic Premium subscription flow.

Some important notes:

    This creates two new routes, /oauth/premium/upgrade and /oauth/premium/confirmed, which drive the flow. They are not real views but are responsible for redirects and validation.
    The whole feature is behind a feature flag. Set FXA_SUBSCRIPTION_ENABLED=1 in your .env to enable.

282 of 1774 branches covered (15.9%)

Branch coverage included in aggregate %.

22 of 22 new or added lines in 4 files covered. (100.0%)

959 of 4683 relevant lines covered (20.48%)

1.71 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/src/routes/index.js
1
/* This Source Code Form is subject to the terms of the Mozilla Public
2
 * License, v. 2.0. If a copy of the MPL was not distributed with this
3
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
4

5
import AppConstants from '../appConstants.js'
6
import express from 'express'
7
import url from 'node:url'
8

9
import adminRoutes from './admin.js'
10
import authRoutes from './auth.js'
11
import dockerFlowRoutes from './dockerflow.js'
12
import hibpApiRoutes from './api/v1/hibp.js'
13
import previewRoutes from './preview.js'
14
import userApiRoutes from './api/v1/user.js'
15
import userRoutes from './user.js'
16
import breachesRoutes from './breaches.js'
17
import breachDetailRoutes from './breachDetail.js'
18

19
import { dialog } from '../controllers/dialog.js'
20
import { landingPage } from '../controllers/landing.js'
21
import { exposureScanPage } from '../controllers/exposureScan.js'
22
import { requestBreachScan } from '../controllers/requestBreachScan.js'
23
import { notFoundPage } from '../controllers/notFound.js'
24
import { notFound } from '../middleware/error.js'
25
import { doubleCsrfProtection } from '../utils/csrf.js'
26

27
const router = express.Router()
×
28

29
router.get('/', landingPage)
×
30
router.get('/scan', exposureScanPage)
×
31
router.get('*/dialog/:name', dialog)
×
32

33
router.use('/admin', doubleCsrfProtection, adminRoutes)
×
34
router.use('/api/v1/hibp/', hibpApiRoutes)
×
35
router.use('/api/v1/scan', doubleCsrfProtection, requestBreachScan)
×
36
router.use('/api/v1/user/', doubleCsrfProtection, userApiRoutes)
×
37
router.use('/oauth', doubleCsrfProtection, authRoutes)
×
38
router.use('/user', doubleCsrfProtection, userRoutes)
×
39
router.use('/breaches', doubleCsrfProtection, breachesRoutes)
×
40
router.use('/breach-details', doubleCsrfProtection, breachDetailRoutes)
×
41
router.use('/', doubleCsrfProtection, dockerFlowRoutes)
×
42

43
// Do not make the non-auth previews available on prod
44
if (AppConstants.NODE_ENV !== 'production') {
×
45
  router.use('/preview', previewRoutes)
×
46
}
47

48
router.use(notFound)
×
49
router.use(notFoundPage)
×
50

51
export default router
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc