Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

updateAll should honour strict mode #3183

Closed
bajtos opened this issue Feb 6, 2017 · 4 comments
Closed

updateAll should honour strict mode #3183

bajtos opened this issue Feb 6, 2017 · 4 comments

Comments

@bajtos
Copy link
Member

bajtos commented Feb 6, 2017

Bug/Feature request

See #742 (comment)

When user makes a POST /update request (calls updateAll in node API terms), the backend will happily persist (yes, actually persist, not just a wrong in-memory representation) random properties to MongoDB through an updateAll even though strict mode is enabled for the model.

Expected result

updateAll honours strict mode and rejects request with extra properties not described by the model.

Additional information

The scope of this issue is to fix strict mode only. Enforcing all property validations is covered by loopbackio/loopback-datasource-juggler#771.

@fabien
Copy link
Contributor

fabien commented Feb 6, 2017

@bajtos will this be backported to v.2?

@bajtos
Copy link
Member Author

bajtos commented Feb 6, 2017

will this be backported to v.2?

Should it be? I labelled this issue as a feature (semver-minor), which means it won't be backported.

What's your opinion?

@fabien
Copy link
Contributor

fabien commented Feb 6, 2017

I'd prefer to see it backported, because to me it doesn't appear like a feature. The semantics of strict were a far cry from actually being strict up until now, if you know what I mean.

An option like that (with a name that implies a serious restriction) should behave as expected at all times, to avoid the issues (even security related) mentioned, wouldn't you agree?

@stale
Copy link

stale bot commented Sep 6, 2017

This issue has been closed due to continued inactivity. Thank you for your understanding. If you believe this to be in error, please contact one of the code owners, listed in the CODEOWNERS file at the top-level of this repository.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants