Граф коммитов

36 Коммитов

Автор SHA1 Сообщение Дата
Shane Tomlinson feb9510b15
chore(test): Make the `wrapAssertion` method easier to read.
Move the `done` inside the try block, remove teh `return` from the catch block.
2018-06-21 11:23:28 +01:00
Shane Tomlinson c9f4a65e23
fix(test): Fix the sign_up->afterVisible test
There were two problems, the first is that the assertion needed to be wrapped to ensure
failures were always surfaced. The second problem was TestHelpers.wrapAssertion would
call `done` twice if a test failed.

fixes #6290
2018-06-21 10:19:04 +01:00
Vlad Filippov a6d7a94550
refactor(deps): remove bower (#5915) r=@vbudhram 2018-02-15 15:52:17 -05:00
Shane Tomlinson 27c189d3d0
refactor(client): Replace p-promise with native promises (#5543) r=@vbudhram
Replace the p-promise library with native promises. The es6-promise polyfill
is used for browsers that do not support native promises.

BAM!
2017-11-29 19:22:48 +00:00
Vlad Filippov 240c2045ea refactor(tests): sinon 3 migration (#5429) r=@shane-tomlinson 2017-09-05 13:09:00 +01:00
Shane Tomlinson f1cbf2b272 refactor(metrics): Remove `viewToId` and helpers.testIsViewLogged (#5069) r=@philbooth
They were only used in one place and didn't provide much value.

Done while working on #5026
2017-05-17 16:52:43 +01:00
Divya Biyani f9006d4e00 feat(prefer-const): changes acc. to prefer-const eslint rule (#4710) r=vladikoff
Fixes #4632
2017-02-16 10:13:40 -05:00
Shane Tomlinson 18850e1c5b feat: signin unblock (#4154)
* feat(client): Sign in unblock.

r=@philbooth, @seanmonstar
2016-10-17 13:10:24 +01:00
Shane Tomlinson 5490a0bc70 refactor(client): `var`=>`const` for all requires (#4263)
r=@vbudhram
2016-10-10 15:16:03 +01:00
Shane Tomlinson a6c848cc9f fix(client): Hide all visible passwords on form submit. (#3969)
* fix(password): save passwords as passwords, not text
Fixes #3799

* fix(client): Hide all visible passwords on form submit.

This builds on @TDA's work.

Before the form is submit, convert all visible passwords from
[type=text] to [type=password] so that they are not saved as
form data.

In the process, I noticed two problems that are fixed:

* The cursor was not being correctly replaced to its original position
  once a password field was converted.
* If `setPasswordVisibility` was called programatically to toggle the
  state of the password field, the corresponding "Show" checkbox was
  not kept in sync.

fixes #3799

* chore(client): `wekbit` => `webkit`


r=@vladikoff
2016-07-25 19:30:29 +01:00
Shane Tomlinson f666c8b759 feat(client): Strict validation of email and uid on force_auth
fixes #3040
2016-04-01 12:17:43 +00:00
Shane Tomlinson d9e18eaaaa feat(client): joi like validation of query parameters
Use [VAT](https://github.com/shane_tomlinson/vat) to import,
transform, and validate query parameters in the reliers
and auth brokers.
2016-03-14 13:29:49 +00:00
Shane Tomlinson 041b9fa793 feat(client): Add support for `prompt=consent` for OAuth reliers.
fixes #3505
2016-02-23 16:51:46 +00:00
Shane Tomlinson 6a4c81a4f4 refactor(client): Convert `app` to the Simplified CommonJS wrapper.
I have only done the `app` directory because `use strict` is forbidden
in `tests` and I do not remember why. Before converting `tests`, I want
to find out whethere `use strict` is OK to use there or not.
2015-11-09 11:44:20 +00:00
Shane Tomlinson 30d1a2d069 chore(client): Standardize on `View`, replace `Screen`
fixes #3185
2015-10-21 13:43:49 +01:00
Shane Tomlinson 8067c62a9a feat(build): Object literals must be sorted alphabetically.
Add an es-lint plugin to enforce alphabetization on object literals.
Sort all of the object literals.
2015-09-28 12:00:58 +01:00
Shane Tomlinson 25971d172e fix(metrics): Ensure a screen's name is logged before any of it's events.
Screen names were only logged after their render function completed. If any
events were logged during render, those events would show up in the metrics
before the screen name, possibly causing confusion during manual metrics
analysis.

This updates to log the screen name before the render function is called.

fixes #2856
2015-07-30 12:53:31 +01:00
Sai Pc 558e5e6c78 chore(lint): remove jshint
Fixes #2582
Remove the evil JSHint from our code
All hail ESLint
Fixed README.md and CONTRIBUTING.md to remove JSHint and add ESLint
Fixed camelcase errors due to removing JSHint inline
2015-06-24 13:34:44 -07:00
Vlad Filippov faa0a02d45 fix(build): revert use script and force it to use function mode 2015-06-18 00:17:17 -04:00
Sai Pc 1e02332878 chore(lint): switch from JSHint to ESLint
Fixes #2550
Switch from JSHint to ESLint
Add rules to ESLint
Also have JSHint in parallel
Remove old dependencies reported by amdcheck
Remove unused variables reported by ESLint
2015-06-12 14:06:52 -07:00
Zachary Carter 382c9db980 fix(avatars): load profile image on settings and sign in pages if available
Fixes #1727.
2014-11-14 15:37:49 -08:00
vladikoff c5abfe423a chore(style): JSHint updates 2014-10-06 00:29:48 -04:00
vladikoff 4892bd3635 Remove grunt-blanket-mocha 2014-09-23 11:42:49 -04:00
Shane Tomlinson 9ecf71bb51 feat(metrics): Log `entrypoint` to the metrics.
* Add the FxDesktopRelier that imports `entrypoint` and `context` from the URL.
* Relier extended to import `service`, `redirectTo`, `client_id`, and `state`
* Initialize either the FxDesktopRelier or normal Relier on startup.
* Instead of Metrics importing values directly from the URL, they are fetched from the Relier and passed in on creation.

fixes #1568
2014-09-16 11:00:22 +01:00
Shane Tomlinson e81aa06428 chore(metrics): Namespace errors for metrics logging and other error logging updates.
@kparlante asked for us to add a bit of context, like a screen name, to errors so that it is easier to decide where an error originated. This led down a bit of a rabbit hole of cleaning up the error code.

* The different error types overlap in their errno's, this adds a namespace so that different errors are able to be selected from the metrics logs.

Namespaces used:
* auth-errors.js: 'auth'
* oauth-errors.js: 'oauth'
* profile-client.js: 'profile'

* The `message` field of auth-errors.js.toError was never used, so this is repuprosed to pass in a `context`.
* The format of an error event has changed to accommodate a context: 'error.<context>.<namespace>.<errno>
* When a view's `logError` function is called, the screen name is set as the error's context.
* base.js called metrics.js to fetch ids for screens and errors, then called metrics.js->logEvent. Updated to just call `logError` and `logScreen`
* A couple of TestHelper functions were added: `isScreenLogged` and `isErrorLogged`

fixes #1500
2014-09-12 13:14:09 +01:00
Shane Tomlinson acbb5523f6 pre-verify tokens work end to end!
* Add functional tests for the preverified flow.

To test using 123done, apply the following diff to fxa-auth-server/

diff --git a/config/dev.json b/config/dev.json
index 7919bd9..f08a03a 100644
--- a/config/dev.json
+++ b/config/dev.json
@@ -19,5 +19,6 @@
   "bounces": {
     "region": "us-east-1"
   },
-  "customsUrl": "none"
+  "customsUrl": "none",
+  "trustedJKUs": ["http://127.0.0.1:8080/.well-known/public-keys"]
 }

Then visit:

http://127.0.0.1:8080/api/preverify-signup?email=<your_email>
2014-09-05 16:28:23 +01:00
vladikoff 11d4b7832f tests(coverage): Add coveralls coverage 2014-08-21 11:45:28 -07:00
Zachary Carter 5c9895abf6 Merge branch 'metrics'
Conflicts:
	server/config/awsbox.json
2014-05-23 15:26:13 -07:00
Shane Tomlinson 423441257d Merge pull request #1142 from vladikoff/force-focus
fix(test): Force focus in Mocha tests.

Beautiful. Thanks @vladikoff!

r+
2014-05-23 12:42:36 +01:00
Shane Tomlinson 084fce06ae feat: Add front end metrics gathering.
* Use SpeedTrap to collect client side metrics
* Add screen views and errors to an event stream.
* Metrics are sent to the `/metrics` endpoint on document unload or after 10 minutes of inactivity.
* Data that is sent to the backend is filtered - only data we expect is sent.
* Data collection sample rate is set by server configuration.

Other logged events:

* users who cancel login from the browser.
* complete_reset_password:link_damaged
* complete_reset_password:link_expired
* complete_signn_up:link_damaged
* confirm:too_many_attempts
* confirm:resend
* confirm_reset_password_resend
* login:canceled

Others changes:
* AuthErrors.toMessage now accepts `forceMessage`
* Change AuthErrors.toCode to accept an error object.
* Give `Session expired` an error code of 1002.

issue #1119
2014-05-23 12:05:20 +01:00
vladikoff 23bead9a30 fix(test): Force focus in Mocha tests. 2014-05-21 18:57:25 -04:00
Zachary Carter c3bb1a8d81 refactor(oauth): add create email test helper for specs 2014-05-13 15:45:59 -07:00
Shane Tomlinson 5c52ac9098 feature(client): Check email verification tokens before rendering.
* URL parameter validation for `/complete_reset_password` and `/verify_email`
* Add validate.js for a central place to do validation.
* Update form to validate email addresses using validate.js
* Validate emails, tokens, and codes on the client.
* Handle errors sent by the server that says uid or code is bad.
* Handle expired tokens by giving the user an opportunity to resend the email.
* Add unit and functional tests for corner cases.

fixes #788
2014-04-15 09:34:54 +01:00
Zachary Carter ceef064a1e test(frontend): upgrade mocha for promise support and fix async tests 2014-03-19 11:55:02 -07:00
Shane Tomlinson 48a3006988 Ensure the `service` and `redirectTo` URL search parameters make it to the fxa-js-client.
* Pick `service` and `redirectTo` out of the URL search parameters on startup, add it to Session.
* Add sinon.js to ensure the fxa-js-client recieves the `service` parameter when expected.
* Update the views to get `service` from Session instead of the URL.
* Add two new test suites, complete_sign_up and reset_password_complete.
* Check whether service and redirectTo make it to the complete screens.
* Check whether the expected backend calls are made when expected.
* Hook up the real translator in the tests so string interpolation can be tested.

NOTE: I updated bower to use a specific version of sinon because the official sinon.js package in bower is not set up to correctly handle amd installs and does not give spy functionality.
2014-02-11 15:04:59 +00:00
Shane Tomlinson 1274f8f7c5 Add helpers.js with requiresFocus, use that in form.js when checking for focus. 2014-02-07 21:19:06 +00:00