Skip to content

Commit c3a8ca7

Browse files
Disables DNS provider test mode where unsupported
Improves the DNS provider test functionality by disabling the test mode for providers that do not support it. This change ensures that the credential test only runs for DNS providers that implement a test function, providing a clearer user experience and preventing unexpected errors.
1 parent cd2f0e5 commit c3a8ca7

File tree

4 files changed

+67
-58
lines changed

4 files changed

+67
-58
lines changed

src/Certify.Core/Management/CertifyManager/CertifyManager.DeploymentTasks.cs

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -566,8 +566,17 @@ public async Task<ActionResult> TestCredentials(string storageKey)
566566
{
567567
return new ActionResult { IsSuccess = false, Message = "Could not create DNS provider API. Invalid or unrecognised." };
568568
}
569-
570-
return await dnsProvider.Test();
569+
else
570+
{
571+
if (dnsProvider.IsTestModeSupported == false)
572+
{
573+
return new ActionResult { IsSuccess = false, Message = "This DNS provider does not support credential testing." };
574+
}
575+
else
576+
{
577+
return await dnsProvider.Test();
578+
}
579+
}
571580
}
572581
catch (Exception exp)
573582
{

src/Certify.Providers/DNS/CertifyDns/DnsProviderCertifyDns.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ public DnsProviderCertifyDns() : base()
270270

271271
public async Task<ActionResult> Test()
272272
{
273-
return await Task.FromResult(new ActionResult { IsSuccess = true, Message = "Test completed, but no zones returned." });
273+
return await Task.FromResult(new ActionResult { IsSuccess = true, Message = "There is no supported test for this provide type." });
274274
}
275275

276276
public async Task<ActionResult> CreateRecord(DnsRecord request)

src/Certify.Providers/DNS/CertifyManaged/DnsProviderCertifyManaged.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ public static ChallengeProviderDefinition Definition
3636
new ProviderParameter{ Key="authkey",Name="Client ID", IsRequired=true, IsCredential=true, IsPassword=false, Description="API Auth Key" },
3737
new ProviderParameter{ Key="authsecret",Name="Client Secret", IsRequired=true, IsCredential=true, IsPassword=true, Description="API Auth Secret" }
3838
},
39-
IsTestModeSupported = true,
39+
IsTestModeSupported = false,
4040
ChallengeType = SupportedChallengeTypes.CHALLENGE_TYPE_DNS,
4141
Config = "Provider=Certify.Providers.DNS.CertifyManaged",
4242
HandlerType = ChallengeHandlerType.INTERNAL

0 commit comments

Comments
 (0)