async function fetchConfigFromSecretsManager() {
	// Get Secrets Manager Config Key from File since we cannot use environment variables.
	if (secretId == undefined) {
		try {
			secretId = fs.readFileSync('./okta-key.txt', 'utf-8');
			secretId = secretId.replace(/(\r\n|\n|\r)/gm, '');
		} catch (err) {
			log.error(err);
		}
	} // Attempted to read from CloudFront Custom Header due to Environment variable limitations // Must be an Origin Request, but we need this to be a Viewer Request.
	const secret = await deps.sm.getSecretValue({ SecretId: secretId }).promise(); // eslint-disable-next-line no-buffer-constructor
	const buff = new Buffer(JSON.parse(secret.SecretString).config, 'base64');
	log.info('base64 config value', { buff });
	const decodedval = JSON.parse(buff.toString('utf-8'));
	log.info('base64 decoded value', { decodedval });
	return decodedval;
}
// fetchConfigFromSecretsManager pulls the specified configuration from SecretsManager
fetchConfigFromSecretsManager pulls the specified configuration from SecretsManager
fetchConfigFromSecretsManager pulls the specified configuration from SecretsManager
async function fetchConfigFromSecretsManager() {
	if (secretId == undefined) {
		try {
			secretId = fs.readFileSync('./okta-key.txt', 'utf-8');
			secretId = secretId.replace(/(\r\n|\n|\r)/gm, '');
		} catch (err) {
			log.error(err);
		}
	} 
	const secret = await deps.sm.getSecretValue({ SecretId: secretId }).promise(); 
	const buff = new Buffer(JSON.parse(secret.SecretString).config, 'base64');
	log.info('base64 config value', { buff });
	const decodedval = JSON.parse(buff.toString('utf-8'));
	log.info('base64 decoded value', { decodedval });
	return decodedval;
}
async function fetchConfigFromSecretsManager ( ) { if ( secretId == undefined ) { try { secretId = fs . readFileSync ( './okta-key.txt' , 'utf-8' ) ; secretId = secretId . replace ( / (\r\n|\n|\r) / gm , '' ) ; } catch ( err ) { log . error ( err ) ; } } const secret = await deps . sm . getSecretValue ( { SecretId : secretId } ) . promise ( ) ; const buff = new Buffer ( JSON . parse ( secret . SecretString ) . config , 'base64' ) ; log . info ( 'base64 config value' , { buff } ) ; const decodedval = JSON . parse ( buff . toString ( 'utf-8' ) ) ; log . info ( 'base64 decoded value' , { decodedval } ) ; return decodedval ; }
fetchConfigFromSecretsManager pulls the specified configuration from SecretsManager
fetchConfigFromSecretsManager pulls the specified configuration from SecretsManager
// Get Secrets Manager Config Key from File since we cannot use environment variables. // Attempted to read from CloudFront Custom Header due to Environment variable limitations // Must be an Origin Request, but we need this to be a Viewer Request. // eslint-disable-next-line no-buffer-constructor