[api] Allow for secure
to be simply a secret string.
This commit is contained in:
parent
2de2bc0b66
commit
442d2b4233
1 changed files with 4 additions and 0 deletions
|
@ -36,6 +36,10 @@ var File = exports.File = function (options) {
|
||||||
|| 2;
|
|| 2;
|
||||||
|
|
||||||
if (this.secure) {
|
if (this.secure) {
|
||||||
|
this.secure = typeof this.secure === 'string'
|
||||||
|
? { secret: this.secure }
|
||||||
|
: this.secure;
|
||||||
|
|
||||||
this.secure.alg = this.secure.alg || 'aes-256-ctr';
|
this.secure.alg = this.secure.alg || 'aes-256-ctr';
|
||||||
if (this.secure.secretPath) {
|
if (this.secure.secretPath) {
|
||||||
this.secret = fs.readFileSync(this.secure.secretPath, 'utf8');
|
this.secret = fs.readFileSync(this.secure.secretPath, 'utf8');
|
||||||
|
|
Loading…
Reference in a new issue