Skip to content

Commit 601da1e

Browse files
authored
fix: Server does not start via CLI when auth option is set (parse-community#8669)
1 parent e6374e7 commit 601da1e

File tree

5 files changed

+28
-3
lines changed

5 files changed

+28
-3
lines changed

spec/CLI.spec.js

+14
Original file line numberDiff line numberDiff line change
@@ -294,4 +294,18 @@ describe('execution', () => {
294294
done.fail(data.toString());
295295
});
296296
});
297+
298+
it('can start Parse Server with auth via CLI', done => {
299+
childProcess = spawn(binPath, ['./spec/configs/CLIConfigAuth.json'], { env: process.env });
300+
childProcess.stdout.on('data', data => {
301+
data = data.toString();
302+
if (data.includes('parse-server running on')) {
303+
done();
304+
}
305+
});
306+
childProcess.stderr.on('data', data => {
307+
data = data.toString();
308+
done.fail(data.toString());
309+
});
310+
});
297311
});

spec/configs/CLIConfigAuth.json

+11
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
{
2+
"appName": "test",
3+
"appId": "test",
4+
"masterKey": "test",
5+
"logLevel": "error",
6+
"auth": {
7+
"facebook": {
8+
"appIds": "test"
9+
}
10+
}
11+
}

src/Options/Definitions.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This code has been generated by resources/buildConfigDefinitions.js
44
Do not edit manually, but update Options/index.js
55
*/
66
var parsers = require('./parsers');
7+
78
module.exports.SchemaOptions = {
89
afterMigration: {
910
env: 'PARSE_SERVER_SCHEMA_AFTER_MIGRATION',
@@ -94,7 +95,6 @@ module.exports.ParseServerOptions = {
9495
env: 'PARSE_SERVER_AUTH_PROVIDERS',
9596
help:
9697
'Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication',
97-
action: parsers.arrayParser,
9898
},
9999
cacheAdapter: {
100100
env: 'PARSE_SERVER_CACHE_ADAPTER',

src/Options/docs.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
* @property {Adapter<AnalyticsAdapter>} analyticsAdapter Adapter module for the analytics
2020
* @property {String} appId Your Parse Application ID
2121
* @property {String} appName Sets the app name
22-
* @property {AuthAdapter[]} auth Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
22+
* @property {Object} auth Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
2323
* @property {Adapter<CacheAdapter>} cacheAdapter Adapter module for the cache
2424
* @property {Number} cacheMaxSize Sets the maximum size for the in memory cache, defaults to 10000
2525
* @property {Number} cacheTTL Sets the TTL for the in memory cache (in ms), defaults to 5000 (5 seconds)

src/Options/index.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -140,7 +140,7 @@ export interface ParseServerOptions {
140140
allowCustomObjectId: ?boolean;
141141
/* Configuration for your authentication providers, as stringified JSON. See http://docs.parseplatform.org/parse-server/guide/#oauth-and-3rd-party-authentication
142142
:ENV: PARSE_SERVER_AUTH_PROVIDERS */
143-
auth: ?(AuthAdapter[]);
143+
auth: ?{ [string]: AuthAdapter };
144144
/* Max file size for uploads, defaults to 20mb
145145
:DEFAULT: 20mb */
146146
maxUploadSize: ?string;

0 commit comments

Comments
 (0)