seems to pass tests

This commit is contained in:
AJ ONeal 2016-09-08 19:01:03 -06:00
parent 616538ed23
commit 7ae8e66815
2 changed files with 27 additions and 2 deletions

View File

@ -4,8 +4,8 @@
var PromiseA = require('bluebird');
var dns = PromiseA.promisifyAll(require('dns'));
//var DDNS = require('/Users/aj/Code/ddns-cli');
var DDNS = require('ddns-cli');
var DDNS = require('/Users/aj/Code/ddns-cli');
//var DDNS = require('ddns-cli');
var fs = require('fs');
var path = require('path');
@ -80,6 +80,7 @@ Challenge.set = function (args, domain, challenge, keyAuthorization, done) {
return DDNS.update({
email: args.email
, refreshToken: args.refreshToken
, silent: true
, name: challengeDomain
, type: "TXT"
@ -118,6 +119,7 @@ Challenge.remove = function (defaults, domain, challenge, done) {
return DDNS.update({
email: data.email
, refreshToken: data.refreshToken
, silent: true
, name: challengeDomain
, type: "TXT"

23
test.js Normal file
View File

@ -0,0 +1,23 @@
'use strict';
var leChallengeDns = require('./').create({
test: '_test_01'
, email: 'test@daplie.com'
, refreshToken: 'eyJ0eXAiOiJKV1QiLCJhbGciOiJSUzI1NiJ9.eyJqdGkiOiJjY2VmMjNlMGNjYWE1MDRlNDY0ZGEwZWQ4YTI3NmRjNSIsImlhdCI6MTQ3MzI3NTQwOSwiaXNzIjoib2F1dGgzLm9yZyIsImF1ZCI6Im9hdXRoMy5vcmciLCJhenAiOiJvYXV0aDMub3JnIiwic3ViIjoiIiwia2lkIjoib2F1dGgzLm9yZyIsInNjcCI6IiIsImFzIjoibG9naW4iLCJncnQiOiJwYXNzd29yZCIsInNydiI6ZmFsc2UsImsiOiJvYXV0aDMub3JnIiwiYXBwIjoib2F1dGgzLm9yZyIsImF4cyI6W10sInVzciI6IjFlMzAxOTBjZGJiMWM4Yjg4MmJiNTg0OTQ1OGNlZWEzYTk1NTI4ZjIiLCJhY3MiOltdLCJpZHgiOiJxTFNOVHYwTG11YkFnSTc4eEo3d2FlOHVNc1FORFhWVDFsVWRGdHdVbHNpN1hiRnY3OTFVSFlhNE81RkNaeGtDIiwicmVmcmVzaCI6dHJ1ZX0.q2AgyzclADm8LBIbkazbr9Ji_6lj0dS-OhOwHBKimbc6gNlJUpSAlUEKMhEPswYkIIw9oIzOdf2-13FRpk6ZSa7NxRcZ37B6TBMpVzmHojnyXa025uht3CX7UdBtXMsxOSNSEv-m2CLLfq89j2Zr0kwdiUvpb9oo2IwxWPJMgmc'
//, debug: true
});
var opts = leChallengeDns.getOptions();
var domain = 'test.daplie.me';
var challenge = 'xxx-acme-challenge-xxx';
setTimeout(function () {
leChallengeDns.test(opts, domain, challenge, null, function (err) {
// if there's an error, there's a problem
if (err) { throw err; }
console.log('test passed');
});
}, 300);