18 Commits

Author SHA1 Message Date
Alexandre Bodin
0db015e6c2 Update tests
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-02 19:41:45 +01:00
Alexandre Bodin
07e7cfc0bd Make lint stricter and fix the errors
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-11-02 19:41:42 +01:00
Alexandre Bodin
c98089ff65 Merge branch 'master' into releases/3.2
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-05 12:00:03 +02:00
Jean-Sébastien Herbaux
e55ea1d6b5
Hide creator fields from public api by default (#8052)
* Add model option to hide/show creators fields in public API response

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Add content-types util, rework sanitize-entity's private handling

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Update search e2e tests, fix an issue on empty search for the core-api controller (find)

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix GraphQL plugin (handle privates attributes on typeDefs + resolver builds)

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix sanitizeEntity import

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Move doc update from beta to stable

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix e2e test

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix pr comments

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Remove creator's field from upload controller routes

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix typedef build for graphql association

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix pr (comments + several issues)

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Add tests for search behavior in content-manager

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Rename files variables to meaningful names (upload controllers)

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

* Fix test with search id matching serialNumber

Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>

* Add toHasBeenCalledWith check for config.get (utils/content-types.test.js)

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>

Co-authored-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-01 17:47:08 +02:00
Alexandre Bodin
8589848ce4 Merge branch 'features/draft-publish' into releases/3.2
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-10-01 16:23:32 +02:00
Diego Albitres
0670c896e3
Add privateAttributes to global and per model response (#7331)
* Added privateAttributes globally and per model

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Added tests for sanitizeEntity

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Fixed broken test

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Added privateAttributes to GraphQL responses

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Added docs for privateAttributes

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Refactored and fixed PR comments

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Merged tests and fixed broken tests from merge

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Updated documentation for new option

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Refactored GraphQL implementation

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Fixed PR comments

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Fixed tests for sanitize-entity

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Removed code and tests for ignorePrivateFor

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Exported getPrivateAttributes for GraphQL plugin

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>

* Removed ignorePrivateFor from docs

Signed-off-by: Diego Albitres <diego.albitres@gmail.com>
2020-09-24 09:40:10 +02:00
Pierre Noël
e29c1b7de9 add published_at (#7374)
* add published_at

Signed-off-by: Pierre Noël <petersg83@gmail.com>
2020-09-22 17:39:18 +02:00
Jean-Sébastien Herbaux
1e67421668
Add utils::sanitize-entity tests (#7497)
* Add utils::sanitize-entity tests

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-08-18 16:26:24 +02:00
Convly
10cc543cc7 Fix sanitizeEntity's includeFields usage for dynamic zones
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-08-06 15:13:45 +02:00
Alexandre Bodin
38d67fc873 Fix mongo issues
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-07-08 16:07:11 +02:00
Alexandre Bodin
109e41ea1f Fix e2e tests
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-07-08 13:53:56 +02:00
Alexandre Bodin
1c90614f8b Fix sanitizeEntity
Signed-off-by: Alexandre Bodin <bodin.alex@gmail.com>
2020-07-08 11:48:44 +02:00
Convly
36facdfd00 Add new sanitize-entity.js
Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 11:48:41 +02:00
Convly
20f80b2361 Better permissions-manager.sanitize behavior
Forbid empty arrays as fields for permissions (on ability creation)
Differentiate input from output sanitizing

Signed-off-by: Convly <jean-sebastien.herbaux@epitech.eu>
2020-07-08 11:48:38 +02:00
Alexandre Bodin
b9122edf0d Rename groups to components 2019-11-13 18:49:02 +01:00
Alexandre Bodin
444ce89b19 Fix sanitize bug with mongo objectid and use lower-case for getModel 2019-10-04 11:38:54 +02:00
Alexandre Bodin
76455257b4 Support toJSON in sanitizeEntity 2019-09-20 09:56:00 +02:00
Alexandre Bodin
a22f2cefef Remove x-forwarded-host.
- set security defaults for development mode that are standard
- refactor error messages to work without ctx.request.admin
- remove mask middleware and add a sanitization layer to the core-api to
hide private fileds
2019-09-06 14:33:24 +02:00