Skip to content

Commit

Permalink
Fix method names to fit in with convention, update XML docs
Browse files Browse the repository at this point in the history
  • Loading branch information
MatthewSteeples committed Aug 17, 2017
1 parent 756a2a2 commit 8764cad
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 20 deletions.
26 changes: 13 additions & 13 deletions ACMESharp/ACMESharp/ACME/Providers/DnsMadeEasyChallengeHandler.cs
Original file line number Diff line number Diff line change
Expand Up @@ -25,29 +25,29 @@ public bool IsDisposed
public void CleanUp(Challenge c)
{
var dnsChallenge = (DnsChallenge)c;
var domainDetails = getDomainId(dnsChallenge);
var domainDetails = GetDomainId(dnsChallenge);

var records = managedPath + domainDetails.DomainId + "/records";
CleanUp(dnsChallenge, domainDetails, records);
}

private void CleanUp(DnsChallenge dnsChallenge, DomainDetails domainDetails, string records)
{
string recordId = getRecordId(dnsChallenge, domainDetails, records);
string recordId = GetRecordId(dnsChallenge, domainDetails, records);

if (!string.IsNullOrEmpty(recordId))
{
var wr = createRequest(records + "/" + recordId);
var wr = CreateRequest(records + "/" + recordId);
wr.Method = "DELETE";

using (var response = wr.GetResponse())
{ }
}
}

private string getRecordId(DnsChallenge dnsChallenge, DomainDetails domainDetails, string records)
private string GetRecordId(DnsChallenge dnsChallenge, DomainDetails domainDetails, string records)
{
var wr = createRequest(records);
var wr = CreateRequest(records);
wr.Method = "GET";

var recordNameToFind = dnsChallenge.RecordName.Replace("." + domainDetails.DomainName, string.Empty);
Expand Down Expand Up @@ -77,15 +77,15 @@ public void Dispose()
public void Handle(Challenge c)
{
var dnsChallenge = (DnsChallenge)c;
var domainDetails = getDomainId(dnsChallenge);
var domainDetails = GetDomainId(dnsChallenge);

var records = managedPath + domainDetails.DomainId + "/records";

CleanUp(dnsChallenge, domainDetails, records);

var recordNameToAdd = dnsChallenge.RecordName.Replace("." + domainDetails.DomainName, string.Empty);

var wr = createRequest(records);
var wr = CreateRequest(records);
wr.Method = "POST";

using (var request = new StreamWriter(wr.GetRequestStream()))
Expand Down Expand Up @@ -115,20 +115,20 @@ public void Handle(Challenge c)
}
}

DomainDetails getDomainId(DnsChallenge dnsChallenge)
DomainDetails GetDomainId(DnsChallenge dnsChallenge)
{
var startIndex = dnsChallenge.RecordName.IndexOf(".") + 1;

return getDomainId(dnsChallenge, startIndex);
return GetDomainId(dnsChallenge, startIndex);
}

DomainDetails getDomainId(DnsChallenge dnsChallenge, int startIndex)
DomainDetails GetDomainId(DnsChallenge dnsChallenge, int startIndex)
{
try
{
var domainName = dnsChallenge.RecordName.Substring(startIndex);

var wr = createRequest(managedPath + nameQuery + domainName);
var wr = CreateRequest(managedPath + nameQuery + domainName);
using (var response = wr.GetResponse())
{
using (var content = new StreamReader(response.GetResponseStream()))
Expand All @@ -141,7 +141,7 @@ DomainDetails getDomainId(DnsChallenge dnsChallenge, int startIndex)
catch (WebException wex)
{
startIndex = dnsChallenge.RecordName.IndexOf(".", startIndex) + 1;
return getDomainId(dnsChallenge, startIndex);
return GetDomainId(dnsChallenge, startIndex);
}
}

Expand Down Expand Up @@ -169,7 +169,7 @@ class DomainRequest : DomainResponse
public string value { get; set; }
}

WebRequest createRequest(string url)
WebRequest CreateRequest(string url)
{
if (Staging)
url = "https://api.sandbox.dnsmadeeasy.com/V2.0/" + url;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,21 +8,20 @@
namespace ACMESharp.ACME.Providers
{
/// <summary>
/// Provider for a Challenge Handler that outputs the manual steps
/// needed to be completed by the operator.
/// Provider for a Challenge Handler that updates the TXT records on a
/// DNS Made Easy account.
/// </summary>
/// <remarks>
/// When the output resolves to a file and that file already exists,
/// unless either the Append or Overwrite parameters are specified
/// as true, an exception will be raised.
/// The staging environment is available as an option, but Let's Encrypt
/// won't be able to read these values, so this is for debugging only
/// </remarks>
[ChallengeHandlerProvider("dnsme",
ChallengeTypeKind.DNS,
Label = "DNSMadeEasy Provider",
Description = "A microsoft dns provider for handling Challenges." +
Description = "A DNS Made Easy provider for handling Challenges." +
" This provider supports the DNS" +
" Challenge type and computes all the necessary" +
" response values. It will create DNS entries.")]
" response values. It will create DNS entries in your account.")]
public class DnsMadeEasyChallengeHandlerProvider : IChallengeHandlerProvider
{
public static readonly ParameterDetail API_KEY = new ParameterDetail(
Expand Down

0 comments on commit 8764cad

Please sign in to comment.