-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
fix: Setting Parse Server option masterKeyIps: []
doesn't disable all IP addresses
#8339
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
base: alpha
Are you sure you want to change the base?
Conversation
I will reformat the title to use the proper commit message syntax. |
Thanks for opening this pull request!
|
Codecov ReportBase: 94.24% // Head: 94.25% // Increases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## alpha #8339 +/- ##
==========================================
+ Coverage 94.24% 94.25% +0.01%
==========================================
Files 180 180
Lines 13977 13976 -1
==========================================
+ Hits 13172 13173 +1
+ Misses 805 803 -2
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think the logic here is:
masterKeyIps: []
: disable masterKey from anywhere
masterKeyIps: ["0.0.0.0/0"]
: allow masterKey from anywhere
src/ParseServer.js
Outdated
options.masterKeyIps = | ||
options.masterKeyIps?.length > 0 | ||
? Array.from( | ||
new Set(options.masterKeyIps.concat(defaults.masterKeyIps, options.masterKeyIps)) | ||
) | ||
: []; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options.masterKeyIps = | |
options.masterKeyIps?.length > 0 | |
? Array.from( | |
new Set(options.masterKeyIps.concat(defaults.masterKeyIps, options.masterKeyIps)) | |
) | |
: []; |
I think these lines can be removed completely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
yeah looking closer, fully agreed 😄
I was actually confused initially and didn't want to make some shit, especially because I'm not being able to run tests locally due to this error. any ideas?
~/dev/parse-server fix/masterKeyIps
❯ npm test
> [email protected] pretest /Users/stewan/dev/parse-server
> cross-env MONGODB_VERSION=${MONGODB_VERSION:=5.3.2} MONGODB_TOPOLOGY=${MONGODB_TOPOLOGY:=standalone} mongodb-runner start
◝ Starting a MongoDB deployment to test against...Error: Could not find download URL for version 5.3.2 {
version: '5.3.2',
arch: [ 'arm64', 'aarch64' ],
platform: 'darwin',
target: [
{ value: 'osx', priority: 1 },
{ value: 'osx-ssl', priority: 10 },
{ value: 'darwin', priority: 1 },
{ value: 'macos', priority: 1 }
],
enterprise: false,
cryptd: false
}
at resolve (/Users/stewan/dev/parse-server/node_modules/mongodb-download-url/lib/index.js:177:15)
at async getDownloadURL (/Users/stewan/dev/parse-server/node_modules/mongodb-download-url/lib/index.js:242:12)
npm ERR! Test failed. See above for more details.
masterKeyIps: []: disable masterKey from anywhere masterKeyIps: ["0.0.0.0/0"]: allow masterKey from anywhere Co-authored-by: Daniel <[email protected]>
Co-authored-by: Daniel <[email protected]>
I'm closing this PR since the way to "disable" or allow all IPs is to set
The reason you probably haven't seen this in the option docs is that the docs are only created for stable releases, so once Parse Sever 6.0.0 is released, the docs will also be updated. |
I will reformat the title to use the proper commit message syntax. |
masterKeyIps
to an empty array doesn't disable all IP addresses
masterKeyIps
to an empty array doesn't disable all IP addressesmasterKeyIps: []
doesn't disable all IP addresses
@@ -467,10 +467,6 @@ function injectDefaults(options: ParseServerOptions) { | |||
}); | |||
} | |||
}); | |||
|
|||
options.masterKeyIps = Array.from( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can this really just be removed and the issue is fixed?
cc @dblythy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe so. I will test and report back
New Pull Request Checklist
Issue Description
it's not quite working as expected, default ips are being concatenated to the user option. this PR aims to fix it.
Approach
TODOs before merging