fix: Server does not start via CLI when auth option is set (#8666)
This commit is contained in:
@@ -302,4 +302,25 @@ describe('execution', () => {
|
|||||||
done.fail(data.toString());
|
done.fail(data.toString());
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('can start Parse Server with auth via CLI', done => {
|
||||||
|
const env = { ...process.env };
|
||||||
|
env.NODE_OPTIONS = '--dns-result-order=ipv4first';
|
||||||
|
childProcess = spawn(
|
||||||
|
binPath,
|
||||||
|
['--databaseURI', databaseURI, './spec/configs/CLIConfigAuth.json'],
|
||||||
|
{ env }
|
||||||
|
);
|
||||||
|
childProcess.stdout.on('data', data => {
|
||||||
|
data = data.toString();
|
||||||
|
console.log(data);
|
||||||
|
if (data.includes('parse-server running on')) {
|
||||||
|
done();
|
||||||
|
}
|
||||||
|
});
|
||||||
|
childProcess.stderr.on('data', data => {
|
||||||
|
data = data.toString();
|
||||||
|
done.fail(data.toString());
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|||||||
11
spec/configs/CLIConfigAuth.json
Normal file
11
spec/configs/CLIConfigAuth.json
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
"appName": "test",
|
||||||
|
"appId": "test",
|
||||||
|
"masterKey": "test",
|
||||||
|
"logLevel": "error",
|
||||||
|
"auth": {
|
||||||
|
"facebook": {
|
||||||
|
"appIds": "test"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -103,7 +103,6 @@ module.exports.ParseServerOptions = {
|
|||||||
env: 'PARSE_SERVER_AUTH_PROVIDERS',
|
env: 'PARSE_SERVER_AUTH_PROVIDERS',
|
||||||
help:
|
help:
|
||||||
'Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication',
|
'Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication',
|
||||||
action: parsers.arrayParser,
|
|
||||||
},
|
},
|
||||||
cacheAdapter: {
|
cacheAdapter: {
|
||||||
env: 'PARSE_SERVER_CACHE_ADAPTER',
|
env: 'PARSE_SERVER_CACHE_ADAPTER',
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
* @property {Adapter<AnalyticsAdapter>} analyticsAdapter Adapter module for the analytics
|
* @property {Adapter<AnalyticsAdapter>} analyticsAdapter Adapter module for the analytics
|
||||||
* @property {String} appId Your Parse Application ID
|
* @property {String} appId Your Parse Application ID
|
||||||
* @property {String} appName Sets the app name
|
* @property {String} appName Sets the app name
|
||||||
* @property {AuthAdapter[]} auth Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
|
* @property {Object} auth Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
|
||||||
* @property {Adapter<CacheAdapter>} cacheAdapter Adapter module for the cache
|
* @property {Adapter<CacheAdapter>} cacheAdapter Adapter module for the cache
|
||||||
* @property {Number} cacheMaxSize Sets the maximum size for the in memory cache, defaults to 10000
|
* @property {Number} cacheMaxSize Sets the maximum size for the in memory cache, defaults to 10000
|
||||||
* @property {Number} cacheTTL Sets the TTL for the in memory cache (in ms), defaults to 5000 (5 seconds)
|
* @property {Number} cacheTTL Sets the TTL for the in memory cache (in ms), defaults to 5000 (5 seconds)
|
||||||
|
|||||||
@@ -149,7 +149,7 @@ export interface ParseServerOptions {
|
|||||||
allowCustomObjectId: ?boolean;
|
allowCustomObjectId: ?boolean;
|
||||||
/* Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
|
/* Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
|
||||||
:ENV: PARSE_SERVER_AUTH_PROVIDERS */
|
:ENV: PARSE_SERVER_AUTH_PROVIDERS */
|
||||||
auth: ?(AuthAdapter[]);
|
auth: ?{ [string]: AuthAdapter };
|
||||||
/* Max file size for uploads, defaults to 20mb
|
/* Max file size for uploads, defaults to 20mb
|
||||||
:DEFAULT: 20mb */
|
:DEFAULT: 20mb */
|
||||||
maxUploadSize: ?string;
|
maxUploadSize: ?string;
|
||||||
|
|||||||
Reference in New Issue
Block a user