2024-10-30 10:23:34 -04:00
|
|
|
import SAMLUserIdAttributeBatchHandler from '../modules/saas-authentication/app/src/SAML/SAMLUserIdAttributeBatchHandler.mjs'
|
2022-06-07 10:31:59 -04:00
|
|
|
|
|
|
|
const startInstitutionId = parseInt(process.argv[2])
|
|
|
|
const endInstitutionId = parseInt(process.argv[3])
|
|
|
|
|
|
|
|
process.env.LOG_LEVEL = 'info'
|
|
|
|
|
2022-06-14 04:14:03 -04:00
|
|
|
process.env.MONGO_CONNECTION_STRING =
|
|
|
|
process.env.READ_ONLY_MONGO_CONNECTION_STRING
|
|
|
|
|
|
|
|
console.log('Checking users at institutions')
|
2022-06-07 10:31:59 -04:00
|
|
|
|
|
|
|
console.log(
|
|
|
|
'Start institution ID:',
|
|
|
|
startInstitutionId ||
|
|
|
|
'none provided, will start at beginning of ordered list.'
|
|
|
|
)
|
|
|
|
console.log(
|
|
|
|
'End institution ID:',
|
|
|
|
endInstitutionId || 'none provided, will go to end of ordered list.'
|
|
|
|
)
|
|
|
|
|
2024-10-18 07:04:57 -04:00
|
|
|
try {
|
|
|
|
const result = await SAMLUserIdAttributeBatchHandler.check(
|
|
|
|
startInstitutionId,
|
|
|
|
endInstitutionId
|
|
|
|
)
|
|
|
|
console.log(result)
|
|
|
|
process.exit(0)
|
|
|
|
} catch (error) {
|
|
|
|
console.error(error)
|
|
|
|
process.exit(1)
|
|
|
|
}
|