configuration files - Sails.js where to store security credentials? -
i store username , password database connection in
/config/connections.js where store more general aws credentials?
i imagine saving object below in file.
module.exports.aws = { key:'my key', secret: 'my token', bucket: 'my bucket' } and using this:
req.file('image') .upload({ adapter:require('skipper-s3'), key:aws.key, secret:aws.secret, bucket:aws.bucket, }, function whendone(err, uploadedfiles) { }
never store credentials in source code. use environment variables:
{ secret: process.env.my_secret }
Comments
Post a Comment