-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Make it possible to skip triggers #7059
Comments
hi @AurelienVasseur , Here you have an issue, this kind of feature misconfigured can allow a client SDK to skip triggers, and in 99% of uses cases triggers contain security checks. I think here it's an OOS (Out Of Scope) issue. Here i can suggest:
|
Generally, according to the overall product strategy we do not a priori dismiss a feature suggestions based on hypothetical developer mistakes. See the discussion about protected fields. The counter argument is that without an implementation, a developer cooks their own implementation which is not examined by the community and therefore potentially less secure. The strength of Parse Server is to provide a multi-functional tool for a broad range of use cases, so if we can come up with a sound concept, I see this as a possible addition. |
@AurelienVasseur personally, when I want a different response if i'm testing, I use something like: const args = process.argv || [];
const testing = args.some(arg => arg.includes('jasmine'));
Parse.Cloud.beforeSave("myClass", async ({object}) => {
if (testing) {
return object;
}
}); |
Is your feature request related to a problem? Please describe.
When I'm writing tests I would like to be able to skip triggers.
For example, if I do some security check on my triggers I need to match with that on my test, and sometime it's very annoying because the objective is not to test the trigger, but something else. So it will be very useful to skip them.
Describe the solution you'd like
I see 2 major possibilities:
option
which can be pass (as a context) on actionscontext
to simulate the skippingThe second solution only required that the context can be used on every triggers - #7058 - but it don't really skip the trigger.
So I definitely think that the first one can be the best option (or something else in the same spirit).
The text was updated successfully, but these errors were encountered: