|
@@ -1,21 +1,14 @@
|
|
|
const SAMLUserIdAttributeBatchHandler = require('../modules/overleaf-integration/app/src/SAML/SAMLUserIdAttributeBatchHandler')
|
|
const SAMLUserIdAttributeBatchHandler = require('../modules/overleaf-integration/app/src/SAML/SAMLUserIdAttributeBatchHandler')
|
|
|
|
|
|
|
|
-const COMMIT = process.argv.includes('--commit')
|
|
|
|
|
const startInstitutionId = parseInt(process.argv[2])
|
|
const startInstitutionId = parseInt(process.argv[2])
|
|
|
const endInstitutionId = parseInt(process.argv[3])
|
|
const endInstitutionId = parseInt(process.argv[3])
|
|
|
|
|
|
|
|
process.env.LOG_LEVEL = 'info'
|
|
process.env.LOG_LEVEL = 'info'
|
|
|
|
|
|
|
|
-let method = 'check'
|
|
|
|
|
-if (COMMIT) {
|
|
|
|
|
- method = 'run'
|
|
|
|
|
- console.log('Setting attribute for linked users')
|
|
|
|
|
-} else {
|
|
|
|
|
- process.env.MONGO_CONNECTION_STRING =
|
|
|
|
|
- process.env.READ_ONLY_MONGO_CONNECTION_STRING
|
|
|
|
|
- console.log('Doing a dry run without --commit')
|
|
|
|
|
- console.log('Checking users at institutions')
|
|
|
|
|
-}
|
|
|
|
|
|
|
+process.env.MONGO_CONNECTION_STRING =
|
|
|
|
|
+ process.env.READ_ONLY_MONGO_CONNECTION_STRING
|
|
|
|
|
+
|
|
|
|
|
+console.log('Checking users at institutions')
|
|
|
|
|
|
|
|
console.log(
|
|
console.log(
|
|
|
'Start institution ID:',
|
|
'Start institution ID:',
|
|
@@ -27,7 +20,7 @@ console.log(
|
|
|
endInstitutionId || 'none provided, will go to end of ordered list.'
|
|
endInstitutionId || 'none provided, will go to end of ordered list.'
|
|
|
)
|
|
)
|
|
|
|
|
|
|
|
-SAMLUserIdAttributeBatchHandler[method](startInstitutionId, endInstitutionId)
|
|
|
|
|
|
|
+SAMLUserIdAttributeBatchHandler.check(startInstitutionId, endInstitutionId)
|
|
|
.then(result => {
|
|
.then(result => {
|
|
|
console.log(result)
|
|
console.log(result)
|
|
|
process.exit(0)
|
|
process.exit(0)
|