Closed ndushay closed 5 years ago
Your comments make me inclined to get rid of the methods you so thoughtfully put in authenticateClient to get config values out of the constructor -- it seems just as clear, if not more so, for the constructor to set the vars directly:
(in constructor)
// Extracting these to methods makes for easier testing
this.userPoolId = this.userPoolIdFromConfig()
...
/**
* @private
*/
userPoolIdFromConfig() {
config.get('userPoolId')
}
vs
this.userPoolId = config.get('userPoolId')
I'm inclined to go with the latter - any objection?
Do you think this reference should be in config as well? process.env.COGNITO_ADMIN_PASSWORD
?
I don't want to encourage that being put in the code anywhere, but I could add a comment to that effect in the config ...
@ndushay :speech_balloon:
Your comments make me inclined to get rid of the methods you so thoughtfully put in authenticateClient to get config values out of the constructor -- it seems just as clear, if not more so, for the constructor to set the vars directly:
(in constructor) // Extracting these to methods makes for easier testing this.userPoolId = this.userPoolIdFromConfig() ... /** * @private */ userPoolIdFromConfig() { config.get('userPoolId') }
vs
this.userPoolId = config.get('userPoolId')
I'm inclined to go with the latter - any objection?
:100: agree! We can/should use config.get()
everywhere.
@ndushay :speech_balloon:
Do you think this reference should be in config as well?
process.env.COGNITO_ADMIN_PASSWORD
?I don't want to encourage that being put in the code anywhere, but I could add a comment to that effect in the config ...
Yeah, ideally all stuff injected via env would live in our config. It's OK if the default value is ''
or null
or undefined
, I reckon.
Using ENV vars when available will allow the
populateEmptyTrellis
script (a.k.a.bin/migrate
) to be run against all the AWS deployed containers.This approach accommodates the different trellis instances (local, dev, stage, prod) and the different AWS Cognito pools (development, staging, production). It is necessary prep work for #58, #59, and #60.
This PR accomplishes much of #63 but doesn't quite close it as these still remain: