Commit Graph

52 Commits

Author SHA1 Message Date
cmmills91
22ba39812b Add support for resending verification email in case of expired token (#3617)
* -Defines new public API route /apps/:appId/resend_verification_email that will generate a new email verification link and email for a user identified by username in POST body
-Add template and url support for invalidVerificationLink, linkSendSuccess, and linkSendFail pages. The invalidVerificationLink pages includes a button that allows the user to generate a new verification email if their current token has expired, using the new public API route
-All three pages have default html that will be functional out of the box, but they can be customized in the customPages object. The custom page for invalidVerificationLink needs to handle the extraction of the username and appId from the url and the POST to generate the new link (this requires javascript)
-Clicking a link for an email that has already been verified now routes to the emailVerifySuccess page instead of the invalidLink page

* Fix package.json repo url to be parse-server againwq

* Fix js lint issues

* Update unit tests

* Use arrow functions, change html page comments, use qs and a string template to construct location for invalidVerificationLink page, syntax fixes

* Remember to pass result when using arrow function
2017-05-10 09:02:16 -04:00
Florent Vilmart
907b160fc7 Adds support for PushScheduling (#3722)
* Add support for push scheduling

Add a configuration flag on the server to handle the availability of
push scheduling.

* Update push controller to skip sending only if scheduling is configured

Only skip push sending if scheduling is configured

* Update bad conventions

* Add CLI definitions for push scheduling

* Adds tests for pushTime

* Adds test for scheduling

* nits

* Test for not scheduled
2017-04-15 17:20:55 -04:00
Florent Vilmart
deedf7b370 Push scalability (#3080)
* Update status through increment
* adds support for incrementing nested keys
* fix issue when having spaces in keys for ordering
* Refactors PushController to use worker
* Adds tests for custom push queue config
* Makes PushController adapter independant
* Better logging of _PushStatus in VERBOSE
2017-01-13 19:34:04 -05:00
Arthur Cinader
4cb6e7d209 Add lint rule space-infix-ops (#3237)
Disallows: 1+1.  Must be 1 + 1.
2017-01-11 12:31:40 -08:00
Lenart Rudel
5d9dbea07b Add parseFrameURL for masking user-facing pages (#3267)
* Add parseFrameURL for masking user-facing pages.

Allow users to specify a different address which is used to mask parse
requests for verifying email and resetting password. This is how Parse.com
used to allow customers to gain control over page content, styling etc.

On the destination page javascript is used to check the link in the request
and embed the parse server page using IFRAME.

* Fix code indentation

* Rename method for building link and pass config to it.

* Add customPages options to README.md.

* Add tests for parseFrameURL email link building, and parseFrameURL option.

* Add parseFrameURL for masking user-facing pages.

Allow users to specify a different address which is used to mask parse
requests for verifying email and resetting password. This is how Parse.com
used to allow customers to gain control over page content, styling etc.

On the destination page javascript is used to check the link in the request
and embed the parse server page using IFRAME.

* Fix code indentation

* Rename method for building link and pass config to it.

* Add customPages options to README.md.

* Don't Object.assign to defaultConfiguration global
2017-01-08 10:56:57 -08:00
Bhaskar Reddy Yasa
f331f6644c Add support for regex string for password policy validatorPattern setting (#3331) 2017-01-08 07:12:44 -08:00
Arthur Cinader
ca286b7108 Enable prefer-const lint rule (#3202) 2016-12-07 18:17:05 -05:00
Florent Vilmart
c1dcaf1271 Auth Adapters refactoring (#3177)
* Moves all authentication providers to Adapter/Auth

* refactors specs

* Deprecates oauth option in favor of auth option

- Deprecates facebookAppIds option (in favor of auth.facebook.appIds)
- Adds warnings about the deprecated options

* nits
2016-12-06 14:09:43 -08:00
Arthur Cinader
01b05b060f Strip personally identifiable information from user table for unauthorized users.
- add a config option to explicitly enumerate pii fields beyond email
- in query controller, strip pii of user table results before sending out the door.
2016-12-02 19:39:09 -05:00
Arthur Cinader
a270632570 More lint tweaking (#3164)
1. Add no space in paren rule
2. fix spec/eslintrc.json so it allow for inheriting from root rc.

Because the spce rc specified reccomended, it "turned off" all of the
rule tweaks in the root.  This fixes that.
2016-12-02 19:11:54 -05:00
Bhaskar Reddy Yasa
bd1689190f Adds password history support to passwordPolicy (#3102)
* password history support in passwordPolicy

* Refactor RestWrite.transformUser

* fix eslint issues
2016-11-29 09:01:52 -08:00
Bhaskar Reddy Yasa
edb7b70ced Adds password expiry support to password policy (#3068)
* Adding support for password expiry policy

* Renamed daysBeforeExpiry -> maxPasswordAge
2016-11-21 07:46:38 -08:00
Bhaskar Reddy Yasa
cf6ce5b9a3 Adding support for optional Password Policy (#3032)
* adds resetTokenValidityDuration setting

* adds a validator to validate password that can be used to enforce strong
passwords

* adds unit tests for passwordPolicy.validator

* adds unit tests to to fail reset password function if password is not in a valid format

* updates README.md for passwordPolicy

* prevents duplicate check for password validator in updateUserPassword

* adds optional setting to disallow username in password

* updates test cases to use fdescribe instead of describe

* updates test cases to use request-promise instead of request

* adds ability to use a RegExp or Callback function or both for a passwordPolicy.validator

* expect username parameter in redirect to password_reset_success

* adds support for _perishable_token_expires_at in postgres
2016-11-17 08:37:51 -08:00
Steven Shipton
b347bff641 Add option to re-use schema cache between requests (#2979)
* Add option to reuse database controller between requests. Clear schema cache when deleting everything

* Add test

* Rename setting to persistSchemaCache to more accurately reflect effect

* Repurpose option to determine whether to randomize cache prefix. Restore Config.js controller creation. Add tests

* Fix bug with missing parameter passed to to SchemaCache

* Renaming and formatting

* Fix property name typo

* Rename option to avoid double negative and still be falsey by default. Style fix
2016-11-02 19:05:23 -04:00
Diwakar Cherukumilli
28bd37884d Adds ability to set an account lockout policy (#2601)
* Adds ability to set account lockout policy

* change fit to it in tests
2016-09-02 20:00:47 -04:00
Florent Vilmart
09bd9e3b2c Adds schema caching capabilities (5s by default) (#2286)
* Adds schema caching capabilities (off by default)

* Use InMemoryCacheAdapter

* Uses proper adapter to generate a cache

* Fix bugs when running disabled cache

* nits

* nits

* Use options object instead of boolean

* Imrpove concurrency of loadSchema

* Adds testing with SCHEMA_CACHE_ON

* Use CacheController instead of generator

- Makes caching SchemaCache use a generated prefix
- Makes clearing the SchemaCache clear only the cached schema keys
- Enable cache by default (ttl 5s)
2016-07-22 21:23:59 -07:00
Marek Mikołajczyk
d1a6caeee3 Allow usage of analytics adapter (#2327)
* Allow usage of analytics adapter

* Use promises in controller
2016-07-20 09:27:15 -04:00
Diwakar Cherukumilli
6f292059ba Adds ability to expire email verify token (#2216) 2016-07-18 23:10:36 -07:00
Sen Palanisami
7d234e054b Log objects rather than JSON strings and option for single line logs (#2028)
* Log objects rather than JSON strings and option for single line logs

This reverts commit fcd914bdfd.

* Better password stripping tests
2016-07-15 16:18:50 -04:00
Tyler Brock
2f2ff377eb Better e-mail adapter testing (#2208) 2016-07-05 12:08:46 -07:00
Diwakar Cherukumilli
08c63f324a Adds ability to prevent login with unverified emails (#2175) 2016-07-04 13:56:35 -04:00
Tyler Brock
799e59618c Stop requiring verifyUserEmails for password reset functionality (#2166) 2016-06-28 22:25:44 -04:00
Drew
7e868b2dcc Unique indexes (#1971)
* Add unique indexing

* Add unique indexing for username/email

* WIP

* Finish unique indexes

* Notes on how to upgrade to 2.3.0 safely

* index on unique-indexes: c454180 Revert "Log objects rather than JSON stringified objects (#1922)"

* reconfigure username/email tests

* Start dealing with test shittyness

* Remove tests for files that we are removing

* most tests passing

* fix failing test

* Make specific server config for tests async

* Fix more tests

* fix more tests

* Fix another test

* fix more tests

* Fix email validation

* move some stuff around

* Destroy server to ensure all connections are gone

* Fix broken cloud code

* Save callback to variable

* no need to delete non existant cloud

* undo

* Fix all tests where connections are left open after server closes.

* Fix issues caused by missing gridstore adapter

* Update guide for 2.3.0 and fix final tests

* use strict

* don't use features that won't work in node 4

* Fix syntax error

* Fix typos

* Add duplicate finding command

* Update 2.3.0.md
2016-06-10 20:27:21 -07:00
Tyler Brock
17374eff8d Round out webhookKey support in cli, docs, and Config (#1936) 2016-05-28 12:21:55 -04:00
Blayne Chard
8c09c3dae1 Adding Caching Adapter, allows caching of _Role and _User queries (fixes #168) (#1664)
* Adding Caching Adapter, allows caching of _Role and _User queries.
2016-05-18 12:12:30 +12:00
Steven Shipton
37c502bed0 Add config.expireInactiveSession to add support for non-expiring inactive sessions (#1536)
* Create non-expiring session when sessionLength is zero

* Introduce expireInactiveSessions setting
2016-05-06 12:50:45 -07:00
Drew
d33dd68cc5 Add revokeSessionOnPasswordReset option. Closes #1584 (#1597)
* Add revokeSessionOnPasswordReset option

* Fix nits
2016-04-22 18:21:50 -04:00
Jeremy May
f99b5588ab Added session length option for session tokens to server configuration 2016-04-02 11:36:47 -04:00
Florent Vilmart
ab1858616b Adds ability to override mount with publicServerURL for production uses 2016-03-30 20:09:10 -04:00
wangmengyan95
555e25bf33 Add LiveQuery 2016-03-18 12:32:31 -07:00
Florent Vilmart
9c5f14981e Renames oauth to authDataManager in src 2016-03-10 18:14:56 -05:00
Florent Vilmart
54d154f7aa Centralizes AuthData validation 2016-03-10 18:14:56 -05:00
Florent Vilmart
28d1a8afe4 Sends 404 when parseServerURL is not set on public pages
- throws when verifyEmail = true && publicServerURL not set
2016-02-29 20:51:13 -05:00
Florent Vilmart
6aa38ea8ca Improves validation of email parameters in Configuration 2016-02-29 19:26:50 -05:00
Florent Vilmart
3ecaa0aa4b Sends verification email upon set and update email
- nits
2016-02-29 18:58:34 -05:00
Florent Vilmart
91d9724182 Adds reset password logic 2016-02-29 18:55:15 -05:00
Florent Vilmart
f3bb2c99e0 Refactor and advancements
- Drops mailController, centralized in UserController
- Adds views folder for change_password
- Improves PromiseRouter to support text results
- Improves PromiseRouter to support empty responses for redirects
- Adds options to AdaptableController
- UsersController gracefully fails when no adapter is set
- Refactors GlobalConfig into same style for Routers
2016-02-29 18:55:14 -05:00
Florent Vilmart
7dd765256c Refactors verify_email, adds public html 2016-02-29 18:52:11 -05:00
Florent Vilmart
0b307bc22f Improves AdapterLoader, enforces configuraiton on Adapters 2016-02-29 18:52:10 -05:00
Drew Gross
8dc37b9d30 Exploring the interface of a mail adapter
Add some tests and demonstrate the adapter loading interface
2016-02-29 18:52:10 -05:00
Nikita Lutsenko
9bc636dc5c Cleanup, remove unusued methods and unify cache.js. 2016-02-26 22:48:53 -08:00
Nikita Lutsenko
0cf3f56b00 Remove dependency from DatabaseAdapter on cache.js. 2016-02-26 20:46:49 -08:00
Marco129
97489106b4 Add allowClientClassCreation option 2016-02-26 23:08:20 +08:00
Florent Vilmart
c4abd1e267 cache as ES6 2016-02-25 08:10:08 -05:00
Florent Vilmart
9ac7a52e40 Adds Hooks API
Adds Parse.Hooks.js in src/cloud-code/Parse.Hooks.js
Moves Cloud code related functions in src/cloud-code
2016-02-25 08:10:07 -05:00
Florent Vilmart
fbb5e448e6 refactors LoggerController with LogsRouter 2016-02-20 13:52:36 -05:00
Florent Vilmart
305879a251 Refactors FilesController in FilesRouter and FilesController 2016-02-20 13:52:35 -05:00
Florent Vilmart
067946c66c Refactors PushController and FilesController to support multiple apps 2016-02-19 23:49:12 -05:00
Florent Vilmart
e010fd82f2 Generic OAuth provider support
Refactors facebook login into oauth generic login

Adds additional oauth2 providers

adds ability to pass an oAuth validator in the config

Adds Twitter validation support + OAuth 1 client

Support auth_token instead of access_token for twitter

Improves code coverage of OAuth

Adds validation of oauth provider structures

Better coverage of the OAuth spec

100% coverage of OAuth1.js

Adds passing auth_token_secret for Twitter auth.

Refactors auth validation methods to include authData parameter

- Adds ability to extens oauth validator through configuration
- Adds ability to extend oauth validator through external module (file or package)
- Adds more tests
- Adds tests to login with custom auth provider

Adds more tests for REST API

fixes twitter auth_token

f
2016-02-17 08:06:30 -05:00
Florent Vilmart
c0bd5d2036 adds ability to disable anonymous users 2016-02-15 22:44:50 -05:00