You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Here's a script that loads the configuration file, then explicitly checks that there are no file-paths configured in the config
import{logger}from'./lib/logger.js';importenvironfrom'./lib/environ.js';import{RevolverConfig}from'./lib/config.js';/** * Validate the configuration provided by $CONFIG_FILE environment variable * @returns a parsed and validated configuration object */
async functionvalidateConfig(): Promise<object>{// Note: configuration is not especially strict (unknown keys are ignored/stripped)const config =await(environ.configPath
? RevolverConfig.readConfigFromFile(environ.configPath)
: RevolverConfig.readConfigFromS3(environ.configBucket!,environ.configKey!));// Check that NONE of the file-output parameters are specifiedconstfilePaths=[config.defaults.settings.resourceLog?.json?.file,config.defaults.settings.resourceLog?.html?.file,config.defaults.settings.resourceLog?.csv?.file,config.defaults.settings.auditLog?.html?.file,config.defaults.settings.auditLog?.csv?.file,config.defaults.settings.auditLog?.json?.file,config.defaults.settings.localResourcesFile,config.defaults.settings.localOrgAccountsFile,config.defaults.settings.localOrgAccountsWriteFile,];constfound=filePaths.filter((p)=>p!==undefined);if(found.length>0){throwError(`Found file-paths specified in config file: ${found}`);}returnconfig;}validateConfig().then((config)=>logger.info('Dumping validated configuration',config));
No description provided.
The text was updated successfully, but these errors were encountered: