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

Add context to dashboard calls #2344

Open
3 tasks done
dblythy opened this issue Nov 29, 2022 · 5 comments
Open
3 tasks done

Add context to dashboard calls #2344

dblythy opened this issue Nov 29, 2022 · 5 comments
Labels
bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) type:feature New feature or improvement of existing feature

Comments

@dblythy
Copy link
Member

dblythy commented Nov 29, 2022

New Feature / Enhancement Checklist

Current Limitation

Parse Dashboard uses the JS SDK with the masterKey. It would be helpful to have context in cloud code whether the masterKey is being used in the dashboard, or via the cloud code.

Feature / Enhancement Description

obj.save(null, { context: {dashboard: true }})

Parse.Cloud.beforeFind('Object', ({ context, master}) => {
  if (context.dashboard && master) {
   // custom logic for dashboard only
  }
});

Example Use Case

Alternatives / Workarounds

3rd Party References

@parse-github-assistant
Copy link

parse-github-assistant bot commented Nov 29, 2022

Thanks for opening this issue!

  • 🎉 We are excited about your ideas for improvement!

@mtrezza
Copy link
Member

mtrezza commented Nov 29, 2022

I would not make this a default, as it's creating an unnecessary overhead for use cases in which this is irrelevant.

This seems to be a workaround for #2311. The underlying issue is that Parse Dashboard calls are unidentifiable because they are not requested by a user.

@mtrezza mtrezza added the type:feature New feature or improvement of existing feature label Nov 29, 2022
@matheusfrozzi
Copy link

Would not be easy just add a header in the dashboard calls?

@mtrezza
Copy link
Member

mtrezza commented Feb 16, 2023

Actually a special context.dashboard parameter or dedicated dashboard header seem to be too specific. We can consider Parse Dashboard to be just another client. So whether it's the official Parse Dashboard or a custom dashboard or any other client, it would be good to make them identifiable in the Cloud Code triggers. For that we already have the concept of a clientKey. We just need to make it accessible in Cloud Code.

PRs needed could be:

  • Add Parse Dashboard option to set the client key
  • Make client key accessible in Cloud Code trigger

@mtrezza mtrezza added the bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) label Jun 7, 2023
@mtrezza
Copy link
Member

mtrezza commented Jun 7, 2023

Note: Bounty is for the dashboard PR only, any Parse Server PR as mentioned above would receive a separate bounty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty:$20 Bounty applies for fixing this issue (Parse Bounty Program) type:feature New feature or improvement of existing feature
Projects
None yet
Development

No branches or pull requests

3 participants