Skip to content

Commit 201993f

Browse files
authored
Merge branch 'alpha' into dot-notation-array
2 parents be36010 + d8ebdb3 commit 201993f

File tree

9 files changed

+986
-305
lines changed

9 files changed

+986
-305
lines changed

changelogs/CHANGELOG_alpha.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,17 @@
1+
# [7.1.0-alpha.8](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.7...7.1.0-alpha.8) (2024-05-16)
2+
3+
4+
### Features
5+
6+
* Upgrade to @parse/push-adapter 6.2.0 ([#9127](https://github.com/parse-community/parse-server/issues/9127)) ([ca20496](https://github.com/parse-community/parse-server/commit/ca20496f28e5ec1294a7a23c8559df82b79b2a04))
7+
8+
# [7.1.0-alpha.7](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.6...7.1.0-alpha.7) (2024-05-16)
9+
10+
11+
### Bug Fixes
12+
13+
* Facebook Limited Login not working due to incorrect domain in JWT validation ([#9122](https://github.com/parse-community/parse-server/issues/9122)) ([9d0bd2b](https://github.com/parse-community/parse-server/commit/9d0bd2badd6e5f7429d1af00b118225752e5d86a))
14+
115
# [7.1.0-alpha.6](https://github.com/parse-community/parse-server/compare/7.1.0-alpha.5...7.1.0-alpha.6) (2024-04-14)
216

317

package-lock.json

Lines changed: 927 additions & 293 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "parse-server",
3-
"version": "7.1.0-alpha.6",
3+
"version": "7.1.0-alpha.8",
44
"description": "An express module providing a Parse-compatible API server",
55
"main": "lib/index.js",
66
"repository": {
@@ -25,7 +25,7 @@
2525
"@graphql-tools/schema": "10.0.3",
2626
"@graphql-tools/utils": "8.12.0",
2727
"@parse/fs-files-adapter": "3.0.0",
28-
"@parse/push-adapter": "6.0.0",
28+
"@parse/push-adapter": "6.2.0",
2929
"bcryptjs": "2.4.3",
3030
"body-parser": "1.20.2",
3131
"commander": "12.0.0",

spec/AdapterLoader.spec.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,25 @@ describe('AdapterLoader', () => {
142142
}).not.toThrow();
143143
});
144144

145+
it('should load custom database adapter from config', done => {
146+
const adapterPath = require('path').resolve('./spec/support/MockDatabaseAdapter');
147+
const options = {
148+
databaseURI: 'oracledb://user:password@localhost:1521/freepdb1',
149+
collectionPrefix: '',
150+
};
151+
const databaseAdapterOptions = {
152+
adapter: adapterPath,
153+
options,
154+
};
155+
expect(() => {
156+
const databaseAdapter = loadAdapter(databaseAdapterOptions);
157+
expect(databaseAdapter).not.toBe(undefined);
158+
expect(databaseAdapter.options).toEqual(options);
159+
expect(databaseAdapter.getDatabaseURI()).toEqual(options.databaseURI);
160+
}).not.toThrow();
161+
done();
162+
});
163+
145164
it('should load file adapter from direct passing', done => {
146165
spyOn(console, 'warn').and.callFake(() => {});
147166
const mockFilesAdapter = new MockFilesAdapter('key', 'secret', 'bucket');

spec/AuthenticationAdapters.spec.js

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2047,7 +2047,7 @@ describe('facebook limited auth adapter', () => {
20472047

20482048
it('should use algorithm from key header to verify id_token', async () => {
20492049
const fakeClaim = {
2050-
iss: 'https://facebook.com',
2050+
iss: 'https://www.facebook.com',
20512051
aud: 'secret',
20522052
exp: Date.now(),
20532053
sub: 'the_user_id',
@@ -2097,7 +2097,7 @@ describe('facebook limited auth adapter', () => {
20972097

20982098
it('(using client id as string) should verify id_token', async () => {
20992099
const fakeClaim = {
2100-
iss: 'https://facebook.com',
2100+
iss: 'https://www.facebook.com',
21012101
aud: 'secret',
21022102
exp: Date.now(),
21032103
sub: 'the_user_id',
@@ -2117,7 +2117,7 @@ describe('facebook limited auth adapter', () => {
21172117

21182118
it('(using client id as array) should verify id_token', async () => {
21192119
const fakeClaim = {
2120-
iss: 'https://facebook.com',
2120+
iss: 'https://www.facebook.com',
21212121
aud: 'secret',
21222122
exp: Date.now(),
21232123
sub: 'the_user_id',
@@ -2137,7 +2137,7 @@ describe('facebook limited auth adapter', () => {
21372137

21382138
it('(using client id as array with multiple items) should verify id_token', async () => {
21392139
const fakeClaim = {
2140-
iss: 'https://facebook.com',
2140+
iss: 'https://www.facebook.com',
21412141
aud: 'secret',
21422142
exp: Date.now(),
21432143
sub: 'the_user_id',
@@ -2174,7 +2174,7 @@ describe('facebook limited auth adapter', () => {
21742174
fail();
21752175
} catch (e) {
21762176
expect(e.message).toBe(
2177-
'id token not issued by correct OpenID provider - expected: https://facebook.com | from: https://not.facebook.com'
2177+
'id token not issued by correct OpenID provider - expected: https://www.facebook.com | from: https://not.facebook.com'
21782178
);
21792179
}
21802180
});
@@ -2203,7 +2203,7 @@ describe('facebook limited auth adapter', () => {
22032203
fail();
22042204
} catch (e) {
22052205
expect(e.message).toBe(
2206-
'id token not issued by correct OpenID provider - expected: https://facebook.com | from: https://not.facebook.com'
2206+
'id token not issued by correct OpenID provider - expected: https://www.facebook.com | from: https://not.facebook.com'
22072207
);
22082208
}
22092209
});
@@ -2230,7 +2230,7 @@ describe('facebook limited auth adapter', () => {
22302230
fail();
22312231
} catch (e) {
22322232
expect(e.message).toBe(
2233-
'id token not issued by correct OpenID provider - expected: https://facebook.com | from: https://not.facebook.com'
2233+
'id token not issued by correct OpenID provider - expected: https://www.facebook.com | from: https://not.facebook.com'
22342234
);
22352235
}
22362236
});
@@ -2288,7 +2288,7 @@ describe('facebook limited auth adapter', () => {
22882288

22892289
it('should throw error with with invalid user id', async () => {
22902290
const fakeClaim = {
2291-
iss: 'https://facebook.com',
2291+
iss: 'https://www.facebook.com',
22922292
aud: 'invalid_client_id',
22932293
sub: 'a_different_user_id',
22942294
};

spec/helper.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ process.noDeprecation = true;
3535
const cache = require('../lib/cache').default;
3636
const defaults = require('../lib/defaults').default;
3737
const ParseServer = require('../lib/index').ParseServer;
38+
const loadAdapter = require('../lib/Adapters/AdapterLoader').loadAdapter;
3839
const path = require('path');
3940
const TestUtils = require('../lib/TestUtils');
4041
const GridFSBucketAdapter = require('../lib/Adapters/Files/GridFSBucketAdapter')
@@ -53,7 +54,10 @@ let databaseAdapter;
5354
let databaseURI;
5455
// need to bind for mocking mocha
5556

56-
if (process.env.PARSE_SERVER_TEST_DB === 'postgres') {
57+
if (process.env.PARSE_SERVER_DATABASE_ADAPTER) {
58+
databaseAdapter = JSON.parse(process.env.PARSE_SERVER_DATABASE_ADAPTER);
59+
databaseAdapter = loadAdapter(databaseAdapter);
60+
} else if (process.env.PARSE_SERVER_TEST_DB === 'postgres') {
5761
databaseURI = process.env.PARSE_SERVER_TEST_DATABASE_URI || postgresURI;
5862
databaseAdapter = new PostgresStorageAdapter({
5963
uri: databaseURI,

spec/support/MockDatabaseAdapter.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
module.exports = function (options) {
2+
return {
3+
options: options,
4+
send: function () {},
5+
getDatabaseURI: function () {
6+
return options.databaseURI;
7+
},
8+
};
9+
};

src/Adapters/Auth/facebook.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ const jwt = require('jsonwebtoken');
66
const httpsRequest = require('./httpsRequest');
77
const authUtils = require('./utils');
88

9-
const TOKEN_ISSUER = 'https://facebook.com';
9+
const TOKEN_ISSUER = 'https://www.facebook.com';
1010

1111
function getAppSecretPath(authData, options = {}) {
1212
const appSecret = options.appSecret;

src/cli/utils/runner.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ function logStartupOptions(options) {
66
}
77
// Keys that may include sensitive information that will be redacted in logs
88
const keysToRedact = [
9+
'databaseAdapter',
910
'databaseURI',
1011
'masterKey',
1112
'maintenanceKey',

0 commit comments

Comments
 (0)