-
Notifications
You must be signed in to change notification settings - Fork 165
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Redesign name validation API to allow extensibility in the types of names #218
base: main
Are you sure you want to change the base?
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.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me!
/// A name that identifies a subject. | ||
#[derive(Clone, Copy)] | ||
#[non_exhaustive] | ||
pub enum Name<'a> { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Probably just impl<'a> From<DnsNameRef<'a> for Name<'a>
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.