-
Notifications
You must be signed in to change notification settings - Fork 75
Add value field to ParsedExtension::UnsupportedExtension #206
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
Conversation
👋 Thanks for the PR!
I believe @chifflier is preparing a new semver breaking release, so that might not be a non-starter. However, I also left a comment showing a way to accomplish this without a code change so perhaps it's better to not add new API surface at all? |
Your comment addressed my issue, so I will be closing this. |
See my comment. |
I think the remaining clippy failures are addressed in #203. |
@cpu Alright, I guess I'll merge when that PR eventually gets merged. |
While not strictly required, this API is much nicer than using Here's a specific usage example: https://github.com/jean-airoldie/rcgen/blob/30f01893a8002e5c7dd12a4a224ce3f1b70449ba/rcgen/src/csr.rs?pain=#L209-L218 |
@jean-airoldie Thank you for the PR and the discussion About the extensions and API, I am totally in favor of updating the API if this makes things easier. I also realize that there is no pattern visitor (like for certificates and CRL). Would it be useful for your use case? |
Alright, I will wait for that then.
If the CSR visitor pattern walk method is recursive, meaning it would walk over each |
Hi @jean-airoldie Can you check how you code can be adapted? Looking at your code, I think it shouldn't be too complicated
I see. I wonder if this is more a performance problem (avoiding deep-parsing unknown extensions) or an API problem, because if using the visitor the extensions will be parsed anyway, so not improving performance. |
de07497
to
54a936d
Compare
* This is a breaking change. * Allows a user to manually parse the value of a custom extension. * Add tests. * Fix clippy & run rustfmt
54a936d
to
94a003f
Compare
@chifflier Alright I rebased into master. I also squashed my commits so I'm gonna need one review to see if CI passes (forgot about that quirk). I feel that this API is satisfactory, but as far as I understand a visitor API would also do the trick. For my use case, I think the visitor API would result in slightly less code, so I don't feel its necessarily needed. As a side note, I'm not a big fan of |
It seems the CI passes, I'll review the PR as soon as possible
You can have a look at the visitor API in #209
Agreed, the naming is not satisfying, but I had to use a different function name than the traits and I was not very inspired. |
Alright I'll try that.
Yeah I guess what I meant is I didn't understand why you wanted to use a different name than the trait. If the |
Merged, thanks! |
This is the simplest solution I could think off. However this is a breaking change, which isn't ideal.
Closes #205.