[api] Allow for `secure` to be simply a secret string.

master
indexzero 2015-09-18 20:44:29 -07:00
parent 2de2bc0b66
commit 442d2b4233
1 changed files with 4 additions and 0 deletions

View File

@ -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');