feat: Restrict use of masterKey to localhost by default (#8281)

BREAKING CHANGE: This release restricts the use of `masterKey` to localhost by default; if you are using Parse Dashboard on a different server to connect to Parse Server you need to add the IP address of the server that hosts Parse Dashboard to this option (#8281)
This commit is contained in:
dblythy
2022-11-11 13:24:48 +11:00
committed by GitHub
parent 7336afc562
commit 6c16021a1f
10 changed files with 98 additions and 100 deletions

View File

@@ -435,9 +435,12 @@ export class Config {
}
static validateMasterKeyIps(masterKeyIps) {
for (const ip of masterKeyIps) {
for (let ip of masterKeyIps) {
if (ip.includes('/')) {
ip = ip.split('/')[0];
}
if (!net.isIP(ip)) {
throw `Invalid ip in masterKeyIps: ${ip}`;
throw `The Parse Server option "masterKeyIps" contains an invalid IP address "${ip}".`;
}
}
}