backwards compat

This commit is contained in:
AJ ONeal 2016-08-01 20:07:54 -04:00
parent ee48f4a477
commit 3bab5857dd
2 changed files with 15 additions and 3 deletions

View File

@ -358,10 +358,18 @@ module.exports.create = function (deps) {
return handleErr(new Error("options.newCertUrl must be the new certificate url")); return handleErr(new Error("options.newCertUrl must be the new certificate url"));
} }
if (!options.accountKeypair) { if (!options.accountKeypair) {
return handleErr(new Error("options.accountKeypair must be an object with `privateKeyPem` and/or `privateKeyJwk`")); if (!options.accountPrivateKeyPem) {
return handleErr(new Error("options.accountKeypair must be an object with `privateKeyPem` and/or `privateKeyJwk`"));
}
console.warn("'accountPrivateKeyPem' is deprecated. Use options.accountKeypair.privateKeyPem instead.");
options.accountKeypair = RSA.import({ privateKeyPem: options.accountPrivateKeyPem });
} }
if (!options.domainKeypair) { if (!options.domainKeypair) {
return handleErr(new Error("options.domainKeypair must be an object with `privateKeyPem` and/or `privateKeyJwk`")); if (!options.domainPrivateKeyPem) {
return handleErr(new Error("options.domainKeypair must be an object with `privateKeyPem` and/or `privateKeyJwk`"));
}
console.warn("'domainPrivateKeyPem' is deprecated. Use options.domainKeypair.privateKeyPem instead.");
options.domainKeypair = RSA.import({ privateKeyPem: options.domainPrivateKeyPem });
} }
if (!options.setChallenge) { if (!options.setChallenge) {
return handleErr(new Error("options.setChallenge must be function(hostname, challengeKey, tokenValue, done) {}")); return handleErr(new Error("options.setChallenge must be function(hostname, challengeKey, tokenValue, done) {}"));

View File

@ -104,7 +104,11 @@ module.exports.create = function (deps) {
var state = {}; var state = {};
if (!options.accountKeypair) { if (!options.accountKeypair) {
return handleErr(new Error("options.accountKeypair must be an object with `privateKeyPem` and/or `privateKeyJwk`")); if (!options.accountPrivateKeyPem) {
return handleErr(new Error("options.accountKeypair must be an object with `privateKeyPem` and/or `privateKeyJwk`"));
}
console.warn("'accountPrivateKeyPem' is deprecated. Use options.accountKeypair.privateKeyPem instead.");
options.accountKeypair = RSA.import({ privateKeyPem: options.accountPrivateKeyPem });
} }
if (!options.agreeToTerms) { if (!options.agreeToTerms) {
cb(new Error("options.agreeToTerms must be function (tosUrl, fn => (err, true))")); cb(new Error("options.agreeToTerms must be function (tosUrl, fn => (err, true))"));