Skip to content

fix: Cannot pass useMasterKey: false to Parse.Cloud.run #2431

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

Merged
merged 5 commits into from
Feb 11, 2025

Conversation

dplewis
Copy link
Member

@dplewis dplewis commented Feb 8, 2025

Pull Request

Issue

useMasterKey false is omitted meaning usingParse.cloud.run in a node or cloud environment will always results in useMasterKey true to be passed.

// RESTController.ts
let useMasterKey = options.useMasterKey;
if (typeof useMasterKey === 'undefined') {
  useMasterKey = CoreManager.get('USE_MASTER_KEY');
}

Approach

Properly handle useMasterKey check

Tasks

  • Add tests
  • Add changes to documentation (guides, repository pages, code comments)

Copy link

Thanks for opening this pull request!

  • ❌ Please link an issue that describes the reason for this pull request, otherwise your pull request will be closed. Make sure to write it as Closes: #123 in the PR description, so I can recognize it.

@dplewis dplewis requested a review from a team February 8, 2025 20:26
Copy link

codecov bot commented Feb 8, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 100.00%. Comparing base (360bc5f) to head (e7ac670).
Report is 31 commits behind head on alpha.

Additional details and impacted files
@@            Coverage Diff            @@
##             alpha     #2431   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           64        64           
  Lines         6392      6392           
  Branches      1520      1524    +4     
=========================================
  Hits          6392      6392           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mtrezza mtrezza merged commit abadac9 into parse-community:alpha Feb 11, 2025
12 checks passed
parseplatformorg pushed a commit that referenced this pull request Feb 11, 2025
# [5.3.0-alpha.5](5.3.0-alpha.4...5.3.0-alpha.5) (2025-02-11)

### Bug Fixes

* Cannot pass `useMasterKey: false` to `Parse.Cloud.run` ([#2431](#2431)) ([abadac9](abadac9))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 5.3.0-alpha.5

@parseplatformorg parseplatformorg added the state:released-alpha Released as alpha version label Feb 11, 2025
@dplewis dplewis deleted the cloud-run-usemasterkey branch February 11, 2025 22:05
parseplatformorg pushed a commit that referenced this pull request Mar 2, 2025
# [6.0.0](5.3.0...6.0.0) (2025-03-02)

### Bug Fixes

* `Parse.Hooks` requests have double forward slash in URL ([#2441](#2441)) ([1fc520c](1fc520c))
* `Parse.Query.findAll` not returning all objects with option `json: true` ([#2449](#2449)) ([f160b8c](f160b8c))
* Cannot pass `useMasterKey: false` to `Parse.Cloud.run` ([#2431](#2431)) ([abadac9](abadac9))
* Remove validation error handler option `error` from various methods of `Parse.Object` ([#2445](#2445)) ([52ddaee](52ddaee))
* Security upgrade dset from 3.1.3 to 3.1.4 ([#2277](#2277)) ([058f8e4](058f8e4))

### Features

* Add transaction to save and destroy on `Parse.Object` ([#2265](#2265)) ([2b55bdf](2b55bdf))

### BREAKING CHANGES

* Internal REST requests for `Parse.Hooks` use a URL that contains a double forward slash, for example `http://localhost/parse//hooks/functions`. This release changes the double forward slash to a single forward slash. ([1fc520c](1fc520c))
* Removes the error handler option `error` from `Parse.Object.set`, `Parse.Object.setACL`, `Parse.Object.unset`, `Parse.Role.setName` and instead throws on validation error. Previously, if the `error` option was set, the handler was invoked if a validation error occurred on `Parse.Object.set`, and if no handler was set, an error was thrown on `Parse.Object.save`. The new behavior is that an error is thrown at `Parse.Object.set`. For example, instead of using `Parse.Object.set(key, value, { error: ... })` wrap `Parse.Object.set(key, value)` into a `try/catch` block. ([52ddaee](52ddaee))
@parseplatformorg
Copy link
Contributor

🎉 This change has been released in version 6.0.0

@parseplatformorg parseplatformorg added the state:released Released as stable version label Mar 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
state:released Released as stable version state:released-alpha Released as alpha version
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants