Update uuid to the latest version 🚀 (#6659)
* fix(package): update uuid to version 8.0.0 * chore(package): update lockfile package-lock.json * remove deprecated uuid/v4 * use uuidv4 as default Co-authored-by: greenkeeper[bot] <23040076+greenkeeper[bot]@users.noreply.github.com> Co-authored-by: Diamond Lewis <findlewis@gmail.com>
This commit is contained in:
17
package-lock.json
generated
17
package-lock.json
generated
@@ -7864,6 +7864,12 @@
|
|||||||
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
"resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz",
|
||||||
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
"integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==",
|
||||||
"dev": true
|
"dev": true
|
||||||
|
},
|
||||||
|
"uuid": {
|
||||||
|
"version": "3.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
|
||||||
|
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==",
|
||||||
|
"dev": true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -10920,6 +10926,11 @@
|
|||||||
"combined-stream": "^1.0.6",
|
"combined-stream": "^1.0.6",
|
||||||
"mime-types": "^2.1.12"
|
"mime-types": "^2.1.12"
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"uuid": {
|
||||||
|
"version": "3.4.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
|
||||||
|
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
@@ -12373,9 +12384,9 @@
|
|||||||
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
|
"integrity": "sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM="
|
||||||
},
|
},
|
||||||
"uuid": {
|
"uuid": {
|
||||||
"version": "3.4.0",
|
"version": "8.0.0",
|
||||||
"resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz",
|
"resolved": "https://registry.npmjs.org/uuid/-/uuid-8.0.0.tgz",
|
||||||
"integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A=="
|
"integrity": "sha512-jOXGuXZAWdsTH7eZLtyXMqUb9EcWMGZNbL9YcGBJl4MH4nrxHmZJhEHvyLFrkxo+28uLb/NYRcStH48fnD0Vzw=="
|
||||||
},
|
},
|
||||||
"v8-compile-cache": {
|
"v8-compile-cache": {
|
||||||
"version": "2.1.0",
|
"version": "2.1.0",
|
||||||
|
|||||||
@@ -52,7 +52,7 @@
|
|||||||
"semver": "7.3.2",
|
"semver": "7.3.2",
|
||||||
"subscriptions-transport-ws": "0.9.16",
|
"subscriptions-transport-ws": "0.9.16",
|
||||||
"tv4": "1.3.0",
|
"tv4": "1.3.0",
|
||||||
"uuid": "3.4.0",
|
"uuid": "8.0.0",
|
||||||
"winston": "3.2.1",
|
"winston": "3.2.1",
|
||||||
"winston-daily-rotate-file": "4.4.2",
|
"winston-daily-rotate-file": "4.4.2",
|
||||||
"ws": "7.2.5"
|
"ws": "7.2.5"
|
||||||
@@ -122,7 +122,9 @@
|
|||||||
"url": "https://opencollective.com/parse-server",
|
"url": "https://opencollective.com/parse-server",
|
||||||
"logo": "https://opencollective.com/parse-server/logo.txt?reverse=true&variant=binary"
|
"logo": "https://opencollective.com/parse-server/logo.txt?reverse=true&variant=binary"
|
||||||
},
|
},
|
||||||
"publishConfig": { "registry": "https://npm.pkg.github.com/" },
|
"publishConfig": {
|
||||||
|
"registry": "https://npm.pkg.github.com/"
|
||||||
|
},
|
||||||
"funding": {
|
"funding": {
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
"url": "https://opencollective.com/parse-server"
|
"url": "https://opencollective.com/parse-server"
|
||||||
|
|||||||
@@ -29,7 +29,7 @@ const {
|
|||||||
const { ParseServer } = require('../');
|
const { ParseServer } = require('../');
|
||||||
const { ParseGraphQLServer } = require('../lib/GraphQL/ParseGraphQLServer');
|
const { ParseGraphQLServer } = require('../lib/GraphQL/ParseGraphQLServer');
|
||||||
const ReadPreference = require('mongodb').ReadPreference;
|
const ReadPreference = require('mongodb').ReadPreference;
|
||||||
const uuidv4 = require('uuid/v4');
|
const { v4: uuidv4 } = require('uuid');
|
||||||
|
|
||||||
function handleError(e) {
|
function handleError(e) {
|
||||||
if (
|
if (
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { matchesQuery, queryHash } from './QueryTools';
|
|||||||
import { ParsePubSub } from './ParsePubSub';
|
import { ParsePubSub } from './ParsePubSub';
|
||||||
import SchemaController from '../Controllers/SchemaController';
|
import SchemaController from '../Controllers/SchemaController';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import uuid from 'uuid';
|
import { v4 as uuidv4 } from 'uuid';
|
||||||
import { runLiveQueryEventHandlers } from '../triggers';
|
import { runLiveQueryEventHandlers } from '../triggers';
|
||||||
import { getAuthForSessionToken, Auth } from '../Auth';
|
import { getAuthForSessionToken, Auth } from '../Auth';
|
||||||
import { getCacheController } from '../Controllers';
|
import { getCacheController } from '../Controllers';
|
||||||
@@ -60,7 +60,7 @@ class ParseLiveQueryServer {
|
|||||||
// Initialize websocket server
|
// Initialize websocket server
|
||||||
this.parseWebSocketServer = new ParseWebSocketServer(
|
this.parseWebSocketServer = new ParseWebSocketServer(
|
||||||
server,
|
server,
|
||||||
parseWebsocket => this._onConnect(parseWebsocket),
|
(parseWebsocket) => this._onConnect(parseWebsocket),
|
||||||
config
|
config
|
||||||
);
|
);
|
||||||
|
|
||||||
@@ -165,13 +165,13 @@ class ParseLiveQueryServer {
|
|||||||
// Check ACL
|
// Check ACL
|
||||||
return this._matchesACL(acl, client, requestId);
|
return this._matchesACL(acl, client, requestId);
|
||||||
})
|
})
|
||||||
.then(isMatched => {
|
.then((isMatched) => {
|
||||||
if (!isMatched) {
|
if (!isMatched) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
client.pushDelete(requestId, deletedParseObject);
|
client.pushDelete(requestId, deletedParseObject);
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
logger.error('Matching ACL error : ', error);
|
logger.error('Matching ACL error : ', error);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@@ -298,7 +298,7 @@ class ParseLiveQueryServer {
|
|||||||
originalParseObject
|
originalParseObject
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
error => {
|
(error) => {
|
||||||
logger.error('Matching ACL error : ', error);
|
logger.error('Matching ACL error : ', error);
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@@ -308,7 +308,7 @@ class ParseLiveQueryServer {
|
|||||||
}
|
}
|
||||||
|
|
||||||
_onConnect(parseWebsocket: any): void {
|
_onConnect(parseWebsocket: any): void {
|
||||||
parseWebsocket.on('message', request => {
|
parseWebsocket.on('message', (request) => {
|
||||||
if (typeof request === 'string') {
|
if (typeof request === 'string') {
|
||||||
try {
|
try {
|
||||||
request = JSON.parse(request);
|
request = JSON.parse(request);
|
||||||
@@ -426,10 +426,10 @@ class ParseLiveQueryServer {
|
|||||||
cacheController: this.cacheController,
|
cacheController: this.cacheController,
|
||||||
sessionToken: sessionToken,
|
sessionToken: sessionToken,
|
||||||
})
|
})
|
||||||
.then(auth => {
|
.then((auth) => {
|
||||||
return { auth, userId: auth && auth.user && auth.user.id };
|
return { auth, userId: auth && auth.user && auth.user.id };
|
||||||
})
|
})
|
||||||
.catch(error => {
|
.catch((error) => {
|
||||||
// There was an error with the session token
|
// There was an error with the session token
|
||||||
const result = {};
|
const result = {};
|
||||||
if (error && error.code === Parse.Error.INVALID_SESSION_TOKEN) {
|
if (error && error.code === Parse.Error.INVALID_SESSION_TOKEN) {
|
||||||
@@ -523,7 +523,7 @@ class ParseLiveQueryServer {
|
|||||||
return Promise.resolve()
|
return Promise.resolve()
|
||||||
.then(async () => {
|
.then(async () => {
|
||||||
// Resolve false right away if the acl doesn't have any roles
|
// Resolve false right away if the acl doesn't have any roles
|
||||||
const acl_has_roles = Object.keys(acl.permissionsById).some(key =>
|
const acl_has_roles = Object.keys(acl.permissionsById).some((key) =>
|
||||||
key.startsWith('role:')
|
key.startsWith('role:')
|
||||||
);
|
);
|
||||||
if (!acl_has_roles) {
|
if (!acl_has_roles) {
|
||||||
@@ -581,7 +581,7 @@ class ParseLiveQueryServer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
const hasMasterKey = this._hasMasterKey(request, this.keyPairs);
|
const hasMasterKey = this._hasMasterKey(request, this.keyPairs);
|
||||||
const clientId = uuid();
|
const clientId = uuidv4();
|
||||||
const client = new Client(
|
const client = new Client(
|
||||||
clientId,
|
clientId,
|
||||||
parseWebsocket,
|
parseWebsocket,
|
||||||
|
|||||||
Reference in New Issue
Block a user