Commit Graph

50 Commits

Author SHA1 Message Date
Laurence Tennant
2b6cf53d30 fix(users): Better MIME-type checking, remove image cropping library (#1589)
* Cropping remove, nicer UI

* Fix MIME-type checking, add image upload tests

* Change image config settings to uploads.profile.image to build a more
rational structure for configuring other types of uploads
2016-11-15 15:59:47 -08:00
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
Pierre Brisorgueil
ae638893b2 fix(users): test for usernameOrEmail (#1582) 2016-10-19 18:59:45 +03:00
Michael Leanos
0ea8cec120 fix(express): Incorrest uses of 400 error codes (#1553)
Fixes incorrest usage of 400 HTTP responses being returned from the
server, in favor of using 422.

Also, changed a few return codes to 401 where it was more appropriate.

See this article for reasoning behind moving to 422, and why 400 isn't
appropriate for these cases.

For ref:
6be12f8a06

Related:
https://github.com/meanjs/mean/pull/1547
https://github.com/meanjs/mean/pull/1510
2016-10-10 16:00:24 -07:00
shanavas
5725c449c7 Fix(Users): Remove redundant request body (#1554) 2016-10-09 12:00:47 +03:00
itelo
6a6b630292 feat(users): change username to usernameOrEmail in signin (#1545)
* feat(users): change username to usernameOrEmail in signin

* fix(users): toLowerCase at email in local strategy
2016-10-06 18:34:15 +03:00
Mikael Korpela
25c8a6044c fix(tests): Clean out .send() from tests (#1489)
Clean out commented `.send()` from user CRUD test.
2016-09-08 14:45:33 +03:00
Mikael Korpela
c35713d352 fix(core): Fixes issues with tests and Node v6 (#1458)
Fixes issues with Mocha tests and Node v6.

Related to #1455
2016-08-28 14:30:27 +03:00
shanavas
730cca76af fix(users): don't update secure profile fields (#1421)
* Fix(users): Don't update secure profile fields

Avoid updating secure fields as password, salt ..etc through
user profile update.

Fixes #1420

* Refactor variable name
2016-08-27 09:45:06 +03: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
Qiyu Li
6265aaa7da fix(core): Support WiredTiger engine errmsg format in MongoDB 3.2
The new WiredTiger engine is introduced in MongoDB 3.2.
It changes the output errmsg format for violation of unique index.
This commit adds support for the new format.

Fixes #1245
2016-03-04 09:56:15 -05:00
Joris Willems
500d1a62df feat(config): upgrade to angular 1.5
Update bower dependencies to more recent versions.
Resolved hard-coded dependency by updating file upload
PhantomJs to 2.x series for tests (@usta)
Fix assertion in tests for compatibility with MongoDB 3.2 (@rhutchison)
Improve coding style tests to avoid type errors (@ilanbiala)
Fix refresh showing flash of scrollbar in menu
Remove deprecated angular-ui-utils

Fixes #1124
2016-03-02 18:18:53 +01:00
Ilan Biala
62095a1114 fix(test): Update Mocha, mock-fs, and fix Node 5 support 2016-02-10 20:47:11 -05: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
a871c92556 Duplicate CRUD Test - Profile Picture
Removes a duplicate User CRUD test for Profile Picture.

There are two reasons for this commit.

1) Duplicate of
https://github.com/meanjs/mean/blob/master/modules/users/tests/server/user.server.routes.tests.js#L833-L848
2) This test is problematic in Windows environment.
Related to:
https://github.com/visionmedia/supertest/issues/230
https://github.com/visionmedia/supertest/issues/258

The latter may be an issue with the `.attach` method not completely
loading the file into memory before the 400 status response is sent back
due to no User logged in.
2015-10-28 22:57:28 -07:00
gustavodemari
7ecf9337ce updating profile upload with a new version of multer 2015-10-18 20:56:12 -02:00
Ilan Biala
0323696eaf Format code according to ESLint rules 2015-10-16 20:52:31 -04:00
Liran Tal
8a12f76a19 Merge pull request #972 from mleanos/mocha-global-timeout-grunt
Global Mocha timeout
2015-10-13 08:39:48 +03:00
Liran Tal
0017886d6e updating travis to support installing a local mail server 2015-10-11 23:19:20 +03:00
Liran Tal
eb7c4f8e91 adding more API tests 2015-10-11 23:19:20 +03: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
Liran Tal
b7a57abd30 adding the required support to properly build the nodejs v4 edition
updating grunt-node-inspector version to compatible version with nodejs v4
2015-10-06 14:09:04 +03: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
Liran Tal
b800141c41 Merge pull request #921 from mleanos/dbseed-user-passwords
[hotfix] Fixes db seed password bug
2015-09-25 08:37:40 +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
Liran Tal
de354ee6d6 adding route tests for user/admin CRUD operations 2015-09-21 20:18:24 +03:00
Liran Tal
1eddc471db updating comments for tests in code 2015-09-20 18:35:52 +03: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
Ryan Hutchison
4bbc4a30f6 add user route tests 2015-07-28 18:50:11 -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