We need to support validation for domains, so callers to the API can receive better error handling.
Approach
Iterates through each of the given domain names and checks that they're a valid domain, and that they have an empty scheme.
Testing
Added 2 new test cases for wildcard and scheme-containing domains.
Misc.
I get a 429 from ACME when running the unit tests because it failed the domain check for schemes too often, might be a good move to eventually mock out ACME and be able to make this call without actually performing the registration.
This PR addresses the following issues:
Domain validation in the
NewCertificate
function.Context
We need to support validation for domains, so callers to the API can receive better error handling.
Approach
Iterates through each of the given domain names and checks that they're a valid domain, and that they have an empty scheme.
Testing
Added 2 new test cases for wildcard and scheme-containing domains.
Misc.
I get a 429 from ACME when running the unit tests because it failed the domain check for schemes too often, might be a good move to eventually mock out ACME and be able to make this call without actually performing the registration.