Commit Graph

28 Commits

Author SHA1 Message Date
Sujeeth
fb9d9d912c feat(user): add strict validations for username (#1574)
Idea proposed by @sparshy #1204
Suggestions, rules and tests from Trustroots @simison
Added validations on user server model
Added client side validations
Added relevant tests on user server tests
Added relevant tests on user e2e tests

Fixes #1204
2016-10-19 20:40:26 -07:00
Michael Leanos
4906611ccc fix(users): GitHub strategy missing email (#1250)
Fixes an issue with an empty/missing/null Email coming from GitHub's
OAuth call response.

Also, introduces the `sparse` index option on the User model's Email
field. This will ensure that we can have multiple User documents without
the Email field.

Adds a server-side User model test for the sparse index setting on the
email field.

Confirms that User documents without the email field are not indexed,
illustrating the sparse option on the schema's email field works
properly.

Added the dropdb task to the Gulp test:client & test:server tasks, to
ensure we have a clean database & that any indexes are rebuilt; this
will ensure any Schema changes (in this case the email index is rebuilt using
the sparse index option) are reflected when the database is started again.

Added a UPGRADE.md for tracking important upgrade information for our
user's to be aware of, when we introduce potentially breaking changes.

Included an explanation of the Sparse index being added, and how to apply it
to an existing MEANJS application's database.

Adds a script for dropping the `email` field's index from the User
collection.

Related #1145
2016-04-29 14:13:46 -07:00
Marek Grzybek
d14d5130af feat(config): Deprecate JSHint in favor of ESLint
Add basic ESLint setup extending well-known Airbnb code style.

Fixes #1072, #1097
2016-03-15 19:11:12 +01:00
jloveland
33258f1314 feat(users): Supporting valid email according to HTML5 and RFC 822
Supporting valid email (i.e. root@admin) according to HTML5 and RFC 822
proposed by @jloveland

Fixes #934
2015-11-30 21:47:13 -05:00
mleanos
037878b4ba Global Mocha timeout
Added the timeout option to the Mocha grunt task; set to 10000.

Removed the individual test suite timeouts, for all server tests.

Also, added global timeout for Mocha gulp task.
2015-10-10 23:52:08 -07:00
mleanos
3b375e62d8 Mocha test timeouts [fixes #955]
Added a timeout of 10000 ms to each server test file. This is an attempt
to solve the timeout issues that we're experiencing with the Mocha
tests. Especially, this is hoping to address the build fails that are
caused by such timeouts.

Issue is described in https://github.com/meanjs/mean/issues/955
2015-09-30 19:50:07 -07:00
Liran Tal
7fcd4f2ed3 Merge pull request #937 from lirantal/feature/seeddb-refactoring
SeedDB Refactoring
2015-09-30 12:55:49 +03:00
Liran Tal
cc80930081 Merge pull request #904 from jloveland/jshint-single-quotes
fixing jshint single quotes issues
2015-09-28 23:47:13 +03:00
Liran Tal
988609399a refactoring the seeddb logic to work with promises all over due to all the async behavior 2015-09-28 11:29:39 +03:00
mleanos
1c7d74298b [hotfix] Fixes db seed password bug
Fixes the database seeding bug with the password not passing the owasp
test.

Adds a UserSchema static method that generates a random passphrase that passes
the owasp test.

Performed minor refactoring of the database seed configuration to
implement the new UserSchema method.

Added model test for the UserSchema generateRandomPassphrase static method.
2015-09-22 02:23:30 -07:00
jloveland
a38abd0f8c fixing jshint issues by requiring single quotes 2015-09-11 12:47:19 -04:00
jloveland
1fd6bb6119 adding stronger password requirements for improving security based on OWASP 2015-09-07 22:11:02 -04:00
mleanos
14b8dd4dce Fixed User model tests
PR #840 changed the global var `user` to `user1`. This was merged and
then #858 was merged, which was still referencing the global var as
`user` in the new *roles* tests. This was causing jshint failures from
the new

This change updates the new *roles* tests to use `user1`
2015-08-30 15:53:29 -07:00
Liran Tal
8335aa7070 Merge pull request #858 from mleanos/admin-users-require-role
Admin users require role
2015-08-30 21:55:58 +03:00
mleanos
263adccd44 User model tests for roles
Added tests for the User model's roles field.

Should be able to update existing user with valid roles
Should NOT be able to update existing user WITHOUT a role
Should NOT be able to update existing user with INVALID role
2015-08-28 18:19:33 -07:00
Liran Tal
6db8a4e4fa Major Fixing and Refactoring tests
1. Refactoring variables usage through-out the tests
2. Fixing correct error handler tests were previously these would report a false positive isue
3. Fixing recent unit tests to be added as part of the main save method suite
4. Fixing an issue with the tests which didn't clean the user1 entry in the db and so tests following it would fail regardless of the validation
5. Fixing one test to actually be valid use case
2015-08-26 22:54:08 +03:00
Cody B. Daig
5c287f583b [fix] Was storing a 6 char password in plain text [fixes #829] 2015-08-20 09:26:07 -07:00
Cody B. Daig
74f58bbbd6 [test] Allow an email with sub domains 2015-08-19 19:08:44 -07:00
Liran Tal
89050d5628 Adding suite of tests for the e-mail validation field in the users model 2015-08-13 21:56:19 +03:00
Liran Tal
463f5b944f fixing up a user model test which was not setup correctly without the async done() callback, which led to false postivies. Adding timeouts to the test ensures that the test completes in time, otherwise mocha's 2s timeout will fail the test 2015-08-08 00:42:11 +03:00
Liran Tal
c967a98562 refactoring the async nature in the user model tests to account for mocha 2 second timeouts causing travis-ci build fails 2015-08-06 16:49:50 +03:00
Liran Tal
346ebd6a67 re-factoring the server model tests to create user model from schema only during tests, so that we can re-use mongodb's _v versioning fields, and also cleaning up user tests on each test iteration 2015-08-05 14:08:09 +03:00
Ryan Hutchison
ef3a3f9548 formatting reboot (space-2 and consistency)
JSCS fixes

update editorconfig
2015-07-31 10:04:02 -04:00
Liran Tal
ac35f0fec8 adding couple more tests to confirm users model works as expected 2015-07-24 09:38:49 +03:00
Julien Mazé
c572ed7eec JSHint test failing because of missing semicolon
I just cloned the branch and both gulp and grunt fail on the lint task because of the missing semicolon.
2015-07-12 20:54:59 +02:00
Liran Tal
bf79c17bd0 updating the schema save pre hook so that it checks for a modified version of the password field before it tries to re-calculate the new password to save for the user model 2015-07-12 19:25:40 +03:00
Veikko Karsikko
1897ef985b Wait for async saving and removing 2015-02-23 09:33:26 +02:00
Amos Haviv
ab81d61bd3 New 0.4 version 2014-11-10 23:12:33 +02:00