mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-14 20:40:17 -05:00
Merge pull request #17034 from overleaf/dp-remove-access-token-encryptor-mongo-dependency
Remove mongodb dependency for libraries/access-token-encryptor GitOrigin-RevId: 47241e200df6a9cba34d1effc6ef3203ea95a8a7
This commit is contained in:
parent
32d2603adb
commit
19aaed64f8
3 changed files with 3 additions and 8 deletions
|
@ -21,9 +21,6 @@
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lodash": "^4.17.21"
|
"lodash": "^4.17.21"
|
||||||
},
|
},
|
||||||
"peerDependencies": {
|
|
||||||
"mongodb": "*"
|
|
||||||
},
|
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"chai": "^4.3.6",
|
"chai": "^4.3.6",
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
|
|
|
@ -1,4 +1,3 @@
|
||||||
const { ReadPreference } = require('mongodb')
|
|
||||||
const _ = require('lodash')
|
const _ = require('lodash')
|
||||||
const { formatTokenUsageStats } = require('./format-usage-stats')
|
const { formatTokenUsageStats } = require('./format-usage-stats')
|
||||||
|
|
||||||
|
@ -26,12 +25,14 @@ async function reEncryptTokens(accessTokenEncryptor, encryptedJson) {
|
||||||
* @param {AccessTokenEncryptor} accessTokenEncryptor
|
* @param {AccessTokenEncryptor} accessTokenEncryptor
|
||||||
* @param {Collection} collection
|
* @param {Collection} collection
|
||||||
* @param {Object} paths
|
* @param {Object} paths
|
||||||
|
* @param {Object} queryOptions
|
||||||
* @return {Promise<{}>}
|
* @return {Promise<{}>}
|
||||||
*/
|
*/
|
||||||
async function reEncryptTokensInCollection({
|
async function reEncryptTokensInCollection({
|
||||||
accessTokenEncryptor,
|
accessTokenEncryptor,
|
||||||
collection,
|
collection,
|
||||||
paths,
|
paths,
|
||||||
|
queryOptions,
|
||||||
}) {
|
}) {
|
||||||
const { collectionName } = collection
|
const { collectionName } = collection
|
||||||
const stats = {}
|
const stats = {}
|
||||||
|
@ -56,7 +57,7 @@ async function reEncryptTokensInCollection({
|
||||||
const cursor = collection.find(
|
const cursor = collection.find(
|
||||||
{},
|
{},
|
||||||
{
|
{
|
||||||
readPreference: ReadPreference.secondaryPreferred,
|
...queryOptions,
|
||||||
projection,
|
projection,
|
||||||
}
|
}
|
||||||
)
|
)
|
||||||
|
|
3
package-lock.json
generated
3
package-lock.json
generated
|
@ -90,9 +90,6 @@
|
||||||
"mocha": "^10.2.0",
|
"mocha": "^10.2.0",
|
||||||
"sandboxed-module": "^2.0.4",
|
"sandboxed-module": "^2.0.4",
|
||||||
"typescript": "^5.0.4"
|
"typescript": "^5.0.4"
|
||||||
},
|
|
||||||
"peerDependencies": {
|
|
||||||
"mongodb": "*"
|
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"libraries/eslint-plugin": {
|
"libraries/eslint-plugin": {
|
||||||
|
|
Loading…
Reference in a new issue