Redesign name validation API to allow extensibility in the types of names#218
Redesign name validation API to allow extensibility in the types of names#218briansmith wants to merge 2 commits intomainfrom
Conversation
…ames. In particular, prepare for allowing IP addresses in an API-compatible way.
Codecov Report
@@ Coverage Diff @@
## main #218 +/- ##
==========================================
+ Coverage 51.91% 55.07% +3.16%
==========================================
Files 17 18 +1
Lines 2034 2048 +14
==========================================
+ Hits 1056 1128 +72
+ Misses 978 920 -58
Continue to review full report at Codecov.
|
| /// A name that identifies a subject. | ||
| #[derive(Clone, Copy)] | ||
| #[non_exhaustive] | ||
| pub enum Name<'a> { |
There was a problem hiding this comment.
As this enum is opaque, I think the public API is missing some way for external users to build this. Possibly a DnsNameRef::to_name()?
There was a problem hiding this comment.
Probably just impl<'a> From<DnsNameRef<'a> for Name<'a>?
There was a problem hiding this comment.
The enum isn't opaque, but I've added the From implementation anyway.
|
So...here's the thing I don't like about this API: Almost definitely we're going to add IP address support to it to support a few niche users. Probably we'd eventually add other kinds of names (directoryName and emailAddress come to mind) that almost no applications will want to use--especially for TLS server names. If we have APIs with |
|
Maybe you could set it up such that EndEntity only supports some kinds in the default configuration, and you have to explicitly enable other kinds when building the EndEntity? |
|
Any progress? |
In particular, prepare for allowing IP addresses in an API-compatible way.