From 442d2b42330402095e2c3615d4be57f776d9d9e5 Mon Sep 17 00:00:00 2001 From: indexzero Date: Fri, 18 Sep 2015 20:44:29 -0700 Subject: [PATCH] [api] Allow for `secure` to be simply a secret string. --- lib/nconf/stores/file.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/nconf/stores/file.js b/lib/nconf/stores/file.js index 0e7bc4e..2af56c8 100644 --- a/lib/nconf/stores/file.js +++ b/lib/nconf/stores/file.js @@ -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');