Skip to content

Commit

Permalink
feat: add dns-account-01 integration test in chisel
Browse files Browse the repository at this point in the history
  • Loading branch information
sheurich committed Feb 8, 2024
1 parent f10abd2 commit 34df64d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 0 deletions.
16 changes: 16 additions & 0 deletions test/chisel2.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,8 @@ def auth_and_issue(domains, chall_type="dns-01", email=None, cert_output=None, c
cleanup = do_http_challenges(client, authzs)
elif chall_type == "dns-01":
cleanup = do_dns_challenges(client, authzs)
elif chall_type == "dns-account-01":
cleanup = do_dns_account_challenges(client, authzs)
elif chall_type == "tls-alpn-01":
cleanup = do_tlsalpn_challenges(client, authzs)
else:
Expand Down Expand Up @@ -153,6 +155,20 @@ def cleanup():
challSrv.remove_dns01_response(host)
return cleanup

def do_dns_account_challenges(client, authzs):
cleanup_hosts = []
for a in authzs:
c = get_chall(a, challenges.DNSACCOUNT01)
name, value = (c.validation_domain_name(client.net.account.uri, a.body.identifier.value),
c.validation(client.net.key))
cleanup_hosts.append(name)
challSrv.add_dns01_response(name, value)
client.answer_challenge(c, c.response(client.net.key))
def cleanup():
for host in cleanup_hosts:
challSrv.remove_dns01_response(host)
return cleanup

def do_http_challenges(client, authzs):
cleanup_tokens = []
challs = [get_chall(a, challenges.HTTP01) for a in authzs]
Expand Down
3 changes: 3 additions & 0 deletions test/v2_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@
import challtestsrv
challSrv = challtestsrv.ChallTestServer()

def test_dns_account_challenge():
chisel2.auth_and_issue([random_domain(), random_domain()], chall_type="dns-account-01")

def test_multidomain():
chisel2.auth_and_issue([random_domain(), random_domain()])

Expand Down

0 comments on commit 34df64d

Please sign in to comment.