Skip to content

Commit

Permalink
[api] Allow for secure to be simply a secret string.
Browse files Browse the repository at this point in the history
  • Loading branch information
indexzero committed Sep 19, 2015
1 parent 2de2bc0 commit 442d2b4
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/nconf/stores/file.js
Expand Up @@ -36,6 +36,10 @@ var File = exports.File = function (options) {
|| 2;

if (this.secure) {
this.secure = typeof this.secure === 'string'
? { secret: this.secure }
: this.secure;

this.secure.alg = this.secure.alg || 'aes-256-ctr';
if (this.secure.secretPath) {
this.secret = fs.readFileSync(this.secure.secretPath, 'utf8');
Expand Down

0 comments on commit 442d2b4

Please sign in to comment.