Commit Graph

47 Commits

Author SHA1 Message Date
Natan Rolnik
9bfa0c60c4 Adds index on _Role name property (#3586)
* Adds index on _Role name property

In order to avoid having different _Role objects with the same name, adding an index on the name property of _Role is necessary.

Fixes #3579

* Uses throw instead of Promise.reject when enforcing unique indexes

* Fixes wrong sorting of results in schemas tests
2017-03-04 12:42:19 -08: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
Arthur Cinader
ca286b7108 Enable prefer-const lint rule (#3202) 2016-12-07 18:17:05 -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
Florent Vilmart
8c2c76dd26 Adds liniting into the workflow (#3082)
* initial linting of src

* fix indent to 2 spaces

* Removes unnecessary rules

* ignore spec folder for now

* Spec linting

* Fix spec indent

* nits

* nits

* no no-empty rule
2016-11-24 15:47:41 -05:00
Florent Vilmart
b5af4d017c Makes sure pointer includes are interpolated as get (#2747)
* test for repro #2005

* Adds ability to override CLP op from RestQuery.execute

* nits
2016-09-24 14:54:31 -04:00
Florent Vilmart
c5fdd91aa3 Makes sure we don't duplicate user ACL's keys (#2651)
* Adds repro for issue #2246

* Provide fix for issue #2246

* Nit with Set to deduplicate the acl array

* remove debuging console.log
2016-09-09 14:43:59 -04:00
Florent Vilmart
364604e181 Run Schema validations after beforeSave #2672 (#2677)
* Adds test to repro #2672

* Run schema validation after beforeSave is run

* Makes authData part of base _User object

* exclude flaky pg test
2016-09-09 14:41:03 -04:00
Florent Vilmart
9ab488b6a0 Postgres: $all, $and CLP and more (#2551)
* Adds passing tests

* Better containsAll implementation

* Full Geopoint support, fix inverted lat/lng

* Adds support for $and operator / PointerPermissions specs

* Fix issue updating CLPs on schema

* Extends query support

* Adds RestCreate to the specs

* Adds User specs

* Adds error handlers for failing tests

* nits

* Proper JSON update of AuthData

* fix for #1259 with PG

* Fix for Installations _PushStatus test

* Adds support for GlobalConfig

* Enables relations tests

* Exclude spec as legacy

* Makes corner case for 1 in GlobalConfig
2016-08-20 16:07:48 -04:00
Florent Vilmart
9ecb9a3595 Postgres: Operations, Hooks, OAuth login, Files support (#2528)
* Adds files related tests through fs-adapter with PG

* Schema deletions implementations

* Adds Hooks spec

* Fix test

* Adds support for containsAll (numbers and strings)

* Better support for deleteFields and deleteClass

* Recursive JSON update for authData

* Adds node_modules to travis cache

* Disable temporarily to make tests pass

* Adds _perishable_token support for _User class

* ignore when a table creation fails at init (table exists)

* Adds support for AddUnique and Remove

* PG 9.4 compatible functions

* Re-enable tests

* nit

* Better handling of schema creation race
2016-08-18 18:05:26 -04:00
Florent Vilmart
c0249283ac Advancements with postgres (#2510)
* Start DB runner from tests

* Connect GridstoreAdapter only when needed

* removes unused package

* better test errors reporting

* Adds support for __op.Delete

* Better test error reporting

* Makes sure all tests can run without crashing

* Use xdescribe to skip test suite

* Removes unused dependencies

* Let volatiles classes be created with PG on start

* Do not fail if class dont exist

* adds index.spec.js to the pg suite

* Use a new config each test to prevent side effects

* Enable EmailVerificationToken specs with pg

* Makes sure failure output is not cut

* Reduces number of ignored tests in ParseObject.spec

* Inspect reconfiguration errors

* Mark GlobalConfig is incompatible with PG

- Problem is with nested updates (param.prop = value)

* PG: Nested JSON queries and updates

- Adds support for nested json and . operator queries
- Adds debug support for PG adapter
- Adds loglevel support in helper

* Enable working specs in ParseUser

* Sets default logLevel in tests to undefined

* Adds File type support, retores purchaseValidation specs

* Adds support for updating jsonb objects

- Restores PushController tests

* Proper implementation of deleteByQuery and ORs

- Adds ParseInstallation spec to the test suite

* xit only failing tests

* Nit on ParseAPI spec

* add sorting operator

* properly bound order keys

* reverts describe_only_db behavior

* Enables passing tests

* Adds basic support for relations, upsertOneObject aliased to createObject

* progress on queries options

* Fix ACL update related problems

* Creates relation tables on class creation

* Adds Relation tests

* remove flaky tests

* use promises instead of CB

* disable flaky test

* nits

* Fixes on schema spec

- Next thing is to implemenet geopoint and files correctly

* fix failues

* Basic GeoPoint support

* Adds support for $nearSphere/$maxDistance geopoint queries

* enable passing tests

* drop tables afterEach for PG, clean up relation tables too

* Better initialization/dropTables
2016-08-15 16:48:39 -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
Blayne Chard
8338783075 Adding more information to the permission denied error (#2210) 2016-07-07 11:30:29 -04:00
Drew
ab06055369 Postgres exclude failing tests (#2081)
* reload the right data

More passing postgres tests

Handle schema updates, and $in for non array columns

remove authdata from user and implement ensureUniqueness

Make some tests work, detect existing classes

Throw proper error for unique index violation

fix findOneAndUpdate

Support more types

support more type

Support boolean, fix _rperm/_wperm, add TODO

Support string types and also simplify tests

Move operator flattening into Parse Server and out of mongo adapters

Move authdata transform for create into Parse Server

Move authdata transforms completely in to Parse Server

Fix test setup

inline addSchema

Inject default schema to response from DB adapter

* Mark tests that don't work in Postgres

* Exclude one more test

* Exclude some more failing tests

* Exclude more tests
2016-06-17 12:59:16 -04:00
Drew
0ff35e18f0 Add more postgres support (#2080)
* reload the right data

More passing postgres tests

Handle schema updates, and $in for non array columns

remove authdata from user and implement ensureUniqueness

Make some tests work, detect existing classes

Throw proper error for unique index violation

* fix findOneAndUpdate
2016-06-16 15:39:05 -07:00
Drew
5518edc2a5 Postgres adapter (#2012)
* Remove adaptiveCollection

* Remove an adaptiveCollection use

* Remove an adaptiveCollection

* make adaptiveCollection private

* Remove collection from mongoadapter

* Move schema collection usage into mongo adapter

* stop relying on mongo format for removing join tables

* reduce usage of schemaCollection

* remove uses of _collection

* Move CLP setting into mongo adapter

* remove all uses of schemaCollection

* make schemaCollection private

* remove transform from schemaCollection

* rename some stuff

* Tweak paramaters and stuff

* reorder some params

* reorder find() arguments

* finishsh touching up argument order

* Accept a database adapter as a parameter

* First passing test with postgres!

* Actually use the provided className

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

* Start dealing with test shittyness

* Make specific server config for tests async

* Fix email validation

* Fix broken cloud code

* Save callback to variable

* undo

* Fix tests

* Setup travis

* fix travis maybe

* try removing db user

* indentation?

* remove postgres version setting

* sudo maybe?

* use postgres username

* fix check for _PushStatus

* excludes

* remove db=mongo

* allow postgres to fail

* Fix allow failure

* postgres 9.4

* Remove mongo implementations and fix test

* Fix test leaving behind connections
2016-06-12 16:35:13 -07:00
Florent Vilmart
e7e2369132 Fixes for Class Level and Pointer Permissions (#1989)
* Fixes for Pointer Permissions

- Fix bug that would leave public CLP when setting a new set of permissions
- Sets empty permissions if missing to match parse.com API
- Updates tests to reflect changes

* Adds regression test for #1991

* Fit -> It
2016-06-06 09:31:50 -07:00
Drew
50b9ae4803 Fix #1919 (#1926) 2016-05-26 19:15:54 -04:00
Florent Vilmart
c22bafb951 Sets the defaultSchemas keys in the SchemaCollection (#1421)
* Sets the defaultSchemas keys in the SchemaCollection

* Moves defaultSchema injection logic to router

* maps outside the function

* fixes test

* conciseness
2016-04-07 22:13:07 -04:00
Florent Vilmart
3a28352c96 🎉 fixes #1355
- injects default schema upon schema load
2016-04-04 08:36:40 -04:00
Florent Vilmart
5d99075663 Properly let masterKey add fields 2016-03-30 20:27:12 -04:00
Florent Vilmart
c935ed8364 Always return default public permissions 2016-03-10 23:01:45 -05:00
Florent Vilmart
16e3529c96 Removes blacklisting, *-but test case 2016-03-10 19:20:05 -05:00
Florent Vilmart
b1d399bf80 Adds blacklist permission, more test scenarios 2016-03-10 18:02:29 -05:00
Florent Vilmart
d71a58c217 Adds tests, improve coverage, adds ability to delete CLP with classLevelPermissions: null 2016-03-10 11:31:37 -05:00
Florent Vilmart
ddd1ae3338 Validates key, values and operation in CLP 2016-03-09 20:19:12 -05:00
Florent Vilmart
e75d233b7e Adds validation of addFields 2016-03-09 19:33:48 -05:00
Florent Vilmart
5780c1e425 Merges CLP endpoints with POST, PUT and GET 2016-03-09 19:33:47 -05:00
Florent Vilmart
d4fd73100c Adds CLP API to Schema router 2016-03-09 19:33:47 -05:00
Marco129
8814e1f3b5 Fix add field to system schema 2016-03-04 20:44:21 +08:00
Nikita Lutsenko
9a7264100c Merge pull request #794 from ParsePlatform/nlutsenko.schemasRouter
Completely migrate SchemasRouter to new MongoCollection API.
2016-03-03 14:55:54 -08:00
Marco129
f157538bfd Fix delete schema when actual collection does not exist 2016-03-03 18:46:47 +08:00
Nikita Lutsenko
99cb05ea1e Use throws syntax for errors in SchemasRouter. 2016-03-02 23:48:12 -08:00
Nikita Lutsenko
2afebf955f Completely migrate SchemasRouter to new MongoCollection API. 2016-03-02 21:34:40 -08:00
Nikita Lutsenko
e58c935f22 Use middleware instead of custom checks inside SchemasRouter. 2016-03-01 16:16:07 -08:00
Nikita Lutsenko
d1dbc1a035 Remove direct mongo access from schemas.spec.js. 2016-02-29 19:47:08 -08:00
Nikita Lutsenko
6893895aea Remove direct mongo access from SchemaRouter.modify, Schema.deleteField. 2016-02-29 19:47:08 -08:00
Nikita Lutsenko
028ef2a7b2 Remove dependency on raw mongo from SchemaRouter.delete. 2016-02-29 19:47:08 -08:00
Nikita Lutsenko
7215300c1e Move Mongo database property directly to mongo adapter. 2016-02-29 12:50:47 -08:00
Drew Gross
61b4468dac Implement DELETE /schemas/:className 2016-02-17 19:00:17 -08:00
Drew Gross
a455e1b23f Finish implementation of PUT /schemas/:className 2016-02-16 12:30:30 -08:00
Drew Gross
cef5a5fabf First part of schemas PUT 2016-02-11 10:43:05 -08:00
Nikita Lutsenko
3271b45102 Update imports in all specs. 2016-02-08 20:20:08 -08:00
Drew Gross
b9bc904aad Add tests to get to 100% branch coverage 2016-02-05 20:38:58 -08:00
Drew Gross
53dfca2d6f First part of schemas POST 2016-02-05 20:23:05 -08:00
Drew Gross
67ee94d98f Implement GET /schemas/OneSchema 2016-02-03 16:10:00 -08:00
Drew Gross
3d989501b2 Get all schemas, with tests, and matches parse.com schemas API 2016-02-03 12:06:45 -08:00