-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
feat: Prevent Parse Server start in case of unknown option in server configuration #8987
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
Changes from 32 commits
Commits
Show all changes
33 commits
Select commit
Hold shift + click to select a range
b3924bd
feat: Log warning in case of a unknown options
vivekjoshi556 70e7a02
Merge branch 'parse-community:alpha' into issue_8938
vivekjoshi556 99a03d2
fix: splitting test cases | ignored internal configs | covered all co…
vivekjoshi556 a9e7875
fix: resolve conflicts
vivekjoshi556 946d4b4
Merge branch 'alpha' into issue_8938
mtrezza b70592e
doc: included documentation for using this feature
vivekjoshi556 e791e40
Merge branch 'issue_8938' of https://github.com/vivekjoshi556/parse-s…
vivekjoshi556 d4ab4f0
Apply suggestions from code review
vivekjoshi556 e9311b3
fix: CacheAdapter does not connect when using a CacheAdapter with a J…
dblythy 8aaa172
chore(release): 7.0.0-alpha.27 [skip ci]
semantic-release-bot 8ef8f54
test: Fix flaky tests for comment in MongoDB query (#9015)
Meglali20 80fb070
refactor: Security upgrade follow-redirects from 1.15.5 to 1.15.6 (#9…
parseplatformorg 79f41fc
Update src/ParseServer.js
vivekjoshi556 93022fe
fix: error message on server crash
vivekjoshi556 b754139
Merge branch 'alpha' into issue_8938
mtrezza 7819bdb
refactor: removing duplication
vivekjoshi556 744fb9e
Merge branch 'alpha' into issue_8938
mtrezza 05ce806
refactor: removing duplication
vivekjoshi556 49fdbf4
Merge branch 'issue_8938' of https://github.com/vivekjoshi556/parse-s…
vivekjoshi556 c5c2b5d
fix: import error
vivekjoshi556 53f1d93
nits
mtrezza e333d73
suggestion
mtrezza 2297f47
Update ParseServer.js
mtrezza 3ce2ae6
Merge branch 'alpha' into issue_8938
mtrezza 753bbd8
refactor
mtrezza 2c058d8
remove centralized logic suggestion
mtrezza 024c154
refactor
mtrezza 7699453
Merge branch 'alpha' into issue_8938
mtrezza b25cfef
refactor: v2
vivekjoshi556 adfed9d
Merge branch 'issue_8938' of https://github.com/vivekjoshi556/parse-s…
vivekjoshi556 5756cca
docs: reverting contributing guidelines
vivekjoshi556 f9ed251
Merge branch 'alpha' into issue_8938
mtrezza 7ac43a5
removing empty newlines
mtrezza File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
const Config = require('../lib/Config'); | ||
const ParseServer = require('../lib/index').ParseServer; | ||
|
||
describe('Config Keys', () => { | ||
const tests = [ | ||
{ | ||
name: 'Invalid Root Keys', | ||
options: { unknow: 'val', masterKeyIPs: '' }, | ||
error: 'unknow, masterKeyIPs', | ||
}, | ||
{ name: 'Invalid Schema Keys', options: { schema: { Strict: 'val' } }, error: 'schema.Strict' }, | ||
{ | ||
name: 'Invalid Pages Keys', | ||
options: { pages: { customUrls: { EmailVerificationSendFail: 'val' } } }, | ||
error: 'pages.customUrls.EmailVerificationSendFail', | ||
}, | ||
{ | ||
name: 'Invalid LiveQueryServerOptions Keys', | ||
options: { liveQueryServerOptions: { MasterKey: 'value' } }, | ||
error: 'liveQueryServerOptions.MasterKey', | ||
}, | ||
{ | ||
name: 'Invalid RateLimit Keys - Array Item', | ||
options: { rateLimit: [{ RequestPath: '' }, { RequestTimeWindow: '' }] }, | ||
error: 'rateLimit[0].RequestPath, rateLimit[1].RequestTimeWindow', | ||
}, | ||
]; | ||
|
||
tests.forEach(test => { | ||
it(test.name, async () => { | ||
const logger = require('../lib/logger').logger; | ||
spyOn(logger, 'error').and.callThrough(); | ||
spyOn(Config, 'validateOptions').and.callFake(() => {}); | ||
|
||
new ParseServer({ | ||
...defaultConfiguration, | ||
...test.options, | ||
}); | ||
expect(logger.error).toHaveBeenCalledWith(`Invalid Option Keys Found: ${test.error}`); | ||
}); | ||
}); | ||
|
||
it('should run fine', async () => { | ||
try { | ||
await reconfigureServer({ | ||
...defaultConfiguration, | ||
}); | ||
} catch (err) { | ||
fail('Should run without error'); | ||
} | ||
}); | ||
}); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.