Files
notifications-admin/package.json

74 lines
2.1 KiB
JSON
Raw Normal View History

{
"name": "notifications-admin",
"version": "0.0.1",
2022-11-29 08:55:22 -05:00
"description": "Admin front end for Notify",
"engines": {
"node": ">=10.15.3"
},
"scripts": {
2022-10-27 11:10:13 -04:00
"lint": "gulp lint",
"test": "jest --config tests/javascripts/jest.config.js tests/javascripts",
"test-watch": "jest --watch --config tests/javascripts/jest.config.js tests/javascripts",
"build": "gulp",
"watch": "gulp watch",
"audit": "better-npm-audit audit --production --level low",
"pa11y-ci": "pa11y-ci"
},
"repository": {
"type": "git",
2022-11-29 08:55:22 -05:00
"url": "git+https://github.com/GSA/notifications-admin.git"
},
2022-11-29 08:55:22 -05:00
"author": "General Services Administration",
"license": "CC0",
"homepage": "https://github.com/GSA/notifications-admin#readme",
2024-06-17 14:27:59 -07:00
"overrides": {
2024-06-17 14:36:06 -07:00
"graceful-fs": "^4.2.11"
2024-06-17 14:27:59 -07:00
},
"dependencies": {
"@rollup/plugin-commonjs": "^28.0.3",
"@rollup/plugin-node-resolve": "^16.0.1",
2024-08-08 14:32:33 -06:00
"@rollup/stream": "^3.0.1",
"@uswds/uswds": "^3.13.0",
Support registering a new authenticator This adds Yubico's FIDO2 library and two APIs for working with the "navigator.credentials.create()" function in JavaScript. The GET API uses the library to generate options for the "create()" function, and the POST API decodes and verifies the resulting credential. While the options and response are dict-like, CBOR is necessary to encode some of the byte-level values, which can't be represented in JSON. Much of the code here is based on the Yubico library example [1][2]. Implementation notes: - There are definitely better ways to alert the user about failure, but window.alert() will do for the time being. Using location.reload() is also a bit jarring if the page scrolls, but not a major issue. - Ideally we would use window.fetch() to do AJAX calls, but we don't have a polyfill for this, and we use $.ajax() elsewhere [3]. We need to do a few weird tricks [6] to stop jQuery trashing the data. - The FIDO2 server doesn't serve web requests; it's just a "server" in the sense of WebAuthn terminology. It lives in its own module, since it needs to be initialised with the app / config. - $.ajax returns a promise-like object. Although we've used ".fail()" elsewhere [3], I couldn't find a stub object that supports it, so I've gone for ".catch()", and used a Promise stub object in tests. - WebAuthn only works over HTTPS, but there's an exception for "localhost" [4]. However, the library is a bit too strict [5], so we have to disable origin verification to avoid needing HTTPS for dev work. [1]: https://github.com/Yubico/python-fido2/blob/c42d9628a4f33d20c4401096fa8d3fc466d5b77f/examples/server/server.py [2]: https://github.com/Yubico/python-fido2/blob/c42d9628a4f33d20c4401096fa8d3fc466d5b77f/examples/server/static/register.html [3]: https://github.com/alphagov/notifications-admin/blob/91453d36395b7a0cf2998dfb8a5f52cc9e96640f/app/assets/javascripts/updateContent.js#L33 [4]: https://stackoverflow.com/questions/55971593/navigator-credentials-is-null-on-local-server [5]: https://github.com/Yubico/python-fido2/blob/c42d9628a4f33d20c4401096fa8d3fc466d5b77f/fido2/rpid.py#L69 [6]: https://stackoverflow.com/questions/12394622/does-jquery-ajax-or-load-allow-for-responsetype-arraybuffer
2021-05-07 18:10:07 +01:00
"cbor-js": "0.1.0",
2024-08-09 10:48:39 -06:00
"d3": "^7.9.0",
2024-07-03 13:48:03 -06:00
"govuk_frontend_toolkit": "^9.0.1",
"govuk-frontend": "2.13.0",
2024-08-08 14:01:05 -06:00
"gulp-merge": "^0.1.1",
Add a page to manage a service’s whitelist Services who are in alpha or building prototypes need a way of sending to any email address or phone number without having to sign the MOU. This commit adds a page where they can whitelist up to 5 email addresses and 5 phone numbers. It uses the ‘list entry’ UI pattern from the Digital Marketplace frontend toolkit [1] [2] [3]. I had to do some modification: - of the Javascript, to make it work with the GOV.UK Module pattern - of the template to make it work with WTForms - of the content security policy, because the list entry pattern uses Hogan[1], which needs to use `eval()` (this should be fine if we’re only allowing it for scripts that we serve) - of our SASS lint config, to allow browser-targeting mixins to come after normal rules (so that they can override them) This commit also adds a new form class to validate and populate the two whitelists. The validation is fairly rudimentary at the moment, and doesn’t highlight which item in the list has the error, but it’s probably good enough. The list can only be updated all-at-once, this is how it’s possible to remove items from the list without having to make multiple `POST` requests. 1. https://github.com/alphagov/digitalmarketplace-frontend-toolkit/blob/434ad307913651ecb041ab94bdee748ebe066d1a/toolkit/templates/forms/list-entry.html 2. https://github.com/alphagov/digitalmarketplace-frontend-toolkit/blob/434ad307913651ecb041ab94bdee748ebe066d1a/toolkit/scss/forms/_list-entry.scss 3. https://github.com/alphagov/digitalmarketplace-frontend-toolkit/blob/434ad307913651ecb041ab94bdee748ebe066d1a/toolkit/javascripts/list-entry.js 4. http://twitter.github.io/hogan.js/
2016-09-20 12:30:00 +01:00
"hogan": "1.0.2",
2024-06-17 13:55:25 -07:00
"jquery": "3.7.1",
"morphdom": "^2.7.5",
"playwright": "^1.53.0",
2023-04-24 14:57:35 -04:00
"python": "^0.0.4",
"query-command-supported": "1.0.0",
"sass-embedded": "^1.89.2",
2025-04-09 17:11:09 -07:00
"socket.io-client": "^4.8.1",
"textarea-caret": "3.1.0",
2024-08-08 14:32:33 -06:00
"vinyl-buffer": "^1.0.1",
"vinyl-source-stream": "^2.0.0"
},
"devDependencies": {
"@babel/core": "^7.27.4",
"@babel/preset-env": "^7.27.2",
"@uswds/compile": "^1.3.1",
2024-09-18 13:59:16 -04:00
"backstopjs": "^6.3.25",
"better-npm-audit": "^3.11.0",
"gulp": "^5.0.1",
2024-06-17 14:36:06 -07:00
"gulp-add-src": "^1.0.0",
"gulp-babel": "8.0.0",
"gulp-clean-css": "4.3.0",
2024-08-08 14:01:05 -06:00
"gulp-concat": "^2.6.1",
"gulp-include": "2.4.1",
"gulp-jshint": "2.1.0",
"gulp-prettyerror": "2.0.0",
"gulp-uglify": "3.0.2",
"jest": "^30.0.0",
"jest-each": "^30.0.0",
"jest-environment-jsdom": "^29.2.2",
2024-06-18 07:49:20 -07:00
"jshint": "2.13.6",
"jshint-stylish": "2.2.1",
"rollup": "^4.43.0",
"rollup-plugin-commonjs": "10.1.0",
2024-08-08 13:58:33 -06:00
"rollup-plugin-node-resolve": "5.2.0"
}
}