tech5usa / TLSential

A server for providing short-lived TLS certificates to all services within a firewall restricted network.
GNU General Public License v3.0
15 stars 2 forks source link

Cb/14 domain parsing #61

Closed brooks42 closed 4 years ago

brooks42 commented 4 years ago

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.

todo[bot] commented 4 years ago

Move this to acme Service so we can mock here

https://github.com/ImageWare/TLSential/blob/7238d78d1bc617bdabe68b1fdc09f97f1250ee00/model/certificate.go#L122-L125


This comment was generated by todo based on a TODO comment in 7238d78d1bc617bdabe68b1fdc09f97f1250ee00 in #61. cc @ImageWare.